|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.tuple.AbstractTupleSet
public abstract class AbstractTupleSet
Abstract base class for TupleSet implementations. Provides mechanisms for generating filtered tuple iterators, maintain listeners, and supporting bound client properties.
Field Summary |
---|
Fields inherited from interface prefuse.data.tuple.TupleSet |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
AbstractTupleSet()
|
Method Summary | |
---|---|
void |
addColumn(java.lang.String name,
java.lang.Class type)
Unsupported by default. |
void |
addColumn(java.lang.String name,
java.lang.Class type,
java.lang.Object defaultValue)
Unsupported by default. |
void |
addColumn(java.lang.String name,
Expression expr)
Unsupported by default. |
void |
addColumn(java.lang.String name,
java.lang.String expr)
Unsupported by default. |
void |
addColumns(Schema schema)
Add the data fields of the given Schema to the Tuples in this TupleSet. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Add a PropertyChangeListener to be notified of changes to the properties bounds to this TupleSet. |
void |
addPropertyChangeListener(java.lang.String key,
java.beans.PropertyChangeListener lstnr)
Add a PropertyChangeListener to be notified of changes to a specific property bound to this TupleSet. |
void |
addTupleSetListener(TupleSetListener tsl)
Add a listener to this tuple set that will be notified when tuples are added and removed from the set. |
protected void |
fireTupleEvent(Table t,
int start,
int end,
int type)
Fire a Tuple event. |
protected void |
fireTupleEvent(Tuple[] added,
Tuple[] removed)
Fire a Tuple event. |
protected void |
fireTupleEvent(Tuple t,
int type)
Fire a Tuple event. |
java.lang.Object |
getClientProperty(java.lang.String key)
Get an client property bound to this TupleSet |
boolean |
isAddColumnSupported()
False by default. |
void |
putClientProperty(java.lang.String key,
java.lang.Object value)
Set an arbitrary client property with this TupleSet |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Remove a PropertyChangeListener from this TupleSet. |
void |
removePropertyChangeListener(java.lang.String key,
java.beans.PropertyChangeListener lstnr)
Remove a PropertyChangeListener from this TupleSet for a specific bound property. |
void |
removeTupleSetListener(TupleSetListener tsl)
Remove a listener from this tuple set. |
java.util.Iterator |
tuples(Predicate filter)
Return an iterator over the tuples in this tuple set, filtered by the given predicate. |
java.util.Iterator |
tuples(Predicate filter,
Sort sort)
Return an iterator over the tuples in this tuple set, filtered by the given predicate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface prefuse.data.tuple.TupleSet |
---|
addTuple, clear, containsTuple, getTupleCount, removeTuple, setTuple, tuples |
Constructor Detail |
---|
public AbstractTupleSet()
Method Detail |
---|
public java.util.Iterator tuples(Predicate filter)
TupleSet
tuples
in interface TupleSet
filter
- predicate to apply to tuples in this set, only tuples
for which the predicate evaluates to true are included in the iteration
TupleSet.tuples(prefuse.data.expression.Predicate)
public java.util.Iterator tuples(Predicate filter, Sort sort)
TupleSet
tuples
in interface TupleSet
filter
- predicate to apply to tuples in this set, only tuples
for which the predicate evaluates to true are included in the iteration.
If this value is null, no filtering will be performed.sort
- the sorting criteria by which to order the returned tuples
TupleSet.tuples(prefuse.data.expression.Predicate, prefuse.data.util.Sort)
public void addTupleSetListener(TupleSetListener tsl)
TupleSet
addTupleSetListener
in interface TupleSet
tsl
- the TupleSetListener to addTupleSet.addTupleSetListener(prefuse.data.event.TupleSetListener)
public void removeTupleSetListener(TupleSetListener tsl)
TupleSet
removeTupleSetListener
in interface TupleSet
tsl
- the TupleSetListener to removeTupleSet.removeTupleSetListener(prefuse.data.event.TupleSetListener)
protected void fireTupleEvent(Table t, int start, int end, int type)
t
- the Table on which the event has occurredstart
- the first row changedend
- the last row changedtype
- the type of event, one of
EventConstants.INSERT
or
EventConstants.DELETE
.protected void fireTupleEvent(Tuple t, int type)
t
- the tuple that has been added or removedtype
- the type of event, one of
EventConstants.INSERT
or
EventConstants.DELETE
.protected void fireTupleEvent(Tuple[] added, Tuple[] removed)
added
- array of Tuples that have been added, can be nullremoved
- array of Tuples that have been removed, can be nullpublic boolean isAddColumnSupported()
isAddColumnSupported
in interface TupleSet
TupleSet.isAddColumnSupported()
public void addColumns(Schema schema)
TupleSet
addColumns
in interface TupleSet
schema
- the Schema of data columns to add to this TupleSetTupleSet.addColumns(prefuse.data.Schema)
public void addColumn(java.lang.String name, java.lang.Class type, java.lang.Object defaultValue)
addColumn
in interface TupleSet
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)
addColumn
in interface TupleSet
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)
addColumn
in interface TupleSet
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)
addColumn
in interface TupleSet
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)
public void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
TupleSet
addPropertyChangeListener
in interface TupleSet
lstnr
- the PropertyChangeListener to addTupleSet.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void addPropertyChangeListener(java.lang.String key, java.beans.PropertyChangeListener lstnr)
TupleSet
addPropertyChangeListener
in interface TupleSet
key
- the specific key for which to listen to properties changeslstnr
- the PropertyChangeListener to addTupleSet.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
TupleSet
removePropertyChangeListener
in interface TupleSet
lstnr
- the PropertyChangeListener to removeTupleSet.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.lang.String key, java.beans.PropertyChangeListener lstnr)
TupleSet
removePropertyChangeListener
in interface TupleSet
key
- the specific key for which to remove the listenerlstnr
- the PropertyChangeListener to removeTupleSet.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
public void putClientProperty(java.lang.String key, java.lang.Object value)
TupleSet
putClientProperty
in interface TupleSet
key
- the name of the property to setvalue
- the value of the property to useTupleSet.putClientProperty(java.lang.String, java.lang.Object)
public java.lang.Object getClientProperty(java.lang.String key)
TupleSet
getClientProperty
in interface TupleSet
key
- the name of the property to retrieve
TupleSet.getClientProperty(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |