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

The following examples show how to use java.util.Collections#checkedSortedSet() . 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
Source File: OldCollectionsTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void test_checkedSortedSetLjava_util_SortedSetLjava_lang_Class() {
    TreeSet ts = new TreeSet<Integer>();

    SortedSet ss = Collections.checkedSortedSet(ts, Integer.class);

    ss.add(new Integer(1));

    try {
        ss.add(new Double(3.14));
        fail("ClassCastException expected");
    } catch (ClassCastException e) {
        //expected
    }
}
 
Example 2
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 3
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 4
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 5
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 6
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 7
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 8
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 9
Source File: java_util_Collections_CheckedSortedSet.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 10
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 11
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 12
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 13
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 14
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 15
Source File: java_util_Collections_CheckedSortedSet.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 16
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 17
Source File: java_util_Collections_CheckedSortedSet.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 18
Source File: java_util_Collections_CheckedSortedSet.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 19
Source File: java_util_Collections_CheckedSortedSet.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getObject() {
    SortedSet<String> set = new TreeSet<String>();
    set.add("string");
    return Collections.checkedSortedSet(set, String.class);
}
 
Example 20
Source File: java_util_Collections_CheckedSortedSet.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected SortedSet<String> getAnotherObject() {
    SortedSet<String> set = new TreeSet<String>();
    return Collections.checkedSortedSet(set, String.class);
}