|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.data.LabelSet
public class LabelSet
Class that handles labelsets
Field Summary | |
---|---|
protected int[] |
labelSet
The set is represented internally as an array of integers. |
Constructor Summary | |
---|---|
LabelSet(double[] set)
Initializes an object based on an array of doubles containing 0/1 |
Method Summary | |
---|---|
int |
compareTo(LabelSet o)
Used for sorting collections of labelsets according to size |
boolean |
equals(Object obj)
|
static LabelSet |
fromBitString(String bits)
Constructs a LabelSet object from a bitstring. |
ArrayList<LabelSet> |
getSubsets()
Constructs all subsets of a labelset (apart from the empty one). |
int |
hammingDifference(LabelSet other)
Calculates the Hamming Distance between the current labelset and another labelset. |
int |
hashCode()
|
static LabelSet |
intersection(LabelSet l1,
LabelSet l2)
|
int |
size()
The number of set members. |
String |
toBitString()
Constructs a bitstring from the current labelset. |
boolean[] |
toBooleanArray()
Get an array representation of this set. |
double[] |
toDoubleArray()
Get an array representation of this set. |
String |
toString()
A comma-separated list of label names enclosed in curlies. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int[] labelSet
Constructor Detail |
---|
public LabelSet(double[] set)
set
- Method Detail |
---|
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public int size()
public double[] toDoubleArray()
public boolean[] toBooleanArray()
public int hammingDifference(LabelSet other)
other
- the other LabelSet object.
public String toBitString()
public static LabelSet fromBitString(String bits) throws Exception
bits
- the bitstring
Exception
public ArrayList<LabelSet> getSubsets() throws Exception
Exception
public static LabelSet intersection(LabelSet l1, LabelSet l2)
l1
- a labelsetl2
- another labelset
public int compareTo(LabelSet o)
compareTo
in interface Comparable<LabelSet>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |