|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectfleXplorer.Terminologies.Terminology<Type>
fleXplorer.Taxonomies.Taxonomy<Type>
Type
- Generic Type. Taxonomy can include only one type of Terms. Type can be int, String, Date, Interval ...public class Taxonomy<Type extends FacetsType>
Constructor Summary | |
---|---|
Taxonomy()
Constructs a Taxonomy that doesn't checks the relationships of the Terms, the Terms are comparable, Taxonomy has an hierarchy and the Java type of terms are String. |
|
Taxonomy(java.lang.String taxName)
Constructs a Taxonomy with specified name and doesn't checks the relationships of the Terms, the Terms are comparable, Taxonomy has an hierarchy and the Java type of terms are String.. |
|
Taxonomy(java.lang.String name,
CheckRel checkRel,
Comparison comparability,
HasLists hasLists,
java.lang.String type)
Constructs a Taxonomy with the specified name, comparability and check of relationships and defines if the Taxonomy has hierarchy or it is flat. |
|
Taxonomy(Taxonomy<Type> tx)
Constructs a Taxonomy object with the same properties as the argument. |
Method Summary | |
---|---|
int |
addHead(FacetsType head)
Add a head term at the taxonomy. |
boolean |
checkRel()
Return the value of variable that defines when will be the check for cycles and redundant relationships. |
void |
clear()
Removes all relationships and terms from the taxonomy. |
boolean |
containsChild(int parentId,
FacetsType childValue)
Return true if the term with the specified id has a direct child with the specified value. |
boolean |
containsChild(int parentId,
int childId)
Return true if the term with the specified id has a direct child with the specified id. |
boolean |
containsParent(int childId,
FacetsType parentValue)
Return true if the term with the specified id has a direct parent with the specified value. |
boolean |
containsParent(int childId,
int parentId)
Return true if the term with the specified id has a direct parent with the specified id. |
int |
directChildrenSize(int parentId)
Returns the number of the direct children of the Term with the specified id. |
int |
directChildrenSize(Term<FacetsType> parent)
Returns the number of the direct children of the specified term. |
int |
directParentsSize(int childId)
Returns the number of the direct parents of the Term with the specified id. |
int |
directParentsSize(Term<FacetsType> child)
Returns the number of the direct parents of the specified Term. |
void |
elimRR()
Eliminates redundant relationships. |
java.util.ArrayList<Term<FacetsType>> |
getAllChildren(Term<FacetsType> parent)
Returns all children of the specified term. |
java.util.HashSet<java.lang.Integer> |
getAllIds(int termId)
Returns all ids of the documents that is indexed to the term with the specified id and all its descendants. |
java.util.HashSet<java.lang.Integer> |
getAllIds(Term<FacetsType> term)
Returns all ids of the documents that is indexed to the specified term and all its descendants. |
java.util.Collection<Term<FacetsType>> |
getAllParents(int childId)
Returns all parents of the specified term. |
java.util.ArrayList<Term<FacetsType>> |
getAllParents(Term<FacetsType> child)
Returns all parents of the specified term. |
java.util.HashMap<java.lang.Integer,java.util.Collection<Term<FacetsType>>> |
getAllParentsWithHierarchy(Term<FacetsType> child)
Returns a HashMap with all parents of the specified term using hierarchy. |
java.util.Map<Term<FacetsType>,java.util.Collection<Term<FacetsType>>> |
getAllRelations()
Returns a Map with all relationships of the taxonomy. |
int |
getChildId(int parentId,
FacetsType childValue)
Returns the id of the child term with the specified value of the parent term with the specified id. |
java.util.HashMap<Term<FacetsType>,java.lang.Integer> |
getCount(java.util.HashSet<java.lang.Integer> indexes)
Returns the count information for all Terms of the flat Taxonomy according to the indexes. |
int |
getCount(int termId,
java.util.HashSet<java.lang.Integer> indexes)
Returns the count information of the Term with the specified id according to the indexes. |
int |
getCount(Term<FacetsType> term,
java.util.HashSet<java.lang.Integer> indexes)
Returns the count information of the specified Term according to the indexes. |
java.util.Collection<Term<FacetsType>> |
getDirectChildren(int parentId)
Returns the direct children of the Term with the specified id. |
java.util.Collection<Term<FacetsType>> |
getDirectChildren(Term<FacetsType> parent)
Returns the direct children of the specified Term. |
java.util.Collection<Term<FacetsType>> |
getDirectParents(int childId)
Returns the direct parents of the Term with the specified id. |
java.util.Collection<Term<FacetsType>> |
getDirectParents(Term<FacetsType> child)
Returns the direct parents of the specified Term. |
Term<FacetsType> |
getHead()
Returns the head term of the taxonomy if taxonomy is not flat else returns the top element. |
java.lang.String |
getName()
Returns the name of Taxonomy. |
int |
getNumOfRelations()
Returns the number of relations of the taxonomy. |
int |
getTermId(java.lang.String path)
Returns the id of the term that described by the specified id. |
java.lang.String |
getTermPath(int tid)
Returns the path of the term with the specific id. |
Term<FacetsType> |
getTopElement()
Returns the top element. |
int |
getTopElementId()
Returns the id of the top element. |
java.lang.String |
getType()
Returns the Java type of the Terms of the Taxonomy. |
Validation |
getValidation()
Returns if taxonomy is valid. |
boolean |
hasLists()
Returns the value of variable that defines if Taxonomy's Terms have lists for its parents and children. |
boolean |
isBroader(int parentId,
int childId)
Checks if a term is broader that an other (subsumption checking). |
boolean |
isChild(Term<FacetsType> parent,
Term<FacetsType> child)
Checks if the second argument is a child of the first one. |
boolean |
isCycle(Term<FacetsType> parent,
Term<FacetsType> child)
Checks if this relationship parent - child causes a cycle to Taxonomy's graph. |
boolean |
isDirectChild(Term<FacetsType> parent,
Term<FacetsType> child)
Checks if the second argument is direct child of the first one. |
boolean |
isDirectParent(Term<FacetsType> child,
Term<FacetsType> parent)
Checks if the second argument is direct parent of the first one. |
boolean |
isNarrower(int parentId,
int childId)
Checks if a term is broader that an other (subsumption checking). |
boolean |
isParent(Term<FacetsType> child,
Term<FacetsType> parent)
Checks if the second term is a parent of the first one. |
boolean |
isRR(Term<FacetsType> parent,
Term<FacetsType> child)
Checks if this relationship parent - child is redundant. |
boolean |
isValid()
Search for cycles in Taxonomy. |
boolean |
isZP(int termId,
java.util.HashSet<java.lang.Integer> indexes)
Returns true if the term with the specified id is a legal term according the list of documents(objects) that have to be presented(indexes). |
void |
printDirectChildren(Term<Type> parent)
Prints the direct children of the specified term. |
void |
printDirectParents(Term<Type> child)
Prints the direct parents of the specified term. |
void |
removeAllTheOtherIndexes(int termId)
If the taxonomy is not flat, removes the indexes of all terms of the taxonomy except the indexes of the term with the specified id and all of its descendants. |
boolean |
removeDirectChild(Term<FacetsType> parent,
Term<FacetsType> child)
Removes the child Term of the specified parent Term with the specified value. |
boolean |
removeDirectParent(Term<FacetsType> child,
Term<FacetsType> parent)
Removes the parent Term of the specified child Term with the specified value. |
boolean |
removeRelship(int parentId,
int childId)
Removes the relationship between two terms. |
boolean |
removeRelship(Term<FacetsType> parent,
Term<FacetsType> child)
Removes the relationship between two terms. |
void |
setCheckRel(CheckRel checkRel)
Sets the value of variable that defines when will be the check for cycles and redundant relationships. |
void |
setHasLists(HasLists value)
Sets the value of variable that defines if the taxonomy is flat or there is a hierarchy. |
void |
setName(java.lang.String name)
Defines the name of Taxonomy. |
java.util.HashMap<java.lang.String,java.lang.Integer> |
setRelship(FacetsType parentValue,
FacetsType childValue)
Creates and inserts two Terms with specified values into Taxonomy and creates a relationship between them. |
boolean |
setRelship(FacetsType parentValue,
int parentId,
FacetsType childValue,
int childId)
Create the terms and sets the relationship parent - child between the two Terms. |
int |
setRelship(int parentId,
FacetsType childValue)
Set a relationship between two terms. |
boolean |
setRelship(Term<FacetsType> parent,
Term<FacetsType> child)
Sets relationship parent - child between two Terms. |
boolean |
setRelshipsMaterialization(Materialization toDo)
Materializes or cancels relationships if Terms are comparable. |
void |
setTaxonomy(Taxonomy<?> tx)
Clears the taxonomy and gives to the Taxonomy the properties of the argument. |
void |
setType(java.lang.String type)
Defines the Java type of the Terms of the Taxonomy. |
void |
setValidation(Validation value)
Sets the value of variable that defines if taxonomy is valid. |
java.lang.String |
toString()
Returns a string representation of all materialized relationships. |
Methods inherited from class fleXplorer.Terminologies.Terminology |
---|
containsTerm, containsTermWithId, decrSeqNumber, deleteAllIndexes, getComparability, getSeqNumber, getTerm, getTerm, getTerm, getTermId, getTerminology, getTermWithId, incrSeqNumber, isComparable, isEmpty, removeTerm, removeTerm, removeTerm, removeTermWithId, setComparability, setSeqNumber, setTerm, setTerm, setTerm, setTerminology, setTerms, setTermsValues, size |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Taxonomy(Taxonomy<Type> tx)
public Taxonomy()
public Taxonomy(java.lang.String taxName)
taxName
- the name of Taxonomy.public Taxonomy(java.lang.String name, CheckRel checkRel, Comparison comparability, HasLists hasLists, java.lang.String type)
taxName
- the name of Taxonomy.checkRel
- the value of variable that defines when will be the check for cycles and redundant relationships.comparability
- the value of variable that defines if the Terms that included into Terminology of Taxonomy are comparable.hasLists
- the value of variable that defines if Terminology's Terms have lists for its parents and children.type
- the Java type of Terms's value of Taxonomy.Method Detail |
---|
public java.lang.String getType()
getType
in interface ITaxonomy<Type extends FacetsType>
public void setType(java.lang.String type)
setType
in interface ITaxonomy<Type extends FacetsType>
public void setHasLists(HasLists value)
setHasLists
in interface ITaxonomy<Type extends FacetsType>
value
- the new value for private variable hasLists.public void setTaxonomy(Taxonomy<?> tx)
setTaxonomy
in interface ITaxonomy<Type extends FacetsType>
tx
- the taxonomy that from which this Taxonomy will take the properties.public boolean hasLists()
hasLists
in interface ITaxonomy<Type extends FacetsType>
public void setName(java.lang.String name)
setName
in interface ITaxonomy<Type extends FacetsType>
setName
in interface ITerminology<Type extends FacetsType>
setName
in class Terminology<Type extends FacetsType>
name
- the new name of Taxonomy.public java.lang.String getName()
getName
in interface ITaxonomy<Type extends FacetsType>
getName
in interface ITerminology<Type extends FacetsType>
getName
in class Terminology<Type extends FacetsType>
public boolean checkRel()
checkRel
in interface ITaxonomy<Type extends FacetsType>
public void setCheckRel(CheckRel checkRel)
setCheckRel
in interface ITaxonomy<Type extends FacetsType>
check
- the new value for check.public void printDirectChildren(Term<Type> parent)
printDirectChildren
in interface ITaxonomy<Type extends FacetsType>
term
- the parent termpublic void printDirectParents(Term<Type> child)
printDirectParents
in interface ITaxonomy<Type extends FacetsType>
term
- the child termpublic void setValidation(Validation value)
setValidation
in interface ITaxonomy<Type extends FacetsType>
value
- the new value for validation.public Validation getValidation()
getValidation
in interface ITaxonomy<Type extends FacetsType>
public boolean removeDirectChild(Term<FacetsType> parent, Term<FacetsType> child)
removeDirectChild
in interface ITaxonomy<Type extends FacetsType>
parent
- The Term that will be removed its child.child
- The child Term to be removed.
public boolean removeDirectParent(Term<FacetsType> child, Term<FacetsType> parent)
removeDirectParent
in interface ITaxonomy<Type extends FacetsType>
child
- The Term that will be removed its parent.parent
- The parent Term to be removed.
public int directChildrenSize(Term<FacetsType> parent)
directChildrenSize
in interface ITaxonomy<Type extends FacetsType>
parent
- The Term whose the size of children list will be returned.
public boolean containsChild(int parentId, FacetsType childValue)
containsChild
in interface ITaxonomy<Type extends FacetsType>
parentId
- the id of parent termchildValue
- the value of child term
public boolean containsChild(int parentId, int childId)
containsChild
in interface ITaxonomy<Type extends FacetsType>
parentId
- the id of parent term.childId
- the id of child term.
public boolean containsParent(int childId, FacetsType parentValue)
containsParent
in interface ITaxonomy<Type extends FacetsType>
childId
- the id of child termparentValue
- the value of parent term
public boolean containsParent(int childId, int parentId)
containsParent
in interface ITaxonomy<Type extends FacetsType>
childId
- the id of child term.parentId
- the id of parent term.
public int directParentsSize(Term<FacetsType> child)
directParentsSize
in interface ITaxonomy<Type extends FacetsType>
term
- The Term whose the number of parents will be returned.
public int directParentsSize(int childId)
directParentsSize
in interface ITaxonomy<Type extends FacetsType>
childId
- The id of Term whose the number of parents will be returned.
public int directChildrenSize(int parentId)
directChildrenSize
in interface ITaxonomy<Type extends FacetsType>
childId
- The id of Term whose the number of children will be returned.
public int getNumOfRelations()
getNumOfRelations
in interface ITaxonomy<Type extends FacetsType>
public java.util.Map<Term<FacetsType>,java.util.Collection<Term<FacetsType>>> getAllRelations()
getAllRelations
in interface ITaxonomy<Type extends FacetsType>
public int getTermId(java.lang.String path)
path
-
public java.util.Collection<Term<FacetsType>> getDirectChildren(Term<FacetsType> parent)
getDirectChildren
in interface ITaxonomy<Type extends FacetsType>
parent
- The Term whose the direct children Terms will be returned.
public java.util.Collection<Term<FacetsType>> getDirectChildren(int parentId)
getDirectChildren
in interface ITaxonomy<Type extends FacetsType>
parentId
- The id of Term whose the direct children Terms will be returned.
public java.util.Collection<Term<FacetsType>> getDirectParents(Term<FacetsType> child)
getDirectParents
in interface ITaxonomy<Type extends FacetsType>
child
- The Term whose the direct parents Terms will be returned.
public java.util.Collection<Term<FacetsType>> getDirectParents(int childId)
getDirectParents
in interface ITaxonomy<Type extends FacetsType>
childId
- The id of Term whose the direct parents Terms will be returned.
public boolean isDirectChild(Term<FacetsType> parent, Term<FacetsType> child)
isDirectChild
in interface ITaxonomy<Type extends FacetsType>
term
- The Term that will be checked if second argument is one of its direct children.child
- The Term that will be checked if it is direct child of first argument.
public boolean isDirectParent(Term<FacetsType> child, Term<FacetsType> parent)
isDirectParent
in interface ITaxonomy<Type extends FacetsType>
term
- The Term that will be checked if second argument is one of its direct parents.parent
- The Term that will be checked if it is direct parent of first argument.
public Term<FacetsType> getHead()
getHead
in interface ITaxonomy<Type extends FacetsType>
public int getTopElementId()
getTopElementId
in interface ITaxonomy<Type extends FacetsType>
public boolean isZP(int termId, java.util.HashSet<java.lang.Integer> indexes)
isZP
in interface ITaxonomy<Type extends FacetsType>
termId
- The id of the Term.indexes
- a HashSet with the ids of documents that have to be displayed.
public int getCount(int termId, java.util.HashSet<java.lang.Integer> indexes)
getCount
in interface ITaxonomy<Type extends FacetsType>
termId
- The id of the Term.indexes
- a HashSet with the ids of documents that have to be displayed.
public int getCount(Term<FacetsType> term, java.util.HashSet<java.lang.Integer> indexes)
getCount
in interface ITaxonomy<Type extends FacetsType>
term
- The Term.indexes
- a HashSet with the ids of documents that have to be displayed.
public java.util.HashMap<Term<FacetsType>,java.lang.Integer> getCount(java.util.HashSet<java.lang.Integer> indexes)
getCount
in interface ITaxonomy<Type extends FacetsType>
indexes
- a HashSet with the ids of documents that have to be displayed.
public java.util.HashSet<java.lang.Integer> getAllIds(int termId)
getAllIds
in interface ITaxonomy<Type extends FacetsType>
indexes
- a HashSet with the ids of documents that have to be displayed.
public java.util.HashSet<java.lang.Integer> getAllIds(Term<FacetsType> term)
getAllIds
in interface ITaxonomy<Type extends FacetsType>
indexes
- a HashSet with the ids of documents that have to be displayed.
public java.util.ArrayList<Term<FacetsType>> getAllChildren(Term<FacetsType> parent)
getAllChildren
in interface ITaxonomy<Type extends FacetsType>
parent
- Term of which list of children will be returned.
public void removeAllTheOtherIndexes(int termId)
removeAllTheOtherIndexes
in interface ITaxonomy<Type extends FacetsType>
termId
- the id of the termpublic boolean removeRelship(int parentId, int childId)
removeRelship
in interface ITaxonomy<Type extends FacetsType>
parentId
- the id of the parent termchildId
- the id of the child term
public boolean removeRelship(Term<FacetsType> parent, Term<FacetsType> child)
removeRelship
in interface ITaxonomy<Type extends FacetsType>
parent
- the parent term of the relationship.child
- the child term of the re
public java.util.ArrayList<Term<FacetsType>> getAllParents(Term<FacetsType> child)
getAllParents
in interface ITaxonomy<Type extends FacetsType>
child
- Term of which list of parents will be returned.
public java.util.HashMap<java.lang.Integer,java.util.Collection<Term<FacetsType>>> getAllParentsWithHierarchy(Term<FacetsType> child)
getAllParentsWithHierarchy
in interface ITaxonomy<Type extends FacetsType>
child
- the child term
public java.lang.String getTermPath(int tid)
tid
- the id of the term.
public java.util.Collection<Term<FacetsType>> getAllParents(int childId)
getAllParents
in interface ITaxonomy<Type extends FacetsType>
term
- The Term of which list of parents will be returned.
public boolean isChild(Term<FacetsType> parent, Term<FacetsType> child)
isChild
in interface ITaxonomy<Type extends FacetsType>
parent
- The Term that will be checked if second argument is one of its children.child
- The Term that will be checked if it is child of the first term.
public boolean isParent(Term<FacetsType> child, Term<FacetsType> parent)
isParent
in interface ITaxonomy<Type extends FacetsType>
child
- The Term that will be checked if the second argument is one of its parents.parent
- The Term that will be checked if it is parent of the first argument.
public boolean setRelship(Term<FacetsType> parent, Term<FacetsType> child)
setRelship
in interface ITaxonomy<Type extends FacetsType>
parent
- the parent Term of the relationship.child
- the child Term of the relationship.
public boolean setRelship(FacetsType parentValue, int parentId, FacetsType childValue, int childId)
setRelship
in interface ITaxonomy<Type extends FacetsType>
parentValue
- the value of the parent termparentId
- the id of the parent termchildValue
- the value of the child termchildId
- the id of the child term
public java.util.HashMap<java.lang.String,java.lang.Integer> setRelship(FacetsType parentValue, FacetsType childValue)
setRelship
in interface ITaxonomy<Type extends FacetsType>
parentValue
- the value of parent Term.childValue
- the value of child Term.
public int setRelship(int parentId, FacetsType childValue)
setRelship
in interface ITaxonomy<Type extends FacetsType>
parentId
- the id of the parent termchildValue
- the value of the child term
public int getChildId(int parentId, FacetsType childValue)
getChildId
in interface ITaxonomy<Type extends FacetsType>
parentId
- the id of the parent termchildValue
- the value of the child term
public boolean isRR(Term<FacetsType> parent, Term<FacetsType> child)
isRR
in interface ITaxonomy<Type extends FacetsType>
parent
- parent Term of relationship.child
- child Term of relationship.
public boolean isCycle(Term<FacetsType> parent, Term<FacetsType> child)
isCycle
in interface ITaxonomy<Type extends FacetsType>
parent
- parent Term of relationship.child
- child Term of relationship.
public java.lang.String toString()
toString
in interface ITaxonomy<Type extends FacetsType>
toString
in interface ITerminology<Type extends FacetsType>
toString
in class Terminology<Type extends FacetsType>
public void clear()
clear
in interface ITaxonomy<Type extends FacetsType>
clear
in interface ITerminology<Type extends FacetsType>
clear
in class Terminology<Type extends FacetsType>
public int addHead(FacetsType head)
addHead
in interface ITaxonomy<Type extends FacetsType>
head
- the value of the
public Term<FacetsType> getTopElement()
getTopElement
in interface ITaxonomy<Type extends FacetsType>
public boolean isValid()
isValid
in interface ITaxonomy<Type extends FacetsType>
public void elimRR()
elimRR
in interface ITaxonomy<Type extends FacetsType>
public boolean setRelshipsMaterialization(Materialization toDo)
setRelshipsMaterialization
in interface ITaxonomy<Type extends FacetsType>
public boolean isBroader(int parentId, int childId)
parentId
- the id of the parent term.childId
- the id of the child term.
public boolean isNarrower(int parentId, int childId)
parentId
- the id of the parent term.childId
- the id of the child term.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |