CAR (Context-Aware Retrieval) v1.0

Class Collection

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--Collection
All Implemented Interfaces:
CarFace, java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class Collection
extends java.util.Vector
implements CarFace, java.io.Serializable

A Collection is a vector of Documents.

See the Basic Terminology section of the User Manual for a description.

See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface CarFace
BOOLEAN_LITERAL, COLLECTION, DOUBLE_LITERAL, EXTERNAL, grammarNames, INTERNAL, KEYPHRASE, LITERALcapacityIncrement, LITERALinitialCapacity, MARKUP, SERIAL, SESSION, STRING_LITERAL, STRINGVALUE_LITERAL
 
Constructor Summary
Collection()
          constructs a collection of 0 documents
Collection(java.lang.String id, java.lang.String s)
          constructs a collection of 0 elements, with the input id and title.
 
Method Summary
 void addDocument(Document doc)
          adds the input document to the collection.
static Collection deserialize(java.lang.String fn)
          deserializes a collection held in the path argument.
 java.lang.String getCollectionId()
          For system programmer use only.
 CommentTuple getCommentTuple()
          returns the collection's commentTuple.
 Document getDocument(int i)
          returns the ith document in the collection.
 Document getDocumentCopy(int i)
          returns a copy of the ith document in the collection.
 java.lang.String getTitle()
          For system programmer use only.
 int numberOfDocuments()
          returns the number of documents in the collection.
 void removeCommentContainingKeyPhrase()
          For system programmer use only.
 void serialize(java.lang.String fn)
          For system programmer use only.
 void setCollectionId(java.lang.String id)
          For system programmer use only.
 void setCommentTuple(CommentTuple ct)
          replaes the current CommentTuple (if there is one) by the one input.
 void setTitle(java.lang.String s)
          For system programmer use only.
static void t(java.lang.String s)
          Provides trace output of string if -dCollection on command line of CAR run
 java.lang.String toString()
          converts the collection to a string.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Collection

public Collection()
constructs a collection of 0 documents

Collection

public Collection(java.lang.String id,
                  java.lang.String s)
constructs a collection of 0 elements, with the input id and title. For system programmer use only.
Method Detail

t

public static void t(java.lang.String s)
Provides trace output of string if -dCollection on command line of CAR run

deserialize

public static Collection deserialize(java.lang.String fn)
deserializes a collection held in the path argument. if an exception is thrown null is returned.
Parameters:
fn - path of serialized collection.
Returns:
the collection or null

setCollectionId

public void setCollectionId(java.lang.String id)
For system programmer use only.

setTitle

public void setTitle(java.lang.String s)
For system programmer use only.

setCommentTuple

public void setCommentTuple(CommentTuple ct)
replaes the current CommentTuple (if there is one) by the one input. The CommentTuple is displayed at the beginning of the output when toString() is invoked.

numberOfDocuments

public int numberOfDocuments()
returns the number of documents in the collection.

addDocument

public void addDocument(Document doc)
adds the input document to the collection.

getCollectionId

public java.lang.String getCollectionId()
For system programmer use only.

getTitle

public java.lang.String getTitle()
For system programmer use only.

getCommentTuple

public CommentTuple getCommentTuple()
returns the collection's commentTuple. The CommentTuple will be null if it hasn't previously been set.
Returns:
the collections CommentTuple (or null).

removeCommentContainingKeyPhrase

public void removeCommentContainingKeyPhrase()
For system programmer use only.

getDocument

public Document getDocument(int i)
returns the ith document in the collection.
Parameters:
i - the document index (starting at zero).
Returns:
the document reference (or null if 'i' invalid for size of collection).

getDocumentCopy

public Document getDocumentCopy(int i)
returns a copy of the ith document in the collection.
Parameters:
i - the document index (starting at zero).
Returns:
a copy (clone) of the document (or null if 'i' invalid for size of collection).

serialize

public void serialize(java.lang.String fn)
For system programmer use only.

toString

public java.lang.String toString()
converts the collection to a string. The format of the string is consistent with the textual representation of a collection, as read from file by CAR.
Overrides:
toString in class java.util.Vector
Returns:
a string represention of the collection.

CAR (Context-Aware Retrieval) v1.0

Submit bugs to Lindsey