• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Sequence类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.pivot.collections.Sequence的典型用法代码示例。如果您正苦于以下问题:Java Sequence类的具体用法?Java Sequence怎么用?Java Sequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Sequence类属于org.apache.pivot.collections包,在下文中一共展示了Sequence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: itemsRemoved

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Override
public void itemsRemoved(List<T> list, int index, Sequence<T> items) {
    if (!updating) {
        // Remove the items from the view
        for (int i = 0, n = items.getLength(); i < n; i++) {
            T item = items.get(i);

            int viewIndex = view.indexOf(item);

            if (viewIndex != -1) {
                Sequence<T> removed = view.remove(viewIndex, 1);
                listListeners.itemsRemoved(FilteredList.this, viewIndex, removed);
            }
        }
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:17,代码来源:FilteredList.java


示例2: remove

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
/**
 * Removes an item from the view and the backing list.
 *
 * @param item
 * The item to remove.
 */
@Override
public int remove(T item) {
    if (view == null) {
        throw new IllegalStateException();
    }

    int index;

    updating = true;
    try {
        // Remove the item from the view
        index = view.indexOf(item);
        if (index != -1) {
            Sequence<T> removed = view.remove(index, 1);
            listListeners.itemsRemoved(this, index, removed);
        }

        // Remove the item from the source
        source.remove(item);
    } finally {
        updating = false;
    }

    return index;
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:32,代码来源:FilteredList.java


示例3: clear

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
/**
 * Clears the view and removes the cleared items from the backing list.
 */
@Override
public void clear() {
    if (view == null) {
        throw new IllegalStateException();
    }

    updating = true;
    try {
        // Remove all items from the view
        Sequence<T> removed = view.remove(0, view.getLength());
        listListeners.listCleared(this);

        // Remove the items from the source
        for (int i = 0, n = removed.getLength(); i < n; i++) {
            source.remove(removed.get(i));
        }
    } finally {
        updating = false;
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:24,代码来源:FilteredList.java


示例4: getCheckedPacks

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
/**
 * Get only packs checked in treeview
 * @param sequence of checked paths in treeview
 * @return list of checked packs
 */
public List<Pack> getCheckedPacks(Sequence<Path> list) {
    List<Pack> selected = new ArrayList<Pack>();

    if (list.getLength() > 0) {
        Path p;
        for(int i = 0; i < list.getLength(); i++) {
            p = list.get(i);
            TreeNode node = treeData.get(p.get(0));
            for(Pack P:packs) {
                if (node.getParent() == null && P.getName().equalsIgnoreCase(node.getText()) ) {
                    selected.add(P);
                    break;
                }
            }
        }
    }
    return selected;
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:24,代码来源:ScanFacade.java


示例5: getSelectedSongs

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Sequence<Song> getSelectedSongs() {
    if (songTable.getFirstSelectedIndex() == -1) {
        // nothing is selected, return all
        return (Sequence<Song>) songTable.getTableData();
    } else {
        return (Sequence<Song>) songTable.getSelectedRows();
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:10,代码来源:SongTablePane.java


示例6: perform

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Override @SuppressWarnings("unchecked")
public void perform(Component source) {
    Sequence<Track> selectedTracks = selectedOnly ? main.getSelectedDownloadTracks() : new ArrayList<Track>();
    Iterator<Track> it = main.getDownloadTracks().iterator();
    while (it.hasNext()) {
        Track track = it.next();
        if ((selectedOnly && selectedTracks.indexOf(track) != -1)
            || (!selectedOnly && successfulOnly && track.getStatus().isSuccessful())
            || (!selectedOnly && !successfulOnly && track.getStatus().isFinished())) {
            Services.getDownloadService().cancelDownload(track, removeFromDisc);
            it.remove();
            selectedTracks.remove(track);
        }
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:16,代码来源:RemoveDownloadsAction.java


示例7: createGroovejamesLink

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
private static String createGroovejamesLink(Sequence<Song> songs) {
    StringBuilder sb = new StringBuilder("groovejames://song");
    for (int i = 0, len = songs.getLength(); i < len; i++) {
        Song song = songs.get(i);
        sb.append(i == 0 ? '?' : '&');
        sb.append("id=").append(song.getSongID());
        if (!isNullOrEmpty(song.getSongName())) {
            sb.append("&songName=").append(urlencode(song.getSongName()));
        }
    }
    sb.append("&autoplay=true");
    return sb.toString();
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:14,代码来源:ShareAction.java


示例8: perform

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Override public void perform(Component source) {
    Sequence<Song> selectedRows = main.getSelectedPlayerSongs();
    for (int i = 0, len = selectedRows.getLength(); i < len; i++) {
        Song selectedSong = selectedRows.get(i);
        main.download(selectedSong);
    }
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:8,代码来源:SongKeepAction.java


示例9: copyToClipboard

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
public void copyToClipboard(Sequence<String> data)
{
    if (data.getLength() > 0) {
        String selCb = ""; // full selection data string
        for (int i = 0; i < data.getLength(); i++) { // concat selection with line ends
            selCb = String.format("%s%s%n", selCb, data.get(i));//selCb += sel.get(i) + "\n"; 
        }
        
        Out.print(LOG_LEVEL.DEBUG, "Copied to Clipboard: "+ selCb);
        StringSelection selection = new StringSelection(selCb);
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        clipboard.setContents(selection, selection);
    }
}
 
开发者ID:DevComPack,项目名称:setupmaker,代码行数:15,代码来源:BuildFacade.java


示例10: createImmutablePath

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Sequence.Tree.ImmutablePath createImmutablePath() {
    return new Sequence.Tree.ImmutablePath();
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:8,代码来源:AbstractPivotBeanConfiguration.java


示例11: createTree

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Bean
@Lazy
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Override
public Sequence.Tree<? extends Object> createTree() {
    return new Sequence.Tree<>();
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:8,代码来源:AbstractPivotBeanConfiguration.java


示例12: processCollectionObject

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@SuppressWarnings(value = "unchecked")
public final void processCollectionObject(Object coll) {
    if (coll != null) {
        if (coll instanceof java.util.List) {
            process((java.util.List<T>) coll);
        } else if (coll instanceof java.util.Set) {
            process((java.util.Set<T>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Set) {
            process((org.apache.pivot.collections.Set<T>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Sequence) {
            if (coll instanceof org.apache.pivot.collections.List) {
                process((org.apache.pivot.collections.List<T>) coll);
            } else {
                process((org.apache.pivot.collections.Sequence<T>) coll);
            }
        } else if (coll instanceof java.util.Map) {
            process((java.util.Map<T, V>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Map) {
            process((org.apache.pivot.collections.Map<T, V>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Dictionary) {
            process((org.apache.pivot.collections.Dictionary<T, V>) coll);
        } else if (coll instanceof java.util.Queue) {
            process((java.util.Queue<T>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Queue) {
            process((org.apache.pivot.collections.Queue<T>) coll);
        } else if (coll instanceof org.apache.pivot.collections.Stack) {
            process((org.apache.pivot.collections.Stack<T>) coll);
        } else if (coll.getClass().isArray()) {
            process((T[]) coll);
        }
    }
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:33,代码来源:CollectionHandlerAdapter.java


示例13: getFilteredCollection

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public K getFilteredCollection(K src) {
    if ((src != null) && (getFilter() != null)) {
        Filter<T> fil = getFilter();
        K result = null;

        try {
            Class.forName(src.getClass().getName());
            result = (K) src.getClass().newInstance();
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
            Logger.getLogger(CollectionFilter.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            if (result != null) {
                Iterator<T> srcIterator = src.iterator();

                while (srcIterator.hasNext()) {
                    T item = srcIterator.next();

                    if (fil.include(item)) {
                        if (src instanceof Sequence<?>) {
                            ((Sequence<T>) result).add(item);
                        } else if (src instanceof Group<?>) {
                            ((Group<T>) result).add(item);
                        }
                    }
                }
            }
        }

        return src;
    }

    return src;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:35,代码来源:CollectionFilter.java


示例14: isCollectionOrSequence

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
public static boolean isCollectionOrSequence(Class<?> type) {
    return (ClassUtils.isAssignable(type, java.util.Collection.class))
            || (ClassUtils.isAssignable(type,
                    org.apache.pivot.collections.Collection.class))
            || (ClassUtils.isAssignable(type,
                    org.apache.pivot.collections.Sequence.class));
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:8,代码来源:LumpiUtil.java


示例15: isCollectionOrSequenceOrArrayOrEnum

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
public static boolean isCollectionOrSequenceOrArrayOrEnum(Class<?> type) {
    if (!((ClassUtils.isAssignable(type, java.util.Collection.class)))
            || (ClassUtils.isAssignable(type,
                    org.apache.pivot.collections.Collection.class))
            || (ClassUtils.isAssignable(type,
                    org.apache.pivot.collections.Sequence.class))) {
        return type.isArray() || type.isEnum();
    }

    return true;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:12,代码来源:LumpiUtil.java


示例16: contains

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
public static boolean contains(Sequence<? super Object> seq, Object obj) {
    if (seq != null) {
        return (seq.indexOf(obj) >= 0);
    }

    return false;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:8,代码来源:LumpiUtil.java


示例17: containsAny

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
public static boolean containsAny(Sequence<? super Object> seq, Object... objs) {
    if (seq != null) {
        if (ArrayUtils.isNotEmpty(objs)) {
            for (Object obj : objs) {
                if (seq.indexOf(obj) >= 0) {
                    return true;
                }
            }
        } else {
            return contains(seq, null);
        }
    }

    return false;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:16,代码来源:LumpiUtil.java


示例18: modifyValueBeforeSubmit

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Override
public Sequence<File> modifyValueBeforeSubmit(Sequence<File> value) {
    if (value == null) {
        return new ArrayList<>();
    }

    return value;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:9,代码来源:AbstractSubmitableFileBrowserSheet.java


示例19: canSubmit

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@Override
public boolean canSubmit(Sequence<File> value) {
    if (value != null) {
        return (value.getLength() > 0);
    }

    return false;
}
 
开发者ID:moosbusch,项目名称:Lumpi,代码行数:9,代码来源:AbstractSubmitableFileBrowserSheet.java


示例20: getSelectedDownloadTracks

import org.apache.pivot.collections.Sequence; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Sequence<Track> getSelectedDownloadTracks() {
    return (Sequence<Track>) downloadsTable.getSelectedRows();
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:5,代码来源:Main.java



注:本文中的org.apache.pivot.collections.Sequence类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NewJungleTree类代码示例发布时间:2022-05-22
下一篇:
Java ODataClient类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap