Class Schema
- java.lang.Object
-
- de.aristaflow.adept2.model.logmanagement.Schema
-
- All Implemented Interfaces:
Serializable
public class Schema extends Object implements Serializable
ASchema
defines an ordered set of columns and is used in thelog manager
to describe the structure oflogs
complex columns
andLog.read(de.aristaflow.adept2.base.sessionmanagement.SessionToken, String, String, int, String...)
- Author:
- Patrick Schmidt
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Column
getColumn(int index)
Returns the column at the specified index.Column
getColumn(String columnName)
Returns the column with the specified name ornull
if no such column exists.int
getColumnCount()
Returns the number of columns in this schema.List<Column>
getColumnRecursively(String columnName)
Returns the column with the specified name recursively or the empty list if no such column exists.Column[]
getColumns()
Returns all columns of this schema.int
hashCode()
int
indexOfColumn(String columnName)
Returns the index of the column with the specified name or-1
if no such column exists.
-
-
-
Constructor Detail
-
Schema
public Schema(Column... columns)
Constructs a newSchema
with the specified columns.- Parameters:
columns
- the columns of this schema
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
Returns the number of columns in this schema.- Returns:
- the number of columns in this schema
-
getColumn
public Column getColumn(int index)
Returns the column at the specified index.- Parameters:
index
- the desired index- Returns:
- the column at the specified index
-
indexOfColumn
public int indexOfColumn(String columnName)
Returns the index of the column with the specified name or-1
if no such column exists.- Parameters:
columnName
- the column name being looked for- Returns:
- the index of the column with the specified name or
-1
if no such column exists
-
getColumn
public Column getColumn(String columnName)
Returns the column with the specified name ornull
if no such column exists.- Parameters:
columnName
- the column name being looked for- Returns:
- the column with the specified name
-
getColumnRecursively
public List<Column> getColumnRecursively(String columnName)
Returns the column with the specified name recursively or the empty list if no such column exists. Note, that a breadth-first algorithm is applied. If the same column name is re-used in a sub-schema, the method will always return the path to the parent schema and not to the path to a sub-schema.- Parameters:
columnName
- the column name being looked for- Returns:
- The column with the specified name and the way through the schema. This will be the empty list if no column of the designated name is found.
-
getColumns
public Column[] getColumns()
Returns all columns of this schema.- Returns:
- all columns of this schema
-
-