Package weka.classifiers.lazy.AM.data
Class Concept<T extends Supracontext>
- java.lang.Object
-
- weka.classifiers.lazy.AM.data.Concept<T>
-
- Type Parameters:
T- The implementation of Supracontext to be stored in this node.
- All Implemented Interfaces:
Supracontext
public class Concept<T extends Supracontext> extends java.lang.Object implements Supracontext
This class is a decorator which wraps aSupracontextand adds the functionality of a node (concept) used in the ImprovedAddIntent algorithm (seeSparseLattice.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Subcontext sub)Add a subcontext to this supracontext.voidaddParent(Concept<T> newParent)voidaddToExtent(Subcontext newSub)Add the given subcontext to the extent of this concept.Supracontextcopy()Return an exact, deep copy of the supracontext.booleanequals(java.lang.Object other)This equals method differs from the specification inSupracontext.equals(Object); it compares the concept intent (label), instead of the extent (contained subcontexts).Concept<T>getCandidateParent()LabelgetContext()Retrieve the supracontextual context, represented with aLabelobject.java.math.BigIntegergetCount()java.util.Set<Subcontext>getData()java.util.Set<Subcontext>getExtent()LabelgetIntent()java.util.Set<Concept<T>>getParents()TgetSupra()inthashCode()This implementation differs from the specification inSupracontext.hashCode(); it returns the hash of the intent (label), instead of the extent (contained subcontexts).booleanisEmpty()booleannotTagged()voidremoveParent(Concept<T> oldParent)voidsetCandidateParent(Concept<T> candidateParent)voidsetCount(java.math.BigInteger count)Set the count of the supracontext.voidsetTagged(boolean tag)java.lang.StringtoString()
-
-
-
Method Detail
-
getExtent
public java.util.Set<Subcontext> getExtent()
-
getSupra
public T getSupra()
-
addToExtent
public void addToExtent(Subcontext newSub)
Add the given subcontext to the extent of this concept.
-
getIntent
public Label getIntent()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
copy
public Supracontext copy()
Description copied from interface:SupracontextReturn an exact, deep copy of the supracontext. The new object should be an instance of the same class as the calling object.- Specified by:
copyin interfaceSupracontext- Returns:
- a deep copy of this supracontext.
-
equals
public boolean equals(java.lang.Object other)
This equals method differs from the specification inSupracontext.equals(Object); it compares the concept intent (label), instead of the extent (contained subcontexts). Two Supracontexts are equal if they are of the same class and contain the same subcontexts.- Specified by:
equalsin interfaceSupracontext- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
This implementation differs from the specification inSupracontext.hashCode(); it returns the hash of the intent (label), instead of the extent (contained subcontexts). The hashcode depends solely on the set of subcontexts contained in a supracontext.- Specified by:
hashCodein interfaceSupracontext- Overrides:
hashCodein classjava.lang.Object
-
getData
public java.util.Set<Subcontext> getData()
- Specified by:
getDatain interfaceSupracontext- Returns:
- an unmodifiable view of the set of subcontexts contained in this supracontext.
-
add
public void add(Subcontext sub)
Description copied from interface:SupracontextAdd a subcontext to this supracontext.- Specified by:
addin interfaceSupracontext- Parameters:
sub- Subcontext to add to the supracontext.
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceSupracontext- Returns:
- true if this supracontext contains no subcontexts; false otherwise.
-
getCount
public java.math.BigInteger getCount()
- Specified by:
getCountin interfaceSupracontext- Returns:
- the number of copies of this supracontext contained in the lattice
-
setCount
public void setCount(java.math.BigInteger count)
Description copied from interface:SupracontextSet the count of the supracontext.- Specified by:
setCountin interfaceSupracontext- Parameters:
count- the count
-
getContext
public Label getContext()
Description copied from interface:SupracontextRetrieve the supracontextual context, represented with aLabelobject. Label mismatches should be interpreted as "contained subcontexts may or may not match for this attribute, while matches should be regarded as "all contained subcontexts matched for this attribute". The running time for this default implementation is linear in the number of contained subcontexts.- Specified by:
getContextin interfaceSupracontext- Returns:
- The context for this supracontext, or
nullif the subcontexts are empty
-
notTagged
public boolean notTagged()
-
setTagged
public void setTagged(boolean tag)
-
-