Package ca.odell.glazedlists

Examples of ca.odell.glazedlists.BasicEventList


        List<FieldComparator> comparators = new ArrayList<FieldComparator>();
        comparators.add(new FieldComparator("author"));
        comparators.add(new FieldComparator("year"));
        comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();

        // Set up a list of all entries, if keySet==null, or the entries whose
        // ids are in keySet, otherwise:
        if (keySet == null)
            entryList.addAll(database.getEntries());
        else {
            for (String key : keySet)
                entryList.add(database.getEntryById(key));
        }

        entries = new SortedList(entryList, new FieldComparatorStack(comparators));
    }
View Full Code Here


        List<FieldComparator> comparators = new ArrayList<FieldComparator>();
        comparators.add(new FieldComparator("author"));
        comparators.add(new FieldComparator("year"));
        comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();
        // Set up a list of all entries, if keySet==null, or the entries whose
        // ids are in keySet, otherwise:
        if (keySet == null)
            entryList.addAll(bibtex.getEntries());
        else {
            for (String key : keySet)
                entryList.add(bibtex.getEntryById(key));
        }
       
        entries = new SortedList(entryList, new FieldComparatorStack(comparators));

    }
View Full Code Here

        comparators.add(new FieldComparator(pri, priD));
        comparators.add(new FieldComparator(sec, secD));
        comparators.add(new FieldComparator(ter, terD));
        comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();
        SortedList sorter = new SortedList(entryList, new FieldComparatorStack<BibtexEntry>(comparators));

        if ((bes != null) && (bes.length > 0))
        for (int i=0; i<bes.length; i++) {
            sorter.add(bes[i]);
View Full Code Here

            comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));

            comparatorStack = new FieldComparatorStack<BibtexEntry>(comparators);
        }
        // Use glazed lists to get a sorted view of the entries:
        BasicEventList entryList = new BasicEventList();
        SortedList sorter = new SortedList(entryList, comparatorStack);

        if (keySet == null)
            keySet = database.getKeySet();
View Full Code Here

    /**
     * Prepare for the test.
     */
    public void setUp() {
        source  = new BasicEventList();
        cache = new CachingList(source, 15);
    }
View Full Code Here

class WaitEventList extends TransformedList {

    private int waitDuration = 0;

    public WaitEventList(int waitDuration) {
        super(new BasicEventList());
        this.waitDuration = waitDuration;
    }
View Full Code Here

     */
    public PublishFrame(ListPeer peer, String host, int port, String path) throws IOException {
        this.peer = peer;
       
        // publish
        data = peer.publish(new BasicEventList(), path, GlazedListsIO.serializableByteCoder());
       
        // build user interface
        constructStandalone();
       
        // listen for status changes
View Full Code Here

     * @return the {@link EventList} that gets its data from the specified remote
     *      source. This {@link EventList} will contain no data until the connection
     *      completes. This list is not writable.
     */
    public NetworkList subscribe(String host, int port, String path, ByteCoder byteCoder) {
        NetworkList subscribed = new NetworkList(new BasicEventList(), byteCoder);
        ResourceStatus resourceStatus = peer.subscribe(subscribed.getResource(), host, port, path);
        subscribed.setResourceStatus(resourceStatus);
        return subscribed;
    }
View Full Code Here

   
    /**
     * Tests that diff works for a large number of elements.
     */
    public void testMemory() {
        EventList sequence = new BasicEventList(new SparseDifferencesList(new ReallyBigList(1000 * 1000)));
        List modifiedSequence = new SparseDifferencesList(new ReallyBigList(1000 * 1000));
        assertEquals(0, getChangeCount(sequence, modifiedSequence, false, null));

        Random dice = new Random(2);
        for(int i = 0; i < 10; i++) {
View Full Code Here

     *
     * <p>If case sensitivity is specified, an appropriate {@link Comparator} will be
     * used to determine equality between elements.
     */
    private int getChangeCount(String target, String source, boolean caseSensitive) {
        EventList targetList = new BasicEventList();
        targetList.addAll(stringToList(target));
        List sourceList = stringToList(source);

        return getChangeCount(targetList, sourceList, false, caseSensitive ? GlazedLists.caseInsensitiveComparator() : null);
    }
View Full Code Here

TOP

Related Classes of ca.odell.glazedlists.BasicEventList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.