public class MojoFrameMeta
extends java.lang.Object
implements java.io.Serializable
Container for meta data of a MojoFrame. This immutable class is used as a template for constructing MojoFrames in addition to providing names to the columns of an existing MojoFrame.
| Constructor and Description |
|---|
MojoFrameMeta(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns) |
MojoFrameMeta(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
java.util.Collection<java.lang.Integer> indices)
With this constructor, the full set of columns is used but only some of them can be retrieved by name.
|
MojoFrameMeta(java.lang.String[] names,
MojoColumn.Type[] types)
Deprecated.
use
MojoFrameMeta(List), optionally with help of MojoColumnMeta.toColumns(String[], MojoColumn.Type[], MojoColumn.Kind) instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String columnName)
Checks if there exists meta data for a column with a particular name
|
java.lang.String |
debugIndicesToNames(int[] indices) |
static java.lang.String |
debugIndicesToNames(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
java.util.Collection<java.lang.Integer> indices) |
static java.lang.String |
debugIndicesToNames(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
int[] indices) |
int |
getColumnIndex(java.lang.String columnName)
Get the index of a column with the name
columnName |
java.lang.String |
getColumnName(int index)
Get the name of a column at a particular index
|
java.lang.String[] |
getColumnNames()
Deprecated.
use
getColumns() instead |
protected java.util.Map<java.lang.String,java.lang.Integer> |
getColumnNamesMap() |
java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> |
getColumns() |
MojoColumn.Type |
getColumnType(int index)
Get the type of a column at a particular index
|
MojoColumn.Type |
getColumnType(java.lang.String columnName)
Get the type of a column with the name
columnName |
MojoColumn.Type[] |
getColumnTypes()
Deprecated.
use
getColumns() instead |
static MojoFrameMeta |
getEmpty()
Make a MojoFrameMeta instance with no columns
|
java.lang.Integer |
indexOf(ai.h2o.mojos.runtime.api.MojoColumnMeta column) |
java.lang.Integer |
indexOf(java.lang.String columnName)
Deprecated.
Lookup by name is dangerous, as names are not unique. Use
indexOf(MojoColumnMeta) instead. |
int[] |
namesToIndices(java.lang.String[] exposedColumnNames) |
int |
size()
Get the number of columns in this instance
|
MojoFrameMeta |
subFrame(int[] indices) |
java.lang.String |
toString() |
@Deprecated
public MojoFrameMeta(java.lang.String[] names,
MojoColumn.Type[] types)
MojoFrameMeta(List), optionally with help of MojoColumnMeta.toColumns(String[], MojoColumn.Type[], MojoColumn.Kind) instead.public MojoFrameMeta(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns)
public MojoFrameMeta(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
java.util.Collection<java.lang.Integer> indices)
With this constructor, the full set of columns is used but only some of them can be retrieved by name.
columns - -indices - -public int[] namesToIndices(java.lang.String[] exposedColumnNames)
exposedColumnNames - column names to convertpublic MojoFrameMeta subFrame(int[] indices)
public static MojoFrameMeta getEmpty()
Make a MojoFrameMeta instance with no columns
public int getColumnIndex(java.lang.String columnName)
Get the index of a column with the name columnName
columnName - The name of the column@Deprecated public java.lang.Integer indexOf(java.lang.String columnName)
indexOf(MojoColumnMeta) instead.public java.lang.Integer indexOf(ai.h2o.mojos.runtime.api.MojoColumnMeta column)
public java.lang.String getColumnName(int index)
Get the name of a column at a particular index
index - The index of the columnpublic MojoColumn.Type getColumnType(int index)
Get the type of a column at a particular index
index - The index of a columnpublic MojoColumn.Type getColumnType(java.lang.String columnName)
Get the type of a column with the name columnName
columnName - The name of the columnpublic boolean contains(java.lang.String columnName)
Checks if there exists meta data for a column with a particular name
columnName - The name of the columnpublic int size()
Get the number of columns in this instance
protected java.util.Map<java.lang.String,java.lang.Integer> getColumnNamesMap()
@Deprecated public java.lang.String[] getColumnNames()
getColumns() instead@Deprecated public MojoColumn.Type[] getColumnTypes()
getColumns() insteadpublic java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> getColumns()
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String debugIndicesToNames(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
int[] indices)
public static java.lang.String debugIndicesToNames(java.util.List<ai.h2o.mojos.runtime.api.MojoColumnMeta> columns,
java.util.Collection<java.lang.Integer> indices)
public java.lang.String debugIndicesToNames(int[] indices)