
V - the type of NumberVector usedpublic class NumberVectorLabelParser<V extends NumberVector> extends AbstractStreamingParser
| Modifier and Type | Class and Description |
|---|---|
static class |
NumberVectorLabelParser.Parameterizer<V extends NumberVector>
Parameterization class.
|
BundleStreamSource.Event| Modifier and Type | Field and Description |
|---|---|
(package private) gnu.trove.list.array.TDoubleArrayList |
attributes
(Reused) store for numerical attributes.
|
protected List<String> |
columnnames
Column names.
|
protected LabelList |
curlbl
Current labels.
|
protected V |
curvec
Current vector.
|
protected NumberVector.Factory<V> |
factory
Vector factory class.
|
protected boolean |
haslabels
Whether or not the data set has labels.
|
private BitSet |
labelIndices
Keeps the indices of the attributes to be treated as a string label.
|
(package private) ArrayList<String> |
labels
(Reused) store for labels.
|
private static Logging |
LOG
Logging class.
|
protected int |
maxdim
Dimensionality reported.
|
protected BundleMeta |
meta
Metadata.
|
protected int |
mindim
Dimensionality reported.
|
(package private) BundleStreamSource.Event |
nextevent
Event to report next.
|
(package private) Unique<String> |
unique
For String unification.
|
ATTRIBUTE_CONCATENATION, COMMENT_PATTERN, DEFAULT_SEPARATOR, NUMBER_PATTERN, QUOTE_CHARS, tokenizer| Constructor and Description |
|---|
NumberVectorLabelParser(NumberVector.Factory<V> factory)
Constructor with defaults.
|
NumberVectorLabelParser(Pattern colSep,
String quoteChars,
Pattern comment,
BitSet labelIndices,
NumberVector.Factory<V> factory)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildMeta()
Update the meta element.
|
void |
cleanup()
Cleanup internal data structures.
|
protected <A> V |
createDBObject(A attributes,
NumberArrayAdapter<?,A> adapter)
Creates a database object of type V.
|
Object |
data(int rnum)
Access a particular object and representation.
|
protected Logging |
getLogger()
Get the logger for this class.
|
BundleMeta |
getMeta()
Get the current meta data.
|
(package private) SimpleTypeInformation<V> |
getTypeInformation(int mindim,
int maxdim)
Get a prototype object for the given dimensionality.
|
void |
initStream(InputStream in)
Init the streaming parser for the given input stream.
|
protected boolean |
isLabelColumn(int col)
Test if the current column is marked as label column.
|
BundleStreamSource.Event |
nextEvent()
Get the next event
|
protected boolean |
parseLineInternal()
Internal method for parsing a single line.
|
asMultipleObjectsBundle, assignDBID, getLineNumber, hasDBIDs, nextLineExceptComments, parseisComment, lengthWithoutLinefeed, toStringprivate static final Logging LOG
private BitSet labelIndices
protected NumberVector.Factory<V extends NumberVector> factory
protected int mindim
protected int maxdim
protected BundleMeta meta
protected boolean haslabels
protected V extends NumberVector curvec
protected LabelList curlbl
final gnu.trove.list.array.TDoubleArrayList attributes
BundleStreamSource.Event nextevent
public NumberVectorLabelParser(NumberVector.Factory<V> factory)
factory - Vector factorypublic NumberVectorLabelParser(Pattern colSep, String quoteChars, Pattern comment, BitSet labelIndices, NumberVector.Factory<V> factory)
colSep - Column separatorquoteChars - Quote charactercomment - Comment patternlabelIndices - Column indexes that are numeric.factory - Vector factoryprotected boolean isLabelColumn(int col)
col - Column numbertrue when a label column.public void initStream(InputStream in)
StreamingParserinitStream in interface StreamingParserinitStream in class AbstractStreamingParserin - the stream to parse objects frompublic BundleMeta getMeta()
BundleStreamSourcepublic BundleStreamSource.Event nextEvent()
BundleStreamSourcepublic void cleanup()
AbstractParsercleanup in interface Parsercleanup in class AbstractStreamingParserprotected void buildMeta()
public Object data(int rnum)
BundleStreamSourcernum - Representation numberprotected boolean parseLineInternal()
true when a valid line was read, false on a label
row.protected <A> V createDBObject(A attributes, NumberArrayAdapter<?,A> adapter)
A - attribute typeattributes - the attributes of the vector to create.adapter - Array adapterSimpleTypeInformation<V> getTypeInformation(int mindim, int maxdim)
mindim - Minimum dimensionalitymaxdim - Maximum dimensionalityprotected Logging getLogger()
AbstractParsergetLogger in class AbstractParserCopyright © 2014 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.