java.lang.Object
org.jhotdraw8.collection.primitive.DenseIntSet8Bit
org.jhotdraw8.collection.primitive.GrowableIntSet8Bit
- All Implemented Interfaces:
IntSet
Extension of
DenseIntSet8Bit that can be used, when
the size of the set is not known.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAsInt(int element) Adds an element to the set.booleancontainsAsInt(int element) Checks if the set contains the specified element.booleanremoveAsInt(int element) Removes the specified element from the set.Methods inherited from class org.jhotdraw8.collection.primitive.DenseIntSet8Bit
capacity, clear, equals, hashCode, setCapacity, toLongArray, toString
-
Constructor Details
-
GrowableIntSet8Bit
public GrowableIntSet8Bit()
-
-
Method Details
-
addAsInt
public boolean addAsInt(int element) Adds an element to the set.Automatically increases the capacity of the set if needed.
- Specified by:
addAsIntin interfaceIntSet- Overrides:
addAsIntin classDenseIntSet8Bit- Parameters:
element- the element- Returns:
- true if the element was added, false if it was already in the set.
-
removeAsInt
public boolean removeAsInt(int element) Removes the specified element from the set.Automatically increases the capacity of the set if needed.
- Specified by:
removeAsIntin interfaceIntSet- Overrides:
removeAsIntin classDenseIntSet8Bit- Parameters:
element- an element- Returns:
- true if the element was in the set, false otherwise
-
containsAsInt
public boolean containsAsInt(int element) Checks if the set contains the specified element.Automatically increases the capacity of the set if needed.
- Specified by:
containsAsIntin interfaceIntSet- Overrides:
containsAsIntin classDenseIntSet8Bit- Parameters:
element- an element- Returns:
- true if the element is in the set.
- Throws:
ArrayIndexOutOfBoundsException- if element is outside of the capacity range.
-