@Beta
public interface IntSet
Modeled closely after the java.util.Set class, except it uses ints instead of Objects.
The additional stipulation on constructors is, not surprisingly, that all constructors must create a set that contains no duplicate elements (as defined above).
Note: Great care must be exercised if mutable objects are used as set elements. The behavior of a set is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is an element in the set. A special case of this prohibition is that it is not permissible for a set to contain itself as an element. Beta class. Classes under com.force.i18n.commons package will be moved into a dedicated project.IntHashSet,
IntMap| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int o)
Adds the specified element to this set if it is not already
present.
|
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(int o)
Returns true if this set contains the specified element.
|
boolean |
containsAll(IntSet set)
Returns true if this set contains all of the elements in the specified set
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
IntIterator |
iterator()
Returns an iterator over the elements in this set.
|
IntSet |
makeEmpty()
Create a new empty IntSet with the same impl
|
boolean |
remove(int o)
Removes the given element from this set if it is present.
|
int |
size()
Returns the number of elements in this set (its cardinality).
|
int[] |
toArray()
Gets the ordered array of ints in the IntSet.
|
IntSet makeEmpty()
int[] toArray()
IntIterator iterator()
int size()
boolean isEmpty()
boolean contains(int o)
o - element whose presence in this set is to be tested.boolean containsAll(IntSet set)
o - set that is being tested for containment.boolean add(int o)
o - element to be added to this set.boolean remove(int o)
o - object to be removed from this set, if present.void clear()
Copyright (c) 2016-2017, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE.txt file in the repository.