|
||||||||||
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.ClsFile
public class ClsFile
File that stores classification of data points or best matches. Attention: The list and the map store the DataClass objects retrieved from the header of the *.cls file and not the classification pairs from the body of the file. The actual classification is stored in two IntArrayLists as integer pairs (index of data points, class number). For fast access to the class number by the index value use get(int index) backed by an additional OpenIntIntMap.
Field Summary | |
---|---|
protected cern.colt.list.IntArrayList |
boldClasses
Class indices to be highlighted in some display |
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 | |
---|---|
ClsFile()
Standard constructor |
|
ClsFile(BMFile bmFile)
|
|
ClsFile(java.lang.String filename)
Constructor with a filename |
Method Summary | |
---|---|
void |
add(int index,
int cls)
Add an index - class number pair |
void |
add2bold(int i)
add an single class to boldclass |
void |
addClass(int cls)
Add a data class if it's not in the list |
void |
addClass(int cls,
java.lang.String name)
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. deprecated because incomplete. TODO: make complete |
cern.colt.list.IntArrayList |
getBoldClasses()
Get highlighted classes. |
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. |
boolean |
hasClass(int classnumber)
|
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 |
removeFromBold(int i)
Remove class from boldclasses |
void |
removeOne(int index,
int classes)
|
void |
set(int index,
int cls)
Deprecated. is a wrapper to add only, wich should manage id right, check if code is still working. if yes change set to add. stammi |
void |
setBoldClasses(int[] classes)
Set highlighted classes. |
void |
setBoldClasses(cern.colt.list.IntArrayList classes)
Set highlighted classes. |
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 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
protected cern.colt.list.IntArrayList boldClasses
Constructor Detail |
---|
public ClsFile()
public ClsFile(java.lang.String filename)
filename
- Name of the filepublic ClsFile(BMFile bmFile)
Method Detail |
---|
public void sort()
protected void parseHeader()
parseHeader
in class BaseFile
protected void parseLine(int row, java.lang.String line)
parseLine
in class BaseFile
row
- Number of current line.line
- Current line.protected void checkHeader()
checkHeader
in class BaseFile
protected void buildHeader()
buildHeader
in class BaseFile
protected java.lang.String buildLine(int row)
buildLine
in class ListFile
row
- Number of current line.
public DataClass getClass(int pos)
position
- of data classpublic void addClass(int cls, java.lang.String name)
cls
- class numbername
- class namepublic void addClass(int cls)
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 numberpublic void set(int index, int cls)
index
- of data point or best matchcls
- class numberpublic void remove(int cls)
remove
in class MapFile
cls
- class numberpublic void removeOne(int index, int classes)
index
- classes
- public void remove(DataClass cls)
cls
- classpublic 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.Object
public 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 cern.colt.list.IntArrayList getBoldClasses()
public void setBoldClasses(cern.colt.list.IntArrayList classes)
public void setBoldClasses(int[] classes)
public void add2bold(int i)
int
- i class to addpublic void removeFromBold(int i)
i
- position of classnumber in (IntArrayList) boldClassespublic static FileType getFileType()
public int getHighestClassIndex()
public boolean hasClass(int classnumber)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |