public class DefaultTupleSet extends AbstractTupleSet implements EventConstants
TupleSet implementation that maintains a set of heterogeneous Tuples
-- tuples that can come from any backing data source. This class supports
addTuple(Tuple)
and removeTuple(Tuple)
but does not
support adding new columns to contained tuples.
This TupleSet uses a LinkedHashSet
to support fast
lookup of contained tuples while mainting Tuples in the order in which
they are added to the set.
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedHashSet |
m_tuples |
ALL_COLUMNS, DELETE, INSERT, UPDATE
EMPTY_ARRAY
Constructor and Description |
---|
DefaultTupleSet()
Create a new, empty DefaultTupleSet.
|
Modifier and Type | Method and Description |
---|---|
protected Tuple |
addInternal(Tuple t)
Adds a tuple without firing a notification.
|
Tuple |
addTuple(Tuple t)
Add a Tuple to this TupleSet.
|
void |
clear()
Clear this TupleSet, removing all contained Tuples.
|
Tuple[] |
clearInternal()
Clear the internal state without firing a notification.
|
boolean |
containsTuple(Tuple t)
Indicates if a given Tuple is contained within this TupleSet.
|
int |
getTupleCount()
Get the number of tuples in this set.
|
protected boolean |
removeInternal(Tuple t)
Removes a tuple without firing a notification.
|
boolean |
removeTuple(Tuple t)
Remove a Tuple from this TupleSet.
|
Tuple |
setTuple(Tuple t)
Set the TupleSet contents to be a single Tuple.
|
Tuple[] |
toArray()
Get the contents of this TupleSet as an array.
|
java.util.Iterator |
tuples()
Return an iterator over the tuples in this tuple set.
|
addColumn, addColumn, addColumn, addColumn, addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, isAddColumnSupported, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples, tuples
public int getTupleCount()
TupleSet
getTupleCount
in interface TupleSet
TupleSet.getTupleCount()
public Tuple addTuple(Tuple t)
TupleSet
addTuple
in interface TupleSet
t
- the Tuple addTupleSet.addTuple(prefuse.data.Tuple)
public Tuple setTuple(Tuple t)
TupleSet
setTuple
in interface TupleSet
t
- the Tuple to set as the content of this TupleSetTupleSet.setTuple(prefuse.data.Tuple)
protected final Tuple addInternal(Tuple t)
t
- the Tuple to addpublic boolean containsTuple(Tuple t)
TupleSet
containsTuple
in interface TupleSet
t
- the tuple to check for containmentTupleSet.containsTuple(prefuse.data.Tuple)
public boolean removeTuple(Tuple t)
TupleSet
removeTuple
in interface TupleSet
t
- the Tuple to removeTupleSet.removeTuple(prefuse.data.Tuple)
protected final boolean removeInternal(Tuple t)
t
- the tuple to removepublic void clear()
TupleSet
clear
in interface TupleSet
TupleSet.clear()
public Tuple[] clearInternal()
public java.util.Iterator tuples()
TupleSet
tuples
in interface TupleSet
TupleSet.tuples()
public Tuple[] toArray()
Copyright ? 2013 Regents of the University of California