modelling.fiti.data
Class TermList

java.lang.Object
  extended by modelling.fiti.data.TermList

public class TermList
extends java.lang.Object

Class containing a list of all unique terms used. Term index can be calculated as the index of term in the list.

Author:
Kjell-Inge Skogstad and Trond Řivind Eriksen

Constructor Summary
TermList()
          Constructor creating a new term list.
 
Method Summary
 void addTerm(java.lang.String term)
          Method for adding a term.
 java.lang.String getTerm(int index)
          Method for getting a term by its index.
 int indexOf(java.lang.String term)
          Method for getting the index of a term.
 int nofTerms()
          Method for getting the number of unique terms.
 java.lang.String toString()
          Method for getting a printable representation of the term list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TermList

public TermList()
Constructor creating a new term list.

Method Detail

addTerm

public void addTerm(java.lang.String term)
Method for adding a term. Only new terms are added.

Parameters:
term - The term

nofTerms

public int nofTerms()
Method for getting the number of unique terms.

Returns:
The number of unique terms

indexOf

public int indexOf(java.lang.String term)
Method for getting the index of a term.

Parameters:
term - The term
Returns:
The index

getTerm

public java.lang.String getTerm(int index)
Method for getting a term by its index.

Parameters:
index - The index
Returns:
The term

toString

public java.lang.String toString()
Method for getting a printable representation of the term list.

Overrides:
toString in class java.lang.Object