Class 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 of Database.

    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.

    • 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)
    • 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 interface Table
        Overrides:
        columnView in class DatabaseI
        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.

        Specified by:
        add in interface Database
        Overrides:
        add in class DatabaseI
        Parameters:
        line -
        Returns:
      • addTranslated

        protected Line addTranslated​(net.splitcells.dem.data.set.list.List<Object> lineValues,
                                     int index)
        Overrides:
        addTranslated in class DatabaseI
        Parameters:
        lineValues - TODO Support Domable.toDom() for logging.