org.aitools.programd.util
Class StringTripleMatrix

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

public class StringTripleMatrix
extends java.lang.Object

Manages a matrix of StringTriple s.

Since:
4.1.5
Author:
Noel Bush

Field Summary
private  java.util.LinkedList<StringTriple> horizontal
           
private  java.util.LinkedList<java.lang.String>[] vertical
           
 
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.
 java.util.LinkedList<StringTriple> getAll()
           
 java.util.LinkedList<java.lang.String> getFirsts()
           
 java.util.LinkedList<java.lang.String> getSeconds()
           
 java.util.LinkedList<java.lang.String> getThirds()
           
 java.util.Iterator<StringTriple> iterator()
           
 java.util.ListIterator<StringTriple> listIterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertical

private java.util.LinkedList<java.lang.String>[] vertical

horizontal

private java.util.LinkedList<StringTriple> horizontal
Constructor Detail

StringTripleMatrix

public StringTripleMatrix()
Creates a new StringTripleMatrix.

Method Detail

getAll

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

iterator

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

listIterator

public java.util.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 java.util.LinkedList<java.lang.String> getFirsts()
Returns:
the first-position elements of the vertical component of this StringTripleMatrix

getSeconds

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

getThirds

public java.util.LinkedList<java.lang.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