public class ArraySparseSet<T> extends AbstractFlowSet<T>
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_SIZE |
protected T[] |
elements |
protected int |
maxElements |
protected int |
numElements |
| Constructor and Description |
|---|
ArraySparseSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T e)
Adds
obj to this. |
void |
clear()
implemented, but *very* inefficient.
|
ArraySparseSet<T> |
clone()
Clones the current FlowSet.
|
boolean |
contains(java.lang.Object obj)
Deprecated.
This method uses linear-time lookup. For better performance,
consider using a
HashSet instead, if you require this
operation. |
void |
copy(FlowSet<T> destFlow)
Copies the current FlowSet into dest.
|
void |
difference(FlowSet<T> otherFlow,
FlowSet<T> destFlow)
Returns the set difference (this intersect ~other) of this FlowSet and
other, putting result into dest. |
FlowSet<T> |
emptySet()
implemented, but inefficient.
|
boolean |
equals(java.lang.Object otherFlow) |
void |
intersection(FlowSet<T> otherFlow,
FlowSet<T> destFlow)
Returns the intersection (meet) of this FlowSet and
other,
putting result into dest. |
boolean |
isEmpty()
Returns true if this FlowSet is the empty set.
|
java.util.Iterator<T> |
iterator()
returns an iterator over the elements of the flowSet.
|
void |
remove(int idx) |
void |
remove(java.lang.Object obj)
Removes
obj from this. |
int |
size()
Returns the size of the current FlowSet.
|
java.util.List<T> |
toList()
Returns a unbacked list of elements in this set.
|
void |
union(FlowSet<T> otherFlow,
FlowSet<T> destFlow)
Returns the union (join) of this FlowSet and
other, putting
result into dest. |
add, difference, hashCode, intersection, isSubSet, remove, toString, unionprotected static final int DEFAULT_SIZE
protected int numElements
protected int maxElements
protected T[] elements
public ArraySparseSet<T> clone()
FlowSetpublic FlowSet<T> emptySet()
AbstractFlowSetpublic void clear()
AbstractFlowSetpublic int size()
FlowSetpublic boolean isEmpty()
FlowSetpublic java.util.List<T> toList()
public void remove(java.lang.Object obj)
FlowSetobj from this.public void remove(int idx)
public void union(FlowSet<T> otherFlow, FlowSet<T> destFlow)
FlowSetother, putting
result into dest. dest, other and
this could be the same object.public void intersection(FlowSet<T> otherFlow, FlowSet<T> destFlow)
FlowSetother,
putting result into dest. dest,
other and this could be the same object.intersection in interface FlowSet<T>intersection in class AbstractFlowSet<T>public void difference(FlowSet<T> otherFlow, FlowSet<T> destFlow)
FlowSetother, putting result into dest.
dest, other and this could be the
same object.difference in interface FlowSet<T>difference in class AbstractFlowSet<T>@Deprecated public boolean contains(java.lang.Object obj)
HashSet instead, if you require this
operation.FlowSetobj.public boolean equals(java.lang.Object otherFlow)
equals in class AbstractFlowSet<T>public void copy(FlowSet<T> destFlow)
FlowSet