Provides static methods for creating mutable
instances easily and other static methods for working with Sets.
Note: This was copied from the com.google.android.collect.Lists class
- Author
- markf.nosp@m.@goo.nosp@m.gle.c.nosp@m.om (Mark Friedman)
Definition at line 23 of file Sets.java.
◆ newHashSet() [1/2]
static <K> HashSet<K> com.google.appinventor.components.runtime.collect.Sets.newHashSet |
( |
| ) |
|
|
static |
Creates an empty
instance.
Note: if
is an Enum type, use {} instead. Note: if you only need an immutable empty Set, use Collections#emptySet instead.
- Returns
- a newly-created, initially-empty
Definition at line 36 of file Sets.java.
◆ newHashSet() [2/2]
static <E> HashSet<E> com.google.appinventor.components.runtime.collect.Sets.newHashSet |
( |
E... |
elements | ) |
|
|
static |
Creates a
instance containing the given elements.
Note: due to a bug in javac 1.5.0_06, we cannot support the following:
Set<Base> set = Sets.newHashSet(sub1, sub2);
where
and
are references to subtypes of
, not of
itself. To get around this, you must use:
Set<Base>
set = Sets.<Base>
newHashSet(sub1, sub2);
- Parameters
-
elements | the elements that the set should contain |
- Returns
- a newly-created containing those elements (minus duplicates)
Definition at line 57 of file Sets.java.
◆ newSortedSet()
static <E> SortedSet<E> com.google.appinventor.components.runtime.collect.Sets.newSortedSet |
( |
E... |
elements | ) |
|
|
static |
Creates a
instance containing the given elements.
- Parameters
-
elements | the elements that the set should contain |
- Returns
- a newly-created containing those elements (minus duplicates)
Definition at line 71 of file Sets.java.
The documentation for this class was generated from the following file:
- C:/Users/Ulli/appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/collect/Sets.java