Class DataManager<T extends org.deckfour.xes.model.XAttributable>

    • Field Detail

      • FACTORY

        protected static final org.deckfour.xes.factory.XFactory FACTORY
      • key2index

        protected final gnu.trove.map.TObjectIntMap<Attribute> key2index
      • type2count

        protected int[] type2count
      • usedBytesPerObject

        protected int usedBytesPerObject
      • bytesReservedPerObject

        protected int bytesReservedPerObject
      • blockSize

        protected int blockSize
      • blocks

        protected int blocks
      • store

        protected byte[][] store
      • numberOfObjects

        protected int numberOfObjects
      • headerSize

        protected final int headerSize
      • handlesEventAttributes

        protected final boolean handlesEventAttributes
      • shift

        protected int shift
      • mask

        protected int mask
    • Constructor Detail

      • DataManager

        public DataManager​(DataManager.StringHandler stringHandler,
                           java.util.Collection<org.deckfour.xes.model.XAttribute> attributes,
                           gnu.trove.map.TObjectIntMap<java.lang.String> lit2index,
                           int preferredBlockSize,
                           int headerSize,
                           boolean handlesEventAttributes)
    • Method Detail

      • getAttributeValueBoolean

        public boolean getAttributeValueBoolean​(int object,
                                                Attribute key)
      • getAttributeValueBoolean

        public boolean getAttributeValueBoolean​(int object,
                                                int attrIndex)
      • getAttributeValueDiscrete

        public long getAttributeValueDiscrete​(int object,
                                              Attribute key)
      • getAttributeValueDiscrete

        public long getAttributeValueDiscrete​(int object,
                                              int attrIndex)
      • getAttributeValueContinuous

        public double getAttributeValueContinuous​(int object,
                                                  Attribute key)
      • getAttributeValueContinuous

        public double getAttributeValueContinuous​(int object,
                                                  int attrIndex)
      • getAttributeValueTimestamp

        public long getAttributeValueTimestamp​(int object,
                                               Attribute key)
      • getAttributeValueTimestamp

        public long getAttributeValueTimestamp​(int object,
                                               int attrIndex)
      • getAttributeValueLiteral

        public java.lang.String getAttributeValueLiteral​(int object,
                                                         Attribute key)
      • getAttributeValueLiteral

        public java.lang.String getAttributeValueLiteral​(int object,
                                                         int attrIndex)
      • getAttributeValueLiteralIndex

        public int getAttributeValueLiteralIndex​(int object,
                                                 Attribute key)
      • getAttributeValueLiteralIndex

        public int getAttributeValueLiteralIndex​(int object,
                                                 int attrIndex)
      • writeInt

        protected int writeInt​(byte[] array,
                               int index,
                               int value)
      • readInt

        protected int readInt​(byte[] array,
                              int index)
      • writeShort

        protected int writeShort​(byte[] array,
                                 int index,
                                 short value)
      • readShort

        protected short readShort​(byte[] array,
                                  int index)
      • writeBoolean

        protected int writeBoolean​(byte[] array,
                                   int index,
                                   boolean value)
      • readBoolean

        protected boolean readBoolean​(byte[] array,
                                      int index)
      • writeLong

        protected int writeLong​(byte[] array,
                                int index,
                                long value)
      • readLong

        protected long readLong​(byte[] array,
                                int index)
      • writeDouble

        protected int writeDouble​(byte[] array,
                                  int index,
                                  double value)
      • readDouble

        protected double readDouble​(byte[] array,
                                    int index)
      • buildAttributeIndices

        protected int buildAttributeIndices​(java.util.Collection<? extends org.deckfour.xes.model.XAttribute> attributes,
                                            int index,
                                            gnu.trove.map.TObjectIntMap<Attribute> key2index,
                                            int[] key2count,
                                            gnu.trove.map.TObjectIntMap<java.lang.String> lit2index)
      • checkSizeForInsertion

        protected void checkSizeForInsertion()
      • addObject

        public void addObject​(T object,
                              gnu.trove.map.TObjectIntMap<java.lang.String> lit2index,
                              java.util.Set<java.lang.String> errorKeys,
                              int... headerData)
      • updateHeader

        public void updateHeader​(int number,
                                 int... headerData)
      • readObject

        public T readObject​(int number)
      • readObjectFromBlock

        protected abstract T readObjectFromBlock​(byte[] block,
                                                 int number,
                                                 boolean forAddingAttributes)
      • writeAttributeContents

        protected int writeAttributeContents​(org.deckfour.xes.model.XAttributeMap attributes,
                                             byte[] storage,
                                             int ptr,
                                             int keyIndex,
                                             gnu.trove.map.TObjectIntMap<Attribute> key2Index,
                                             gnu.trove.map.TObjectIntMap<java.lang.String> lit2index,
                                             java.util.Set<java.lang.String> errorKeys)
      • getKeysSortedByIndex

        public Attribute[] getKeysSortedByIndex()
        returns a sorted list of attribute keys. The list is sorted based on the index in the array used to store event data.
        Returns:
      • getKeysSortedAlphabetically

        public Attribute[] getKeysSortedAlphabetically()
        returns a sorted list of attribute keys. The list is sorted based on the index in the array used to store event data.
        Returns:
      • getKeys

        public Attribute[] getKeys()
        returns a list of global keys. The list is sorted.
        Returns:
      • getKeySortedByIndex

        public Attribute[] getKeySortedByIndex​(byte type)
        returns a sorted list of attribute keys of type type. The list is sorted based on the index in the array used to store data.
        Returns:
      • getKeysSortedAlphabetically

        public Attribute[] getKeysSortedAlphabetically​(byte type)
        returns a sorted list of attribute keys of type type. The list is sorted based on the index in the array used to store data.
        Returns:
      • getKeyIndices

        public int[] getKeyIndices()
      • getKeyIndices

        public int[] getKeyIndices​(byte type)
      • getAttribute

        public org.deckfour.xes.model.XAttribute getAttribute​(int number,
                                                              Attribute attribute,
                                                              java.util.Map<java.lang.String,​org.deckfour.xes.extension.XExtension> key2extension)
      • readAttributeIntoScope

        protected void readAttributeIntoScope​(Attribute[] globalKeys,
                                              int ptr,
                                              byte[] storage,
                                              int keyIndex,
                                              org.deckfour.xes.model.XAttributeMap attributes,
                                              java.util.Map<java.lang.String,​org.deckfour.xes.extension.XExtension> key2extension,
                                              boolean forAddingAttributes)
      • getHeader

        public int getHeader​(int number,
                             int headerIndex)
      • isType

        public boolean isType​(Attribute key,
                              byte type)
      • getAttributeValueIndicesLiteral

        public int[] getAttributeValueIndicesLiteral​(Attribute attribute,
                                                     boolean sort)
      • getAttributeValuesLiteral

        public java.lang.String[] getAttributeValuesLiteral​(Attribute attribute,
                                                            int[] indices)
      • getAttributeValuesLiteral

        public java.lang.String[] getAttributeValuesLiteral​(Attribute attribute,
                                                            boolean sort)
      • getAttributeValuesDiscrete

        public long[] getAttributeValuesDiscrete​(Attribute attribute,
                                                 boolean sort)
      • getAttributeValuesTimestamp

        public long[] getAttributeValuesTimestamp​(Attribute attribute,
                                                  boolean sort)
      • getAttributeValuesContinuous

        public double[] getAttributeValuesContinuous​(Attribute attribute,
                                                     boolean sort)
      • getAttributeValuesBoolean

        public boolean[] getAttributeValuesBoolean​(Attribute attribute,
                                                   boolean sort)
      • addAttributes

        public void addAttributes​(DataManager.AttributeValueCalculator<T> calculator,
                                  Attribute... newAttribute)
        adds an attribute to each object in the store. The calculator computes the value of the attribute for each object.
        Parameters:
        calculator - Objects will be given to the calculator in the order in which they appeared in the original log
        newAttribute - the new attributes to be added to each object (a default value is not provided since the calculator returns a result for each event)
      • containsKey

        public boolean containsKey​(Attribute key)
      • getObjectCount

        public int getObjectCount()
      • getKeyIndex

        public int getKeyIndex​(Attribute attribute)
      • swap

        public void swap​(int index1,
                         int index2)
      • toString

        public java.lang.String toString​(int number)
      • getAttributeForKey

        public Attribute getAttributeForKey​(java.lang.String attribute)
      • getObjectByteSize

        public int getObjectByteSize()
      • getBytes

        public byte[] getBytes​(Attribute attribute,
                               int number)
      • getBytes

        public byte[] getBytes​(int index,
                               int length,
                               int number)
      • countValuesLiteral

        public int countValuesLiteral​(int attributeIndex,
                                      java.lang.String s)