public abstract class Table<T> extends Object implements ITable
Generated table classes have a java.util.Map or a org.faktorips.util.ReadOnlyBinaryRangeTree member variable for each of their find methods. These maps or trees get filled at initialization time and are accessed within the find methods. Maps are used as member variables if the value to return can be identified by means of a hash key. A hash key can consist of multiple fields of value types (e.g. integer, long, decimal). If the value to return is identified by a range of key values a tree is used as the data structure to efficiently retrieve the value from. If the key that identifies a value consists of a combination of hash keys and range fields a map is used that contains trees as values. Depending on the number of range fields a tree hierarchy is build up where the depth of the hierarchy is determined by the number of range fields. That means that each node of a tree contains another tree representing the next level.
| Modifier and Type | Field and Description |
|---|---|
protected List<T> |
rows
Contains all rows of this table.
|
| Constructor and Description |
|---|
Table() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addRow(List<String> columns,
IRuntimeRepository productRepository)
Is used by the generated class to retrieve the values for a single row.
|
String |
getName()
Returns the qualified name of this table.
|
protected void |
init() |
void |
initFromXml(InputStream is,
IRuntimeRepository productRepository,
String qualifiedTableName)
Initializes this object with the data stored in the XML element.
|
protected abstract void |
initKeyMaps()
Is used by the generated classes to build up the the maps and trees that are used by the also
generated find-methods.
|
protected boolean |
isNull(Element valueElement)
Is used by generated classes within the initKeyMaps() method to identify a null values.
|
protected void |
performAdditionalInitializations()
Template method to perform additional initializations.
|
String |
toString()
Returns the String representation of up to ten of this table's rows.
|
protected abstract void addRow(List<String> columns, IRuntimeRepository productRepository)
columns - List of objects that contain the values.protected abstract void initKeyMaps()
public void initFromXml(InputStream is, IRuntimeRepository productRepository, String qualifiedTableName) throws Exception
Exceptionprotected void init()
protected void performAdditionalInitializations()
initKeyMaps().
Subclasses may override to provide an implementation. The default implementation is empty, so no super-call is necessary.
protected boolean isNull(Element valueElement)
valueElement - the element that contains the value for a field within a rowpublic String toString()
Copyright © 2016. All rights reserved.