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 aSupracontext
and 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 void
add(Subcontext sub)
Add a subcontext to this supracontext.void
addParent(Concept<T> newParent)
void
addToExtent(Subcontext newSub)
Add the given subcontext to the extent of this concept.Supracontext
copy()
Return an exact, deep copy of the supracontext.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).Concept<T>
getCandidateParent()
Label
getContext()
Retrieve the supracontextual context, represented with aLabel
object.java.math.BigInteger
getCount()
java.util.Set<Subcontext>
getData()
java.util.Set<Subcontext>
getExtent()
Label
getIntent()
java.util.Set<Concept<T>>
getParents()
T
getSupra()
int
hashCode()
This implementation differs from the specification inSupracontext.hashCode()
; it returns the hash of the intent (label), instead of the extent (contained subcontexts).boolean
isEmpty()
boolean
notTagged()
void
removeParent(Concept<T> oldParent)
void
setCandidateParent(Concept<T> candidateParent)
void
setCount(java.math.BigInteger count)
Set the count of the supracontext.void
setTagged(boolean tag)
java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
copy
public Supracontext copy()
Description copied from interface:Supracontext
Return an exact, deep copy of the supracontext. The new object should be an instance of the same class as the calling object.- Specified by:
copy
in 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:
equals
in interfaceSupracontext
- Overrides:
equals
in 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:
hashCode
in interfaceSupracontext
- Overrides:
hashCode
in classjava.lang.Object
-
getData
public java.util.Set<Subcontext> getData()
- Specified by:
getData
in interfaceSupracontext
- Returns:
- an unmodifiable view of the set of subcontexts contained in this supracontext.
-
add
public void add(Subcontext sub)
Description copied from interface:Supracontext
Add a subcontext to this supracontext.- Specified by:
add
in interfaceSupracontext
- Parameters:
sub
- Subcontext to add to the supracontext.
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceSupracontext
- Returns:
- true if this supracontext contains no subcontexts; false otherwise.
-
getCount
public java.math.BigInteger getCount()
- Specified by:
getCount
in 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:Supracontext
Set the count of the supracontext.- Specified by:
setCount
in interfaceSupracontext
- Parameters:
count
- the count
-
getContext
public Label getContext()
Description copied from interface:Supracontext
Retrieve the supracontextual context, represented with aLabel
object. 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:
getContext
in interfaceSupracontext
- Returns:
- The context for this supracontext, or
null
if the subcontexts are empty
-
notTagged
public boolean notTagged()
-
setTagged
public void setTagged(boolean tag)
-
-