Package java.util

Examples of java.util.SortedMap.lastKey()


                if (flushAll) {
                    highestFlushLevel =
      envImpl.getDbMapTree().getHighestLevel();
                } else {
                    highestFlushLevel =
                        ((Integer) newDirtyMap.lastKey()).intValue();
                    if (flushExtraLevel) {
                        highestFlushLevel += 1;
                    }
                }
            } else {
View Full Code Here


                candidateProperties.put( value, key );
            }
        }
        if ( !candidateProperties.isEmpty() )
        {
            String value = candidateProperties.lastKey().toString();
            String key = candidateProperties.get( value ).toString();
            path = path.substring( value.length() );
            path = path.replace( '\\', '/' );
            return "${" + key + "}" + path;
        }
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", map.subMap("A", "C").lastKey(), "B");

        Comparator c = map.comparator();
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 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) 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

/* 155 */     SortedMap sm = (SortedMap)this.maps[0];
/* 156 */     SortedMap hm = sm.headMap(key);
/* 157 */     if (hm.isEmpty()) {
/* 158 */       return null;
/*     */     }
/* 160 */     return hm.lastKey();
/*     */   }
/*     */
/*     */   public OrderedMapIterator orderedMapIterator()
/*     */   {
/* 173 */     return new BidiOrderedMapIterator(this);
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

        Integer key = new Integer(index + 1);
        SortedMap head = formattingRuns.headMap(key);
        if (head.isEmpty())
            throw new IllegalStateException("Should not reach here.  No font found.");
        else
            return ((Short) head.get(head.lastKey())).shortValue();
    }

    /**
     * @return  The number of formatting runs used. There will always be at
     *          least one of font NO_FONT.
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.