Java Code Examples for java.util.Collections#checkedSortedMap()

The following examples show how to use java.util.Collections#checkedSortedMap() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
PojoWithObjectMapFields fill()
{
    TreeMap<String, String> tm = new TreeMap<String, String>();
    tm.put("foo", "bar");

    EnumMap<GuitarPickup, Size> em = new EnumMap<GuitarPickup, Size>(
            GuitarPickup.class);
    em.put(GuitarPickup.CONTACT, Size.SMALL);

    emptyMap = Collections.emptyMap();
    singletonMap = Collections.singletonMap("key", "value");

    unmodifiableMap = Collections.unmodifiableMap(Collections
            .emptyMap());
    unmodifiableSortedMap = Collections.unmodifiableSortedMap(tm);

    synchronizedMap = Collections.synchronizedMap(em);
    synchronizedSortedMap = Collections.synchronizedSortedMap(tm);

    checkedMap = Collections.checkedMap(em, GuitarPickup.class,
            Size.class);
    checkedSortedMap = Collections.checkedSortedMap(tm, String.class,
            String.class);

    return this;
}
 
Example 2
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 3
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 4
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 5
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 6
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 7
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 8
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 9
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 10
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 11
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 12
Source Project: j2objc   File: Collections2Test.java    License: Apache License 2.0 4 votes vote down vote up
public void test_checkedSortedMapSerializationCompatability() throws Exception {
    SortedMap<String, String> c = new TreeMap<String, String>();
    c = Collections.checkedSortedMap(c, String.class, String.class);
    SerializationTester.assertCompabilityEquals(c, "serialization/org/apache/harmony/tests/java/util/Collections_CheckedSortedMap.golden.ser");
}
 
Example 13
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 14
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 15
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 16
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 17
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 18
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 19
protected SortedMap<String, String> getObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    map.put("key", "value");
    return Collections.checkedSortedMap(map, String.class, String.class);
}
 
Example 20
protected SortedMap<String, String> getAnotherObject() {
    SortedMap<String, String> map = new TreeMap<String, String>();
    return Collections.checkedSortedMap(map, String.class, String.class);
}