|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.data.AbstractSOMLibTemplateVector
at.tuwien.ifs.somtoolbox.data.SOMLibTemplateVector
public class SOMLibTemplateVector
Implements a TemplateVector
based on a SOMLib Template Vector File.
See also a sample TemplateVector file.
Created on May 14, 2004
Field Summary | |
---|---|
private int |
lineNumber
|
Fields inherited from class at.tuwien.ifs.somtoolbox.data.AbstractSOMLibTemplateVector |
---|
dim, elementMap, elements, longestStringLength, numInfo, numVectors, templateFileName |
Fields inherited from interface at.tuwien.ifs.somtoolbox.data.TemplateVector |
---|
templateFileNameSuffix |
Constructor Summary | |
---|---|
protected |
SOMLibTemplateVector()
Creates an empty instance. |
|
SOMLibTemplateVector(int numVectors,
int dim)
Constructor intended to be used when generating data. |
|
SOMLibTemplateVector(int numVectors,
String[] componentNames)
Creates an instance with the given component names. |
|
SOMLibTemplateVector(int numVectors,
String[] componentNames,
int numInfo)
Creates an instance with the given component names, and the specified detail level numInfo |
|
SOMLibTemplateVector(String templateFileName)
Creates a new TemplateVector by reading from the given file. |
Method Summary | |
---|---|
private String |
getErrorDetails(String line,
int lineNumber)
|
private String |
getErrorMessage(String messageDetail,
String line,
int lineNumber)
|
protected void |
processLine(int index,
String[] lineElements)
Parse information from one single line in the TemplateVector file, representing one attribute. |
void |
readTemplateVectorFile(String templateFileName)
Reads the TemplateVector information from the given filename. |
protected String |
readTemplateVectorFileHeader(BufferedReader br)
|
void |
setComponentNames(String[] componentNames)
Sets the names of the vector elements. |
void |
setLabel(int index,
String label)
|
Methods inherited from class at.tuwien.ifs.somtoolbox.data.AbstractSOMLibTemplateVector |
---|
containsLabel, dim, getDocumentFrequency, getElement, getElement, getIndex, getIndexOfFeature, getLabel, getLabels, getLabelsAsList, getLongestStringLength, getTFxIDFVectorFromTerms, incNumVectors, numinfo, numVectors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int lineNumber
Constructor Detail |
---|
protected SOMLibTemplateVector()
public SOMLibTemplateVector(int numVectors, int dim)
public SOMLibTemplateVector(int numVectors, String[] componentNames, int numInfo) throws IOException
IOException
public SOMLibTemplateVector(int numVectors, String[] componentNames) throws IOException
IOException
public SOMLibTemplateVector(String templateFileName) throws IOException
TemplateVector
by reading from the given file.
templateFileName
- the file to read from
IOException
- in case of problems reading the fileMethod Detail |
---|
public void readTemplateVectorFile(String templateFileName) throws IOException
TemplateVector
information from the given filename. The file format has to follow the
specification given in the SOMLib Data Files
specification. See also a sample TemplateVector file.
IOException
protected String readTemplateVectorFileHeader(BufferedReader br) throws IOException
IOException
private String getErrorMessage(String messageDetail, String line, int lineNumber)
private String getErrorDetails(String line, int lineNumber)
protected void processLine(int index, String[] lineElements)
TemplateVector
file, representing one attribute.
index
- the index (number) of this attributelineElements
- the elements of this line, split by the delimiterpublic void setComponentNames(String[] componentNames)
public void setLabel(int index, String label)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |