public class SampleMetadata
extends java.lang.Object
Describe samples structure by holding sample column names and theirs matching indexes.
Constructor and Description |
---|
SampleMetadata(char separator,
java.lang.String... columns)
Builds metadata from separator character and a list of column names
|
SampleMetadata(SampleSaveConfiguration saveConfig)
Construct SampleMetaData from
SampleSaveConfiguration . |
Modifier and Type | Method and Description |
---|---|
int |
ensureIndexOf(java.lang.String col)
Returns the index of the column with the specified name.
|
int |
getColumnCount() |
java.lang.String |
getColumnName(int i)
Gets the name of the ith column in this metadata
|
java.lang.String |
getColumnName(java.lang.Integer i)
Gets the name of the ith column in this metadata
|
char |
getSeparator() |
int |
indexOf(java.lang.String col)
Returns the index of the column with the specified name.
|
java.lang.String |
toString() |
public SampleMetadata(char separator, java.lang.String... columns)
separator
- The character used for column separationcolumns
- The list of columns names (must not be null
)public SampleMetadata(SampleSaveConfiguration saveConfig)
SampleSaveConfiguration
.saveConfig
- config from which metadata gets extracted (must not be
null
)public char getSeparator()
public int getColumnCount()
public java.lang.String getColumnName(int i)
i
- The index of the column for which the name is requested (zero
based)java.lang.IndexOutOfBoundsException
- If the requested columln does not exist (< 0 or >
getColumnCount()
)public java.lang.String getColumnName(java.lang.Integer i)
i
- The index of the column for which the name is requested (zero
based)java.lang.IndexOutOfBoundsException
- If the requested columln does not exist (< 0 or >
getColumnCount()
)public int indexOf(java.lang.String col)
col
- the column name for which the index is requestedpublic int ensureIndexOf(java.lang.String col)
col
- the column name for which the index is requestedSampleException
- when the column with the specified name is not foundpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.