Package weka.classifiers.lazy.AM.label
Class IntLabel
- java.lang.Object
- 
- weka.classifiers.lazy.AM.label.Label
- 
- weka.classifiers.lazy.AM.label.IntLabel
 
 
- 
 public class IntLabel extends Label ALabelimplementation that stores match/mismatch data in a single integer for compactness and speed. The use of an integer as storage, however, creates a limit to the size of the label. SeeMAX_CARDINALITY.
- 
- 
Field SummaryFields Modifier and Type Field Description static intMAX_CARDINALITYThe maximum cardinality of an integer label, which is limited by the number of bits in an integer in Java.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallMatching()java.util.Iterator<Label>descendantIterator()The "descendants" of a label are the set of labels with the same "mismatch" entries, but with one or more of the "match" entries changed into a "mismatch" entry.booleanequals(java.lang.Object other)intgetCardinality()inthashCode()Labelintersect(Label other)Create a new label for which each location is marked as a match if both this label and otherLabel are marked match, otherwise mismatch.booleanisDescendantOf(Label possibleDescendant)Determine if this label is the "descendant" of possibleAncestor.intlabelBits()booleanmatches(int index)Determine if the given index is marked as a match or a mismatch.intnumMatches()java.lang.StringtoString()Labelunion(Label other)Create a new label for which each location is marked as a match if either this label orotheris marked match, otherwise mismatch.
 
- 
- 
- 
Field Detail- 
MAX_CARDINALITYpublic static final int MAX_CARDINALITY The maximum cardinality of an integer label, which is limited by the number of bits in an integer in Java.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
labelBitspublic int labelBits() - Returns:
- An integer whose 1 bits represent the mismatches and 0 bits represent the matches in this label.
 
 - 
getCardinalitypublic int getCardinality() - Specified by:
- getCardinalityin class- Label
- Returns:
- The number of attributes represented in this label.
 
 - 
matchespublic boolean matches(int index) Description copied from class:LabelDetermine if the given index is marked as a match or a mismatch.
 - 
numMatchespublic int numMatches() - Specified by:
- numMatchesin class- Label
- Returns:
- The total number of matches marked in this label.
 
 - 
intersectpublic Label intersect(Label other) Description copied from class:LabelCreate a new label for which each location is marked as a match if both this label and otherLabel are marked match, otherwise mismatch. In other words, keep all mismatches from both labels.
 - 
unionpublic Label union(Label other) Description copied from class:LabelCreate a new label for which each location is marked as a match if either this label orotheris marked match, otherwise mismatch. In other words, keep all matches from both labels.
 - 
allMatchingpublic boolean allMatching() - Specified by:
- allMatchingin class- Label
- Returns:
- true if every feature of this label is a match (i.e. this is the
 top of the lattice; false otherwise
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object other) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
descendantIteratorpublic java.util.Iterator<Label> descendantIterator() Description copied from class:LabelThe "descendants" of a label are the set of labels with the same "mismatch" entries, but with one or more of the "match" entries changed into a "mismatch" entry. For example, the children of{match, mismatch, mismatch, match}are:- {mismatch, mismatch, mismatch, match},
- {match, mismatch, mismatch, mismatch}, and
- {mismatch, mismatch, mismatch, mismatch}
 - Specified by:
- descendantIteratorin class- Label
- Returns:
- An iterator over the label descendants
 
 - 
isDescendantOfpublic boolean isDescendantOf(Label possibleDescendant) Description copied from class:LabelDetermine if this label is the "descendant" of possibleAncestor. This label is a descendant of the other label if every mismatching entry in the other label is also a mismatching entry in this label. Any label is also a descendant of itself.- Specified by:
- isDescendantOfin class- Label
- Parameters:
- possibleDescendant- possible label ancestor
- Returns:
- true if possibleAncestor is an ancestor of this label; false otherwise.
 
 
- 
 
-