public class CompositeTupleSet extends AbstractTupleSet
TupleSet implementation for treating a collection of tuple sets as a single, composite tuple set. This composite does not take overlap between contained TupleSets into account.
The TupleSet.addTuple(Tuple)
and setTuple(Tuple)
methods are not supported by this class, and calling these methods will
result in a UnsupportedOperationException. Instead, use the add or set
methods on the desired non-composite tuple set.
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
|
CompositeTupleSet()
Create a new, empty CompositeTupleSet
|
protected |
CompositeTupleSet(boolean listen) |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(java.lang.String name,
java.lang.Class type)
Adds the value to all contained TupleSets that return a true value for
TupleSet.isAddColumnSupported() . |
void |
addColumn(java.lang.String name,
java.lang.Class type,
java.lang.Object defaultValue)
Adds the value to all contained TupleSets that return a true value for
TupleSet.isAddColumnSupported() . |
void |
addColumn(java.lang.String name,
Expression expr)
Adds the value to all contained TupleSets that return a true value for
TupleSet.isAddColumnSupported() . |
void |
addColumn(java.lang.String name,
java.lang.String expr)
Adds the value to all contained TupleSets that return a true value for
TupleSet.isAddColumnSupported() . |
void |
addSet(java.lang.String name,
TupleSet set)
Add a TupleSet to this composite.
|
Tuple |
addTuple(Tuple t)
Not supported.
|
void |
clear()
Clear this TupleSet, calling clear on all contained TupleSet
instances.
|
boolean |
containsSet(TupleSet set)
Indicates if this composite contains the given TupleSet.
|
boolean |
containsTuple(Tuple t)
Indicates if a given Tuple is contained within this TupleSet.
|
TupleSet |
getSet(java.lang.String name)
Get the TupleSet associated with the given name.
|
int |
getTupleCount()
Get the number of tuples in this set.
|
boolean |
hasSet(java.lang.String name)
Indicates if this composite contains a TupleSet with the given name.
|
boolean |
isAddColumnSupported()
Returns true.
|
void |
removeAllSets()
Remove all contained TupleSets from this composite.
|
TupleSet |
removeSet(java.lang.String name)
Remove the TupleSet with the given name from this composite.
|
boolean |
removeTuple(Tuple t)
Removes the tuple from its source set if that source set is contained
within this composite.
|
java.util.Iterator |
setNames()
Get an iterator over the names of all the TupleSets in this composite.
|
java.util.Iterator |
sets()
Get an iterator over all the TupleSets in this composite.
|
Tuple |
setTuple(Tuple t)
Not supported.
|
java.util.Iterator |
tuples()
Return an iterator over the tuples in this tuple set.
|
java.util.Iterator |
tuples(Predicate filter)
Return an iterator over the tuples in this tuple set, filtered by
the given predicate.
|
addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples
public CompositeTupleSet()
protected CompositeTupleSet(boolean listen)
public void addSet(java.lang.String name, TupleSet set)
name
- the name of the TupleSet to addset
- the set to addpublic boolean hasSet(java.lang.String name)
name
- the name to look forpublic boolean containsSet(TupleSet set)
set
- the TupleSet to check for containmentpublic TupleSet getSet(java.lang.String name)
name
- the name of the TupleSet to getpublic java.util.Iterator setNames()
public java.util.Iterator sets()
public TupleSet removeSet(java.lang.String name)
name
- the name of the TupleSet to removepublic void removeAllSets()
public void clear()
TupleSet.clear()
public Tuple addTuple(Tuple t)
t
- the Tuple addTupleSet.addTuple(prefuse.data.Tuple)
public Tuple setTuple(Tuple t)
t
- the Tuple to set as the content of this TupleSetTupleSet.setTuple(prefuse.data.Tuple)
public boolean removeTuple(Tuple t)
t
- the Tuple to removeTupleSet.removeTuple(prefuse.data.Tuple)
public boolean containsTuple(Tuple t)
TupleSet
t
- the tuple to check for containmentTupleSet.containsTuple(prefuse.data.Tuple)
public int getTupleCount()
TupleSet
TupleSet.getTupleCount()
public java.util.Iterator tuples()
TupleSet
TupleSet.tuples()
public java.util.Iterator tuples(Predicate filter)
TupleSet
tuples
in interface TupleSet
tuples
in class AbstractTupleSet
filter
- predicate to apply to tuples in this set, only tuples
for which the predicate evaluates to true are included in the iterationTupleSet.tuples(prefuse.data.expression.Predicate)
public boolean isAddColumnSupported()
isAddColumnSupported
in interface TupleSet
isAddColumnSupported
in class AbstractTupleSet
TupleSet.isAddColumnSupported()
public void addColumn(java.lang.String name, java.lang.Class type, java.lang.Object defaultValue)
TupleSet.isAddColumnSupported()
.addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the name of the data fieldtype
- the type of the data fielddefaultValue
- the defaultValue of the data fieldTupleSet.addColumn(java.lang.String, java.lang.Class, java.lang.Object)
public void addColumn(java.lang.String name, java.lang.Class type)
TupleSet.isAddColumnSupported()
.addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the name of the data fieldtype
- the type of the data fieldTupleSet.addColumn(java.lang.String, java.lang.Class)
public void addColumn(java.lang.String name, Expression expr)
TupleSet.isAddColumnSupported()
.addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the name of the data fieldexpr
- a compiled expression in the prefuse expression
language. The results of applying the expression to a Tuple will
become the data field value for that Tuple.TupleSet.addColumn(java.lang.String, prefuse.data.expression.Expression)
public void addColumn(java.lang.String name, java.lang.String expr)
TupleSet.isAddColumnSupported()
.addColumn
in interface TupleSet
addColumn
in class AbstractTupleSet
name
- the name of the data fieldexpr
- an uncompiled expression in the prefuse expression
language. This will be compiled to a valid expression, and the
results of applying the expression to a Tuple will become the
data field value for that Tuple.TupleSet.addColumn(java.lang.String, java.lang.String)
Copyright ? 2013 Regents of the University of California