prefuse.data.tuple
Interface TupleSet

All Known Subinterfaces:
VisualTupleSet
All Known Implementing Classes:
AbstractTupleSet, AggregateTable, CascadedTable, CompositeTupleSet, DefaultTupleSet, Graph, KeywordSearchTupleSet, PrefixSearchTupleSet, RegexSearchTupleSet, SearchTupleSet, SpanningTree, Table, Tree, VisualGraph, VisualTable, VisualTree

public interface TupleSet

A collection of data tuples. This is the top level interface for all data collections in the prefuse framework.

Author:
jeffrey heer
See Also:
Tuple

Field Summary
static Tuple[] EMPTY_ARRAY
          An empty, zero-length array of tuples.
 
Method Summary
 void addColumn(java.lang.String name, java.lang.Class type)
          Add a data field / column to this TupleSet's members.
 void addColumn(java.lang.String name, java.lang.Class type, java.lang.Object defaultValue)
          Add a data field / column to this TupleSet's members.
 void addColumn(java.lang.String name, Expression expr)
          Add a data field / column to this TupleSet's members.
 void addColumn(java.lang.String name, java.lang.String expr)
          Add a data field / column to this TupleSet's members.
 void addColumns(Schema s)
          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.
 Tuple addTuple(Tuple t)
          Add a Tuple 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.
 void clear()
          Clear this TupleSet, removing all contained Tuples.
 boolean containsTuple(Tuple t)
          Indicates if a given Tuple is contained within this TupleSet.
 java.lang.Object getClientProperty(java.lang.String key)
          Get an client property bound to this TupleSet
 int getTupleCount()
          Get the number of tuples in this set.
 boolean isAddColumnSupported()
          Indicates if this TupleSet supports the addition of data columns to its contained Tuple instances.
 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.
 boolean removeTuple(Tuple t)
          Remove a Tuple from this TupleSet.
 void removeTupleSetListener(TupleSetListener tsl)
          Remove a listener from this tuple set.
 Tuple setTuple(Tuple t)
          Set the TupleSet contents to be a single Tuple.
 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.
 java.util.Iterator tuples(Predicate filter, Sort sort)
          Return an iterator over the tuples in this tuple set, filtered by the given predicate
 

Field Detail

EMPTY_ARRAY

static final Tuple[] EMPTY_ARRAY
An empty, zero-length array of tuples.

Method Detail

addTuple

Tuple addTuple(Tuple t)
Add a Tuple to this TupleSet. This method is optional, and may result in an UnsupportedOperationException on some TupleSet implementations.

Parameters:
t - the Tuple add
Returns:
the actual Tuple instance stored in the TupleSet. This may be null to signify that the add failed, may be a new Tuple with values copied from the input tuple, or may be the input Tuple itself.

setTuple

Tuple setTuple(Tuple t)
Set the TupleSet contents to be a single Tuple. This method is optional, and may result in an UnsupportedOperationException on some TupleSet implementations.

Parameters:
t - the Tuple to set as the content of this TupleSet
Returns:
the actual Tuple instance stored in the TupleSet. This may be null to signify that the add failed, may be a new Tuple with values copied from the input tuple, or may be the input Tuple itself.

removeTuple

boolean removeTuple(Tuple t)
Remove a Tuple from this TupleSet.

Parameters:
t - the Tuple to remove
Returns:
true if the Tuple was found and removed, false otherwise

clear

void clear()
Clear this TupleSet, removing all contained Tuples.


containsTuple

boolean containsTuple(Tuple t)
Indicates if a given Tuple is contained within this TupleSet.

Parameters:
t - the tuple to check for containment
Returns:
true if the Tuple is in this TupleSet, false otherwise

getTupleCount

int getTupleCount()
Get the number of tuples in this set.

Returns:
the tuple count

isAddColumnSupported

boolean isAddColumnSupported()
Indicates if this TupleSet supports the addition of data columns to its contained Tuple instances.

Returns:
true is add column operations are supported, false otherwise

addColumns

void addColumns(Schema s)
Add the data fields of the given Schema to the Tuples in this TupleSet. If this TupleSet contains heterogeneous Tuples (i.e., those from different source tables), all backing tables involved will be updated.

Parameters:
s - the Schema of data columns to add to this TupleSet

addColumn

void addColumn(java.lang.String name,
               java.lang.Class type)
Add a data field / column to this TupleSet's members.

Parameters:
name - the name of the data field
type - the type of the data field

addColumn

void addColumn(java.lang.String name,
               java.lang.Class type,
               java.lang.Object defaultValue)
Add a data field / column to this TupleSet's members.

Parameters:
name - the name of the data field
type - the type of the data field
defaultValue - the defaultValue of the data field

addColumn

void addColumn(java.lang.String name,
               java.lang.String expr)
Add a data field / column to this TupleSet's members.

Parameters:
name - the name of the data field
expr - 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.
See Also:
prefuse.data.expression, ExpressionParser

addColumn

void addColumn(java.lang.String name,
               Expression expr)
Add a data field / column to this TupleSet's members.

Parameters:
name - the name of the data field
expr - 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.
See Also:
prefuse.data.expression

tuples

java.util.Iterator tuples()
Return an iterator over the tuples in this tuple set.

Returns:
an iterator over this set's tuples

tuples

java.util.Iterator tuples(Predicate filter)
Return an iterator over the tuples in this tuple set, filtered by the given predicate.

Parameters:
filter - predicate to apply to tuples in this set, only tuples for which the predicate evaluates to true are included in the iteration
Returns:
a filtered iterator over this set's tuples

tuples

java.util.Iterator tuples(Predicate filter,
                          Sort sort)
Return an iterator over the tuples in this tuple set, filtered by the given predicate

Parameters:
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
Returns:
a filtered, sorted iterator over this set's tuples

addTupleSetListener

void addTupleSetListener(TupleSetListener tsl)
Add a listener to this tuple set that will be notified when tuples are added and removed from the set.

Parameters:
tsl - the TupleSetListener to add

removeTupleSetListener

void removeTupleSetListener(TupleSetListener tsl)
Remove a listener from this tuple set.

Parameters:
tsl - the TupleSetListener to remove

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Add a PropertyChangeListener to be notified of changes to the properties bounds to this TupleSet.

Parameters:
lstnr - the PropertyChangeListener to add

addPropertyChangeListener

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.

Parameters:
key - the specific key for which to listen to properties changes
lstnr - the PropertyChangeListener to add

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
Remove a PropertyChangeListener from this TupleSet.

Parameters:
lstnr - the PropertyChangeListener to remove

removePropertyChangeListener

void removePropertyChangeListener(java.lang.String key,
                                  java.beans.PropertyChangeListener lstnr)
Remove a PropertyChangeListener from this TupleSet for a specific bound property.

Parameters:
key - the specific key for which to remove the listener
lstnr - the PropertyChangeListener to remove

putClientProperty

void putClientProperty(java.lang.String key,
                       java.lang.Object value)
Set an arbitrary client property with this TupleSet

Parameters:
key - the name of the property to set
value - the value of the property to use

getClientProperty

java.lang.Object getClientProperty(java.lang.String key)
Get an client property bound to this TupleSet

Parameters:
key - the name of the property to retrieve
Returns:
the client property value, or null if no value was found for the given key.


Copyright © 2007 Regents of the University of California