Package java.util

Examples of java.util.SortedMap.lastKey()


            ListEventToBytes.toListEvent(update, this, byteCoder);
        }

        // prepare the next update id to use
        if(!sequentialUpdates.isEmpty()) {
            nextUpdateId = ((Integer)sequentialUpdates.lastKey()).intValue() + 1;
        }

        // now that we're up-to-date, listen for further events
        source.addListEventListener(this);
    }
View Full Code Here


            fail("Null value should raise IllegalArgument");
        } catch (IllegalArgumentException e) {
            // expected
        }
        assertEquals("First key should be A", map.firstKey(), "A");
        assertEquals("Last key should be C", map.lastKey(), "C");
        assertEquals("First key in tail map should be B",
            map.tailMap("B").firstKey(), "B");
        assertEquals("Last key in head map should be B",
            map.headMap("C").lastKey(), "B");
        assertEquals("Last key in submap should be B",
View Full Code Here

        SortedMap sm = (SortedMap) makeFullMap();
        Object obj = null;
        for (Iterator it = sm.keySet().iterator(); it.hasNext();) {
            obj = (Object) it.next();
        }
        assertSame(obj, sm.lastKey());
    }
   
    //-----------------------------------------------------------------------   
    public BulkTest bulkTestHeadMap() {
        return new TestHeadMap(this);
View Full Code Here

        SortedMap skipMap = getSkipMap();
        synchronized (skipMap) {
            SortedMap head = skipMap.headMap(new Long(time));
            if (!head.isEmpty()) {
                eventBundleBuffer.clear();
                lastRevision = (Long) head.get(head.lastKey());
            }
        }

        try {
            while (hasNext()) {
View Full Code Here

        SortedMap sm = (SortedMap) maps[0];
        SortedMap hm = sm.headMap(key);
        if (hm.isEmpty()) {
            return null;
        }
        return hm.lastKey();
    }

    //-----------------------------------------------------------------------
    /**
     * Obtains an ordered map iterator.
View Full Code Here

        SortedMap sm = (SortedMap) makeFullMap();
        Object obj = null;
        for (Iterator it = sm.keySet().iterator(); it.hasNext();) {
            obj = (Object) it.next();
        }
        assertSame(obj, sm.lastKey());
    }
   
    //-----------------------------------------------------------------------   
    public BulkTest bulkTestHeadMap() {
        return new TestHeadMap(this);
View Full Code Here

            fail("Null value should raise IllegalArgument");
        } catch (IllegalArgumentException e) {
            // expected
        }
        assertEquals("First key should be A", map.firstKey(), "A");
        assertEquals("Last key should be C", map.lastKey(), "C");
        assertEquals("First key in tail map should be B",
            map.tailMap("B").firstKey(), "B");
        assertEquals("Last key in head map should be B",
            map.headMap("C").lastKey(), "B");
        assertEquals("Last key in submap should be B",
View Full Code Here

        SortedMap map = makeTestSortedMap(oneFactory);
        map.put("A""a");
        map.get("B"); // Entry with value "One" created
        map.put("C", "c");
        assertEquals("First key should be A", map.firstKey(), "A");
        assertEquals("Last key should be C", map.lastKey(), "C");
        assertEquals("First key in tail map should be B",
            map.tailMap("B").firstKey(), "B");
        assertEquals("Last key in head map should be B",
            map.headMap("C").lastKey(), "B");
        assertEquals("Last key in submap should be B",
View Full Code Here

        SortedMap sm = (SortedMap) maps[0];
        SortedMap hm = sm.headMap(key);
        if (hm.isEmpty()) {
            return null;
        }
        return hm.lastKey();
    }

    //-----------------------------------------------------------------------
    /**
     * Obtains an ordered map iterator.
View Full Code Here

        if( tmp == null )
        {   // Find the closest parent position.
            SortedMap headMap = namespacePerms.headMap(key);
            try
            {
                PermissionName lastKey = (PermissionName) headMap.lastKey();
                if( lastKey.isParent(key) == true )
                    tmp = (ArrayList) namespacePerms.get(lastKey);
                else
                {
                    PermissionName[] keys = {};
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.