Class SparseSegmentBody

  • All Implemented Interfaces:
    java.io.Serializable, SegmentBody

    class SparseSegmentBody
    extends AbstractSegmentBody
    Implementation of a segment body which stores the data of a sparse segment data set into a dense array of java objects.
    Author:
    LBoudreau
    • Field Detail

      • data

        final java.lang.Object[] data
    • Constructor Detail

      • SparseSegmentBody

        SparseSegmentBody​(java.util.Map<CellKey,​java.lang.Object> dataToSave,
                          java.util.List<Pair<java.util.SortedSet<java.lang.Comparable>,​java.lang.Boolean>> axes)
    • Method Detail

      • getSize

        protected int getSize()
        Description copied from class: AbstractSegmentBody
        Returns the overall amount of stored elements, including those, that are considered to be null.
        Specified by:
        getSize in class AbstractSegmentBody
        Returns:
        the size of stored data
      • getValueMap

        public java.util.Map<CellKey,​java.lang.Object> getValueMap()
        Description copied from interface: SegmentBody
        Converts contents of this segment into a cellkey/value map. Use only for sparse segments.
        Specified by:
        getValueMap in interface SegmentBody
        Overrides:
        getValueMap in class AbstractSegmentBody
        Returns:
        Map containing cell values keyed by their coordinates