Package java.util

Examples of java.util.SortedMap.keySet()


        subMap = tm.subMap(startKey, endKey);
        assertEquals(0, subMap.keySet().size());

        endKey = new Integer(1).toString();
        subMap = tm.subMap(startKey, endKey);
        assertEquals(1, subMap.keySet().size());

        startKey = new Integer(999).toString();
        endKey = startKey;
        subMap = tm.subMap(startKey, endKey);
        assertEquals(0, subMap.keySet().size());
View Full Code Here


        assertEquals(1, subMap.keySet().size());

        startKey = new Integer(999).toString();
        endKey = startKey;
        subMap = tm.subMap(startKey, endKey);
        assertEquals(0, subMap.keySet().size());
    }

    public void test_SubMapKeySet_remove() {
        Set keySet = subMap_default.keySet();
        try {
View Full Code Here

        }

        return new TermPositionVector() {

            private String[] terms =
                    (String[]) termMap.keySet().toArray(new String[termMap.size()]);

            public int[] getTermPositions(int index) {
                return null;
            }
View Full Code Here

        // no tests I can think of
    }
   
    public void testFirstKey() {
        SortedMap sm = (SortedMap) makeFullMap();
        assertSame(sm.keySet().iterator().next(), sm.firstKey());
    }
   
    public void testLastKey() {
        SortedMap sm = (SortedMap) makeFullMap();
        Object obj = null;
View Full Code Here

    }
   
    public void testLastKey() {
        SortedMap sm = (SortedMap) makeFullMap();
        Object obj = null;
        for (Iterator it = sm.keySet().iterator(); it.hasNext();) {
            obj = (Object) it.next();
        }
        assertSame(obj, sm.lastKey());
    }
   
View Full Code Here

        if (! interestingHeaders.containsKey("content-md5")) {
            interestingHeaders.put("content-md5", "");
        }

        // Finally, add all the interesting headers (i.e.: all that startwith x-amz- ;-))
        for (Iterator i = interestingHeaders.keySet().iterator(); i.hasNext(); ) {
            String key = (String)i.next();
            if (key.startsWith(AMAZON_HEADER_PREFIX)) {
                buf.append(key).append(':').append(interestingHeaders.get(key));
            } else {
                buf.append(interestingHeaders.get(key));
View Full Code Here

      }

      return new TermPositionVector()
      {

         private String[] terms = (String[])termMap.keySet().toArray(new String[termMap.size()]);

         public int[] getTermPositions(int index)
         {
            return null;
         }
View Full Code Here

        }
    }

    public void testCustomCharset() throws UnsupportedEncodingException, DecoderException {
        SortedMap map = Charset.availableCharsets();
        Set keys = map.keySet();
        Iterator iterator = keys.iterator();
        log("testCustomCharset: Checking " + keys.size() + " charsets...");
        while (iterator.hasNext()) {
            String name = (String) iterator.next();
            testCustomCharset(name, "testCustomCharset");
View Full Code Here

        // create OrderSets, wiring up parents and children.

        // since sortedMembersByGroup is a SortedMap, the
        // iteration will be in alphabetical order (ie parent groups before their children).
        final Set groupNames = sortedMembersByGroup.keySet();
        final SortedMap orderSetsByGroup = new TreeMap();

        for (final Iterator iter = groupNames.iterator(); iter.hasNext();) {
            final String groupName = (String) iter.next();
            final DeweyOrderSet deweyOrderSet = new DeweyOrderSet(groupName);
View Full Code Here

        }
    }

    public void testCustomCharset() throws UnsupportedEncodingException, DecoderException {
        SortedMap map = Charset.availableCharsets();
        Set keys = map.keySet();
        Iterator iterator = keys.iterator();
        log("testCustomCharset: Checking " + keys.size() + " charsets...");
        while (iterator.hasNext()) {
            String name = (String) iterator.next();
            testCustomCharset(name, "testCustomCharset");
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.