org.kit.furia
Class Document<O extends org.ajmm.obsearch.OB>

java.lang.Object
  extended by org.kit.furia.Document<O>
Type Parameters:
O - The type of OB object that will be stored in this document.

public class Document<O extends org.ajmm.obsearch.OB>
extends java.lang.Object

This class is a multi-set of OB objects. If we were to store natural language, a document is just a multi-set of natural language words. Relationships of the words within the document are not stored.

Since:
0
Author:
Arnoldo Jose Muller Molina

Nested Class Summary
 class Document.DocumentElement<T>
          This class is used by the iterator of the Document class.
 
Constructor Summary
Document(java.lang.String id)
          Creates a document with an initial estimate of 2000 elements.
Document(java.lang.String id, int initialCapacity)
          Creates a document.
 
Method Summary
 void addWord(O word)
          Adds a word to the document.
 java.lang.String getName()
           
 java.util.Iterator<Document.DocumentElement<O>> iterator()
           
 int multiSetSize()
           
 void setWord(O word, int multiplicity)
          Sets the multiplicity for the given word.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document(java.lang.String id)
Creates a document with an initial estimate of 2000 elements.

Parameters:
id - The id of the document.

Document

public Document(java.lang.String id,
                int initialCapacity)
Creates a document.

Parameters:
initialCapacity - The number of elements that we are expecting to hold. This is for efficiency reasons, as the Document will grow automatically if the number of elements exceeds this initial estimate.
id - The id of the document.
Method Detail

getName

public java.lang.String getName()

size

public int size()
Returns:
The size of the set of words contained in this document.

multiSetSize

public int multiSetSize()
Returns:
The size of the multi-set of words contained in this document.

addWord

public void addWord(O word)
Adds a word to the document.

Parameters:
word - The word that will be added.

setWord

public void setWord(O word,
                    int multiplicity)
Sets the multiplicity for the given word.

Parameters:
word -
multiplicity -

iterator

public java.util.Iterator<Document.DocumentElement<O>> iterator()
Returns:
An iterator with all the elements of this document.


Copyright © 2008 Arnoldo Jose Muller Molina. All Rights Reserved.