prefuse.data.tuple
Class TupleManager<T extends Tuple<?>>

java.lang.Object
  extended by prefuse.data.tuple.TupleManager<T>

public abstract class TupleManager<T extends Tuple<?>>
extends java.lang.Object

Manager class for Tuples. There is a unique Tuple for each row of a table. All data structures and Tuples are created lazily, on an as-needed basis. When a row is deleted from the table, it's corresponding Tuple (if created) is invalidated before being removed from this data structure, ensuring that any other live references to the Tuple can't be used to corrupt the table.

Author:
jeffrey heer

Field Summary
protected  Graph<T,?,?> m_graph
           
protected  Table<T> m_table
           
 
Constructor Summary
TupleManager(Table<T> t, Graph<?,?,?> g)
          Create a new TupleManager for the given Table.
 
Method Summary
abstract  T createTupleInstance()
           
 T getTuple(int row)
          Get a Tuple corresponding to the given row index.
 void init(Table<?> t, Graph<?,?,?> g)
          Initialize this TupleManager for use with a given Table.
 void invalidate(int row)
          Invalidate the tuple at the given row.
 void invalidateAll()
          Invalidate all tuples managed by this TupleManager
 java.lang.Iterable<T> iterable(IntIterator rows)
          Return an iterator over the tuples in this manager.
 java.util.List<T> list(java.util.List<java.lang.Integer> rows)
           
protected  T newTuple(int row)
          Instantiate a new Tuple instance for the given row index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_graph

protected Graph<T extends Tuple<?>,?,?> m_graph

m_table

protected Table<T extends Tuple<?>> m_table
Constructor Detail

TupleManager

public TupleManager(Table<T> t,
                    Graph<?,?,?> g)
Create a new TupleManager for the given Table.

Parameters:
t - the data Table to generate Tuples for
Method Detail

createTupleInstance

public abstract T createTupleInstance()

init

public void init(Table<?> t,
                 Graph<?,?,?> g)
Initialize this TupleManager for use with a given Table.

Parameters:
t - the data Table to generate Tuples for

getTuple

public T getTuple(int row)
Get a Tuple corresponding to the given row index.

Parameters:
row - the row index
Returns:
the Tuple corresponding to the given row

newTuple

protected T newTuple(int row)
Instantiate a new Tuple instance for the given row index.

Parameters:
row - the row index of the tuple
Returns:
the newly created Tuple

invalidate

public void invalidate(int row)
Invalidate the tuple at the given row.

Parameters:
row - the row index to invalidate

invalidateAll

public void invalidateAll()
Invalidate all tuples managed by this TupleManager


iterable

public java.lang.Iterable<T> iterable(IntIterator rows)
Return an iterator over the tuples in this manager.

Parameters:
rows - an iterator over table rows
Returns:
an iterator over the tuples indicated by the input row iterator

list

public java.util.List<T> list(java.util.List<java.lang.Integer> rows)


Copyright © 2008 Regents of the University of California