fleXplorer.Terms
Interface ITerm<Type extends FacetsType>

Type Parameters:
Type - Generic Type. Term's value can be int, String, Date, Interval ...
All Known Implementing Classes:
Term

public interface ITerm<Type extends FacetsType>

Version:
1.1
Author:
Nikos Armenatzoglou

Method Summary
 boolean addIndex(int id)
          Add the index(id) of a document to the list of indexes of this Term.
 void clearIndexes()
          Removes all ids of documents that are assigned to the specific Term from the indexes.
 boolean containsIndex(int id)
          Returns true if the list of indexes contains the specified id of a document.
 java.util.HashSet<java.lang.Integer> getAllIndexes()
          Returns all ids of documents that are indexed to the specific Term.
 Comparison getComparability()
          Returns the comparability of Term.
 int getCount()
          Returns the number of the legal objects that are classified under this term.
 java.util.HashSet<java.lang.Integer> getIndexes()
          Returns the list of objects that have been indexed to this Term.
 java.util.HashSet<java.lang.Integer> getLegalIds(java.util.HashSet<java.lang.Integer> indexes)
          Returns the intersection of the term's indexes with the legal indexes that have to be displayed.
 int getNumOfIndexes()
          Returns the number of indexes of this term (cardinality of indexes).
 int getNumOfLegalIds(java.util.HashSet<java.lang.Integer> indexes)
          Returns the size of the intersection of the term's indexes with the legal indexes that have to be displayed.
 int getTermId()
          Return term's id.
 Type getTermValue()
          Return term's value.
 boolean isComparable()
          Returns true if Term is Comparable.
 boolean isIndexesListEmpty()
          Returns true if the list of indexes of the Term is empty.
 boolean isOpened()
          Returns true if the term belongs to a hierarchical facet and it must be opened in UI; false otherwise.
 boolean isZP(java.util.HashSet<java.lang.Integer> indexes)
          Returns true if this term is a zoom-in point.
 boolean removeIndex(int id)
          Returns true if the specified id removed correctly from the list of indexes of the Term.
 void setClosed()
          Defines that the term will be displayed as closed in UI.
 void setComparability(Comparison comparability)
          Sets Term's comparability.
 void setCount(int count)
          Sets the number of the legal objects that are classified under this term.
 void setOpened()
          Defines that the term will be displayed as opened in UI.
 void setTermId(int id)
          Set term's id.
 void setTermValue(Type value)
          Sets Term's value.
 java.lang.String toString()
          Returns the String representation of the term.
 

Method Detail

getNumOfIndexes

int getNumOfIndexes()
Returns the number of indexes of this term (cardinality of indexes).

Returns:
the number of indexes of this term.

setComparability

void setComparability(Comparison comparability)
Sets Term's comparability.
Preconditions: Term must not be null.The type of argument must be boolean.
Postconditions: Changes the value of variable comparability.

Parameters:
comparability - Term's comparability.

getComparability

Comparison getComparability()
Returns the comparability of Term.
Preconditions: Term must not be null.
Postconditions: Returns the value of comparability of Term.

Returns:
true if Term is comparable, otherwise false.

toString

java.lang.String toString()
Returns the String representation of the term.
Preconditions: Term must not be null;
Postconditions: Prints Term value and if hasId is true prints Term's id.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the term.

getIndexes

java.util.HashSet<java.lang.Integer> getIndexes()
Returns the list of objects that have been indexed to this Term. Preconditions: Term must not be null;
Postconditions: Returns the list of objects that have been indexed to this Term.

Returns:
the list of objects that have been indexed to this Term.

setTermValue

void setTermValue(Type value)
Sets Term's value.
Preconditions: Term and argument must not be null.
Postconditions: Defines as value of private variable value the value of argument.

Parameters:
id - The new name of term.

isZP

boolean isZP(java.util.HashSet<java.lang.Integer> indexes)
Returns true if this term is a zoom-in point. A term is a zoom-in point if at least one id from its indexes is contained in the list of legal objects that have to be displayed. This method is used only in case we do not display the counters of zoom-in points. Preconditions: The argument must not be null.

Parameters:
indexes - the legal ids of documents that have to be displayed.
Returns:
true if term is a zoom-in point; false otherwise.

getLegalIds

java.util.HashSet<java.lang.Integer> getLegalIds(java.util.HashSet<java.lang.Integer> indexes)
Returns the intersection of the term's indexes with the legal indexes that have to be displayed. Preconditions: The argument must not be null.

Parameters:
indexes - the legal ids of documents that have to be displayed.
Returns:
the intersection of the term's indexes with the legal indexes that have to be displayed.

getNumOfLegalIds

int getNumOfLegalIds(java.util.HashSet<java.lang.Integer> indexes)
Returns the size of the intersection of the term's indexes with the legal indexes that have to be displayed. Preconditions: The argument must not be null.

Parameters:
indexes - the legal ids of documents that have to be displayed.
Returns:
the size of intersection of the term's indexes with the legal indexes that have to be displayed.

setTermId

void setTermId(int id)
Set term's id.
Preconditions: Term must not be null, argument id must not be negative.
Postconditions: Defines as value of private variable value the value of argument.

Parameters:
id - The new id of term.

getTermValue

Type getTermValue()
Return term's value.
Preconditions: Term must not be null.
Postconditions: Returns the value of private variable value.

Returns:
Term's value.

getTermId

int getTermId()
Return term's id.
Preconditions: Term must not be null. Private variable hasId must be true.
Postconditions: Returns the value of private variable id.

Returns:
Term's id.

isComparable

boolean isComparable()
Returns true if Term is Comparable.
Preconditions: Term must not be null.
Postconditions: Returns the value of private variable comparability.

Returns:
true if Term is Comparable; false otherwise.

getAllIndexes

java.util.HashSet<java.lang.Integer> getAllIndexes()
Returns all ids of documents that are indexed to the specific Term.

Returns:
all ids of documents that are indexed to the specific Term.

clearIndexes

void clearIndexes()
Removes all ids of documents that are assigned to the specific Term from the indexes. Preconditions: Term must not be null.
Postconditions: Removes all ids of documents that are assigned to the specific Term from the indexes.


addIndex

boolean addIndex(int id)
Add the index(id) of a document to the list of indexes of this Term. Preconditions: Term must not be null.
Postconditions: Add the index(id) of a document to the list of indexes of this Term.

Returns:
true if index added successfully; false otherwise.

containsIndex

boolean containsIndex(int id)
Returns true if the list of indexes contains the specified id of a document. Preconditions: the list of term'indexes must not be null and the id must not be negative.
Postconditions: Returns true if the list of indexes contains the specified id of a document.

Returns:
true if the list of indexes contains the specified id of a document; false otherwise.

removeIndex

boolean removeIndex(int id)
Returns true if the specified id removed correctly from the list of indexes of the Term. Preconditions: the list of term'indexes must not be null and the id must not be negative.
Postconditions: Returns true if the specified id removed correctly from the list of indexes of the Term.

Returns:
true if the specified id removed correctly from the list of indexes of the Term; false otherwise.

isIndexesListEmpty

boolean isIndexesListEmpty()
Returns true if the list of indexes of the Term is empty. Preconditions: the list of term'indexes must not be null.
Postconditions: Returns true if the list of indexes of the Term is empty.

Returns:
true if the list of indexes of the Term is empty; false otherwise.

isOpened

boolean isOpened()
Returns true if the term belongs to a hierarchical facet and it must be opened in UI; false otherwise.

Returns:
true if the term belongs to a hierarchical facet and it must be opened in UI; false otherwise.

setOpened

void setOpened()
Defines that the term will be displayed as opened in UI.


setClosed

void setClosed()
Defines that the term will be displayed as closed in UI.


getCount

int getCount()
Returns the number of the legal objects that are classified under this term.

Returns:
the number of the legal objects that are classified under this term.

setCount

void setCount(int count)
Sets the number of the legal objects that are classified under this term.

Parameters:
count - the number of the legal objects that are classified under this term.