|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdatabionics.io.BaseFile
databionics.io.ListFile
databionics.io.MapFile
databionics.io.ClassmaskFile
public class ClassmaskFile
| Field Summary | |
|---|---|
protected ColorTable |
classColors
Default color table |
protected cern.colt.list.IntArrayList |
classes
Column with class numbers |
protected cern.colt.map.OpenIntIntHashMap |
key2pos
Column with data point keys |
protected cern.colt.list.IntArrayList |
keys
Column with data point keys |
protected static org.apache.log4j.Logger |
log
Log4j logging. |
| Fields inherited from class databionics.io.MapFile |
|---|
map |
| Fields inherited from class databionics.io.ListFile |
|---|
data |
| Fields inherited from class databionics.io.BaseFile |
|---|
allowEmptyLines, comment, commentPrefix, delimiter, delimiters, file, header, headerPrefix, loc, nf |
| Constructor Summary | |
|---|---|
ClassmaskFile()
Standard constructor |
|
ClassmaskFile(int size)
|
|
ClassmaskFile(java.lang.String filename)
Constructor with a filename |
|
| Method Summary | |
|---|---|
void |
add(int index,
int cls)
Add an index - class number pair |
void |
addClass(int cls)
Add a data class if it's not in the list |
protected void |
buildHeader()
Generate header. |
protected java.lang.String |
buildLine(int row)
Construct a line for saving. |
boolean |
changeIndex(int from,
int to)
Change Index of class. |
protected void |
checkHeader()
Check consistency of header information. |
void |
clear()
Clear class list, set all class numbers to 0 |
java.lang.Object |
clone()
Deprecated. might not work correct |
int |
getByIndex(int index)
Get class number of a classification by its index |
DataClass |
getClass(int pos)
Get a data class by its position in the list |
DataClass |
getClassByIndex(int index)
Get a data class by its index |
cern.colt.list.IntArrayList |
getClasses()
Get classes. |
static FileType |
getFileType()
Get the type of file. |
int |
getHighestClassIndex()
|
cern.colt.list.IntArrayList |
getKeys()
Get keys. |
int |
getQuick(int pos)
Get class number of a classification by its position in the list |
int |
getSize()
Get the number of lines in file. |
protected void |
parseHeader()
Parse the header. |
protected void |
parseLine(int row,
java.lang.String line)
Parse a line. |
void |
remove(DataClass cls)
Remove a class, set all corresponding class numbers to 0 |
void |
remove(int cls)
Remove a class, set all corresponding class numbers to 0. |
void |
removeOne(int index,
int classes)
|
void |
set(int index,
int cls)
Set an index - class number pair |
void |
setClasses(int[] classes)
Set classes. |
void |
setClasses(cern.colt.list.IntArrayList classes)
Set classes. |
void |
setKeys()
Add automatically generated keys. |
void |
setKeys(int[] keys)
Set keys. |
void |
setKeys(cern.colt.list.IntArrayList keys)
Set keys. |
int |
size(DataClass cls)
Get size of a class |
int |
size(int cls)
Get size of a class |
void |
sort()
Sort classifications by key number. |
| Methods inherited from class databionics.io.MapFile |
|---|
add, getMap, remove, setData, setMap |
| Methods inherited from class databionics.io.ListFile |
|---|
getData |
| Methods inherited from class databionics.io.BaseFile |
|---|
checkHeaderAgainstSize, getComment, getFile, getFilename, getHeader, getLocale, getNumberFormat, init, isHeader, isNaN, isNumber, load, load, parseError, save, save, setComment, setFilename, setLocale, writeStringList, writeStringList |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
protected cern.colt.list.IntArrayList keys
protected cern.colt.list.IntArrayList classes
protected cern.colt.map.OpenIntIntHashMap key2pos
protected ColorTable classColors
| Constructor Detail |
|---|
public ClassmaskFile()
public ClassmaskFile(int size)
public ClassmaskFile(java.lang.String filename)
filename - Name of the file| Method Detail |
|---|
public void sort()
protected void parseHeader()
parseHeader in class BaseFile
protected void parseLine(int row,
java.lang.String line)
parseLine in class BaseFilerow - Number of current line.line - Current line.protected void checkHeader()
checkHeader in class BaseFileprotected void buildHeader()
buildHeader in class BaseFileprotected java.lang.String buildLine(int row)
buildLine in class ListFilerow - Number of current line.
public DataClass getClass(int pos)
position - of data classpublic void addClass(int cls)
class - numberpublic DataClass getClassByIndex(int index)
index - class numberpublic int getSize()
getSize in class ListFile
public void add(int index,
int cls)
index - of data point or best matchcls - class number
public void set(int index,
int cls)
index - of data point or best matchcls - class numberpublic void remove(int cls)
remove in class MapFilecls - class number
public void removeOne(int index,
int classes)
index - classes - public void remove(DataClass cls)
cls - class
public boolean changeIndex(int from,
int to)
from - old Indexto - new Indexpublic void clear()
public int size(int cls)
cls - class number
public int size(DataClass cls)
cls - class
public int getQuick(int pos)
position - of classificationpublic int getByIndex(int index)
index - index of the data pointpublic java.lang.Object clone()
clone in class java.lang.Objectpublic cern.colt.list.IntArrayList getKeys()
public void setKeys(cern.colt.list.IntArrayList keys)
public void setKeys(int[] keys)
public void setKeys()
public cern.colt.list.IntArrayList getClasses()
public void setClasses(cern.colt.list.IntArrayList classes)
public void setClasses(int[] classes)
public static FileType getFileType()
public int getHighestClassIndex()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||