org.aitools.programd.util
Class StringTripleMatrix

java.lang.Object
  extended by org.aitools.programd.util.StringTripleMatrix

public class StringTripleMatrix
extends Object

Manages a matrix of StringTriple s.

Since:
4.1.5
Author:
Noel Bush

Constructor Summary
StringTripleMatrix()
          Creates a new StringTripleMatrix.
 
Method Summary
 void add(StringTriple tuple)
          Adds the given StringTuple to this StringTripleMatrix.
 void addAll(StringTripleMatrix matrix)
          Adds the contents of the given StringTripleMatrix to this one.
 boolean contains(StringTriple tuple)
           
 void ensureSize(int size)
          Ensures that the StringTripleMatrix has the given size.
 LinkedList<StringTriple> getAll()
           
 LinkedList<String> getFirsts()
           
 LinkedList<String> getSeconds()
           
 LinkedList<String> getThirds()
           
 Iterator<StringTriple> iterator()
           
 ListIterator<StringTriple> listIterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTripleMatrix

public StringTripleMatrix()
Creates a new StringTripleMatrix.

Method Detail

getAll

public LinkedList<StringTriple> getAll()
Returns:
the horizontal component of the StringTripleMatrix

iterator

public Iterator<StringTriple> iterator()
Returns:
an iterator over the horizontal component

listIterator

public ListIterator<StringTriple> listIterator()
Returns:
a list iterator for this StringTripleMatrix

contains

public boolean contains(StringTriple tuple)
Parameters:
tuple - the tuple to look for in this StringTripleMatrix
Returns:
whether or not this StringTripleMatrix contains the given tuple

getFirsts

public LinkedList<String> getFirsts()
Returns:
the first-position elements of the vertical component of this StringTripleMatrix

getSeconds

public LinkedList<String> getSeconds()
Returns:
the second-position elements of the vertical component of this StringTripleMatrix

getThirds

public LinkedList<String> getThirds()
Returns:
the third-position elements of the vertical component of this StringTripleMatrix

add

public void add(StringTriple tuple)
Adds the given StringTuple to this StringTripleMatrix.

Parameters:
tuple - the tuple to add

addAll

public void addAll(StringTripleMatrix matrix)
Adds the contents of the given StringTripleMatrix to this one.

Parameters:
matrix - the matrix whose contents we want to add

size

public int size()
Returns:
the size of the StringTripleMatrix

ensureSize

public void ensureSize(int size)
Ensures that the StringTripleMatrix has the given size.

Parameters:
size - the size to ensure