Package net.splitcells.gel.data.database
Class DatabaseIRef
- java.lang.Object
-
- net.splitcells.gel.data.database.DatabaseI
-
- net.splitcells.gel.data.database.DatabaseIRef
-
- All Implemented Interfaces:
net.splitcells.dem.lang.dom.Domable
,net.splitcells.dem.object.Discoverable
,Database
,Table
public class DatabaseIRef extends DatabaseI
TODO Make this an aspect in order to make it usable for other implementations ofDatabase
. TODO Require the usage of a non empty name during construction. TODO Invalidate Lines pointing to an index where values are already replaced. TODO PERFORMANCE Abstract Database implementation with generic storage in order to simplify implementation and maintenance row and column based Databases. TODO Test consistency of meta data. TODO IDEA Implement Java collection interface.
-
-
Field Summary
-
Fields inherited from class net.splitcells.gel.data.database.DatabaseI
additionSubscriber, afterRemovalSubscriber, attributes, attributes2, beforeRemovalSubscriber, columns, indexesOfFree, lines, name, parent, rawLines, rawLinesView, size, typed_column_index
-
Fields inherited from interface net.splitcells.gel.data.table.Table
GET_LINE_VIA_STREAM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DatabaseIRef(String name, net.splitcells.dem.object.Discoverable parent, net.splitcells.dem.data.set.list.List<Attribute<Object>> header)
protected
DatabaseIRef(String name, net.splitcells.dem.object.Discoverable parent, Attribute<? extends Object>... header)
protected
DatabaseIRef(net.splitcells.dem.data.set.list.List<Attribute<?>> header, Collection<net.splitcells.dem.data.set.list.List<Object>> linesValues)
Deprecated.protected
DatabaseIRef(net.splitcells.dem.data.set.list.List<Attribute<? extends Object>> attribute)
Deprecated.protected
DatabaseIRef(Attribute<?>... header)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Line
add(Line line)
TODO PERFORMANCE No copies have to be created, as it is guaranteed that a Line does not change its content during its life cycle.Line
addTranslated(net.splitcells.dem.data.set.list.List<? extends Object> lineValues)
TODO REMOVE Code duplication ofaddTranslated(net.splitcells.dem.data.set.list.List<java.lang.Object>, int)
methods.protected Line
addTranslated(net.splitcells.dem.data.set.list.List<Object> lineValues, int index)
<T> ColumnView<T>
columnView(Attribute<T> attribute)
TODO PERFORMANCE Cache list views in Order to minimize number of objects.void
remove(int lineIndex)
void
remove(Line line)
-
Methods inherited from class net.splitcells.gel.data.database.DatabaseI
columnsView, extend_content_to, headerView, headerView2, linesStream, lookupEquals, path, query, rawLines, rawLinesView, size, subscribeToAfterAdditions, subscribeToAfterRemoval, subscribeToBeforeRemoval, toDom, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.splitcells.gel.data.database.Database
replace, synchronize
-
Methods inherited from interface net.splitcells.gel.data.table.Table
contains, distinctLines, distinctLineValues, hasContent, isEmpty, isPresent, line, lines, lookup, lookupEquals, rawLine, toCSV, toFods, toHtmlTable
-
-
-
-
Constructor Detail
-
DatabaseIRef
@Deprecated protected DatabaseIRef(net.splitcells.dem.data.set.list.List<Attribute<? extends Object>> attribute)
Deprecated.
-
DatabaseIRef
protected DatabaseIRef(String name, net.splitcells.dem.object.Discoverable parent, net.splitcells.dem.data.set.list.List<Attribute<Object>> header)
-
DatabaseIRef
@Deprecated protected DatabaseIRef(net.splitcells.dem.data.set.list.List<Attribute<?>> header, Collection<net.splitcells.dem.data.set.list.List<Object>> linesValues)
Deprecated.
-
DatabaseIRef
protected DatabaseIRef(String name, net.splitcells.dem.object.Discoverable parent, Attribute<? extends Object>... header)
-
DatabaseIRef
@Deprecated protected DatabaseIRef(Attribute<?>... header)
Deprecated.
-
-
Method Detail
-
columnView
public <T> ColumnView<T> columnView(Attribute<T> attribute)
TODO PERFORMANCE Cache list views in Order to minimize number of objects. TODO Return an unmodifiable view of the column.- Specified by:
columnView
in interfaceTable
- Overrides:
columnView
in classDatabaseI
- Type Parameters:
T
-- Parameters:
attribute
-- Returns:
-
add
public Line add(Line line)
TODO PERFORMANCE No copies have to be created, as it is guaranteed that a Line does not change its content during its life cycle. This is important for constraints. TODO Test whether the line is added to the correct place. TODO FIX Why does List> not work? TODO PERFORMANCE Reduce the high number of copies.
-
addTranslated
protected Line addTranslated(net.splitcells.dem.data.set.list.List<Object> lineValues, int index)
- Overrides:
addTranslated
in classDatabaseI
- Parameters:
lineValues
- TODO SupportDomable.toDom()
for logging.
-
addTranslated
public Line addTranslated(net.splitcells.dem.data.set.list.List<? extends Object> lineValues)
TODO REMOVE Code duplication ofaddTranslated(net.splitcells.dem.data.set.list.List<java.lang.Object>, int)
methods.- Specified by:
addTranslated
in interfaceDatabase
- Overrides:
addTranslated
in classDatabaseI
-
remove
public void remove(int lineIndex)
-
-