Java Code Examples for java.util.Collections#checkedSortedSet()
The following examples show how to use
java.util.Collections#checkedSortedSet() .
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
Source Project: j2objc File: OldCollectionsTest.java License: Apache License 2.0 | 5 votes |
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 Project: jdk8u-jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 3
Source Project: dragonwell8_jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 4
Source Project: TencentKona-8 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 5
Source Project: TencentKona-8 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 6
Source Project: jdk8u60 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 7
Source Project: jdk8u60 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 8
Source Project: openjdk-jdk8u File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 9
Source Project: openjdk-jdk8u File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 10
Source Project: openjdk-jdk8u-backup File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 11
Source Project: jdk8u-jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 12
Source Project: jdk8u-jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 13
Source Project: jdk8u-jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 14
Source Project: hottub File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 15
Source Project: jdk8u-dev-jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 16
Source Project: openjdk-8-source File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 17
Source Project: openjdk-8 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 18
Source Project: openjdk-8 File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }
Example 19
Source Project: jdk8u_jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getObject() { SortedSet<String> set = new TreeSet<String>(); set.add("string"); return Collections.checkedSortedSet(set, String.class); }
Example 20
Source Project: jdk8u_jdk File: java_util_Collections_CheckedSortedSet.java License: GNU General Public License v2.0 | 4 votes |
protected SortedSet<String> getAnotherObject() { SortedSet<String> set = new TreeSet<String>(); return Collections.checkedSortedSet(set, String.class); }