org.eml.MMAX2.annotation.query
Class MMAX2QueryResultList

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.ArrayList
              extended by org.eml.MMAX2.annotation.query.MMAX2QueryResultList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, QueryResultListAPI

public class MMAX2QueryResultList
extends java.util.ArrayList
implements QueryResultListAPI

See Also:
Serialized Form

Constructor Summary
MMAX2QueryResultList()
          Creates a new empty instance of MMAX2QueryResultList
MMAX2QueryResultList(java.util.ArrayList elements)
          Creates a new instance of MMAX2QueryResultList of width 1
MMAX2QueryResultList(MMAX2QueryResultList toClone)
          This constructor returns a clone of MMAX2QueryResultList toClone.
MMAX2QueryResultList(MMAX2QueryResultList oldList, int index)
          This constructor returns a MMAX2QueryResultList with 1-element tuples copied from position index from oldList
 
Method Summary
 void addSingleTuple(MMAX2QueryResultTuple tuple1)
          This method adds a new copy of the the supplied tuple to this.
 void dump()
           
 java.util.ArrayList getAttributeNamesToDisplay()
           
 int getColumnIndexByColumnName(java.lang.String name)
          This method returns the numerical index of the column in which markables from MarkableLevel name are stored.
 java.lang.String getCommand()
           
 MMAX2QueryResultTupleElement getElementAtIndexFromColumn(int index, int column)
          This method returns from the MMAX2QueryResultTuple at list position index the Markable in the column column.
 MMAX2QueryResultTupleElement getElementAtIndexFromColumnToUse(int index)
          This method returns from the MMAX2QueryResultTuple at list position index the Element in the column this.indexToUse.
 int getElementIndexBeforeDiscoursePosition(int discPos)
           
 int getIndexToUse()
           
 int getMaximumWidth()
           
 int getResultSize()
          (API) Returns the size of the query result as the number of MMAX2QueryResultTuple objects.
 MMAX2QueryResultTuple getTupleAtIndex(int index)
          This method returns the MMAX2QueryResultTuple at list position index.
 int getWidth()
           
 boolean isIndexSetByUser()
          This method returns true if this ResultList was accessed via a variable which had a column specifier, false otherwise.
 void mergeAndAdd(MMAX2QueryResultTuple tuple1, MMAX2QueryResultTuple tuple2, int mergeMode)
          This method merges two result tuples into a new one, and adds the new tuple to this.
 void setAttributeNamesToDisplay(java.util.ArrayList list)
           
 void setCommand(java.lang.String _command)
           
 void setIndexSetByUser()
           
 void setIndexToUse(int index)
           
 void toDefaultIndexToUse()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

MMAX2QueryResultList

public MMAX2QueryResultList(java.util.ArrayList elements)
Creates a new instance of MMAX2QueryResultList of width 1


MMAX2QueryResultList

public MMAX2QueryResultList()
Creates a new empty instance of MMAX2QueryResultList


MMAX2QueryResultList

public MMAX2QueryResultList(MMAX2QueryResultList toClone)
This constructor returns a clone of MMAX2QueryResultList toClone.


MMAX2QueryResultList

public MMAX2QueryResultList(MMAX2QueryResultList oldList,
                            int index)
This constructor returns a MMAX2QueryResultList with 1-element tuples copied from position index from oldList

Method Detail

getResultSize

public final int getResultSize()
Description copied from interface: QueryResultListAPI
(API) Returns the size of the query result as the number of MMAX2QueryResultTuple objects.

Specified by:
getResultSize in interface QueryResultListAPI
Returns:
The number of MMAX2QueryResultTuple objects in this list.

getElementIndexBeforeDiscoursePosition

public final int getElementIndexBeforeDiscoursePosition(int discPos)

setCommand

public final void setCommand(java.lang.String _command)

getCommand

public final java.lang.String getCommand()

setAttributeNamesToDisplay

public final void setAttributeNamesToDisplay(java.util.ArrayList list)

getAttributeNamesToDisplay

public final java.util.ArrayList getAttributeNamesToDisplay()

isIndexSetByUser

public final boolean isIndexSetByUser()
This method returns true if this ResultList was accessed via a variable which had a column specifier, false otherwise.


setIndexSetByUser

public final void setIndexSetByUser()

getWidth

public final int getWidth()

getMaximumWidth

public final int getMaximumWidth()

getIndexToUse

public final int getIndexToUse()

setIndexToUse

public final void setIndexToUse(int index)

toDefaultIndexToUse

public final void toDefaultIndexToUse()

addSingleTuple

public final void addSingleTuple(MMAX2QueryResultTuple tuple1)
This method adds a new copy of the the supplied tuple to this. It is used for creating the results of 'filter' queries, i.e. in which only the first tuple in a match is retained in the result. Therefore, discontinuity is inherited to the copy. Also, the outer discourse positions are simply copied from input tuple.


mergeAndAdd

public final void mergeAndAdd(MMAX2QueryResultTuple tuple1,
                              MMAX2QueryResultTuple tuple2,
                              int mergeMode)
This method merges two result tuples into a new one, and adds the new tuple to this.


getTupleAtIndex

public final MMAX2QueryResultTuple getTupleAtIndex(int index)
This method returns the MMAX2QueryResultTuple at list position index.

Specified by:
getTupleAtIndex in interface QueryResultListAPI
Parameters:
index - The (zero-based) position in this list of the result tuple to return.
Returns:
The MMAX2QueryResultTuple object at index listIndex.

getElementAtIndexFromColumnToUse

public final MMAX2QueryResultTupleElement getElementAtIndexFromColumnToUse(int index)
This method returns from the MMAX2QueryResultTuple at list position index the Element in the column this.indexToUse.


getElementAtIndexFromColumn

public final MMAX2QueryResultTupleElement getElementAtIndexFromColumn(int index,
                                                                      int column)
This method returns from the MMAX2QueryResultTuple at list position index the Markable in the column column.


getColumnIndexByColumnName

public final int getColumnIndexByColumnName(java.lang.String name)
This method returns the numerical index of the column in which markables from MarkableLevel name are stored. It returns -1 if either the name does not exist or if it is ambiguous, i.e. not unique within this list.


dump

public final void dump()