public class IndexClusters extends Object implements Clusters
Modifier and Type | Field and Description |
---|---|
protected int[][] |
clusters |
protected int |
nEntries |
CLUSTER_HEADER
Constructor and Description |
---|
IndexClusters()
Used only to initailise for
IOUtils |
IndexClusters(int[] assignments) |
IndexClusters(int[][] clusters) |
IndexClusters(int[][] clusters,
int nEntries) |
IndexClusters(List<int[]> completedClusters) |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
int[][] |
clusters()
Get the number of clusters.
|
int |
numClusters()
Get the number of clusters.
|
int |
numEntries()
Get the number of data entries
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
String |
toString() |
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public IndexClusters()
IOUtils
public IndexClusters(int[][] clusters, int nEntries)
clusters
- the clustersnEntries
- the number of entriespublic IndexClusters(int[][] clusters)
clusters
- the clusterspublic IndexClusters(int[] assignments)
assignments
- convert a list of cluster assignments to a 2D array to cluster
to assignmentspublic IndexClusters(List<int[]> completedClusters)
completedClusters
- public int[][] clusters()
public int numEntries()
public int numClusters()
public void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to out