public abstract class DataManager<T extends org.deckfour.xes.model.XAttributable>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
DataManager.AttributeValueCalculator<T extends org.deckfour.xes.model.XAttributable>
Utility class to add attributes to all objects.
|
static interface |
DataManager.StringHandler |
Modifier and Type | Field and Description |
---|---|
protected int |
blocks |
protected int |
blockSize |
protected int |
bytesReservedPerObject |
protected static org.deckfour.xes.factory.XFactory |
FACTORY |
protected boolean |
handlesEventAttributes |
protected int |
headerSize |
protected gnu.trove.map.TObjectIntMap<Attribute> |
key2index |
protected Attribute[] |
keys |
protected int |
mask |
protected static long |
MAXHASH |
protected int |
numberOfObjects |
protected int |
shift |
protected byte[][] |
store |
protected DataManager.StringHandler |
stringHandler |
protected int[] |
type2count |
protected int |
usedBytesPerObject |
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
void |
addAttributes(DataManager.AttributeValueCalculator<T> calculator,
Attribute... newAttribute)
adds an attribute to each object in the store.
|
void |
addObject(T object,
gnu.trove.map.TObjectIntMap<java.lang.String> lit2index,
java.util.Set<java.lang.String> errorKeys,
int... headerData) |
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) |
protected void |
checkSizeForInsertion() |
boolean |
containsKey(Attribute key) |
int |
countValuesLiteral(int attributeIndex,
java.lang.String s) |
org.deckfour.xes.model.XAttribute |
getAttribute(int number,
Attribute attribute,
java.util.Map<java.lang.String,org.deckfour.xes.extension.XExtension> key2extension) |
Attribute |
getAttributeForKey(java.lang.String attribute) |
boolean |
getAttributeValueBoolean(int object,
Attribute key) |
boolean |
getAttributeValueBoolean(int object,
int attrIndex) |
double |
getAttributeValueContinuous(int object,
Attribute key) |
double |
getAttributeValueContinuous(int object,
int attrIndex) |
long |
getAttributeValueDiscrete(int object,
Attribute key) |
long |
getAttributeValueDiscrete(int object,
int attrIndex) |
int[] |
getAttributeValueIndicesLiteral(Attribute attribute,
boolean sort) |
java.lang.String |
getAttributeValueLiteral(int object,
Attribute key) |
java.lang.String |
getAttributeValueLiteral(int object,
int attrIndex) |
int |
getAttributeValueLiteralIndex(int object,
Attribute key) |
int |
getAttributeValueLiteralIndex(int object,
int attrIndex) |
boolean[] |
getAttributeValuesBoolean(Attribute attribute,
boolean sort) |
double[] |
getAttributeValuesContinuous(Attribute attribute,
boolean sort) |
long[] |
getAttributeValuesDiscrete(Attribute attribute,
boolean sort) |
java.lang.String[] |
getAttributeValuesLiteral(Attribute attribute,
boolean sort) |
java.lang.String[] |
getAttributeValuesLiteral(Attribute attribute,
int[] indices) |
long[] |
getAttributeValuesTimestamp(Attribute attribute,
boolean sort) |
long |
getAttributeValueTimestamp(int object,
Attribute key) |
long |
getAttributeValueTimestamp(int object,
int attrIndex) |
byte[] |
getBytes(Attribute attribute,
int number) |
byte[] |
getBytes(int index,
int length,
int number) |
int |
getHeader(int number,
int headerIndex) |
Histogram.Double |
getHistogramContinuous(Attribute attribute,
Statistics.Double s,
int buckets) |
Histogram.Long |
getHistogramDiscrete(Attribute attribute,
Statistics.Long s,
int buckets) |
Histogram.Long |
getHistogramTimestamp(Attribute attribute,
Statistics.Long s,
int buckets) |
int |
getKeyIndex(Attribute attribute) |
int[] |
getKeyIndices() |
int[] |
getKeyIndices(byte type) |
Attribute[] |
getKeys()
returns a list of global keys.
|
Attribute[] |
getKeySortedByIndex(byte type)
returns a sorted list of attribute keys of type type.
|
Attribute[] |
getKeysSortedAlphabetically()
returns a sorted list of attribute keys.
|
Attribute[] |
getKeysSortedAlphabetically(byte type)
returns a sorted list of attribute keys of type type.
|
Attribute[] |
getKeysSortedByIndex()
returns a sorted list of attribute keys.
|
int |
getObjectByteSize() |
int |
getObjectCount() |
Statistics.Double |
getStatisticsContinuous(Attribute attribute) |
Statistics.Long |
getStatisticsDiscrete(Attribute attribute) |
Statistics.Long |
getStatisticsTimestamp(Attribute attribute) |
DataManager.StringHandler |
getStringHandler() |
boolean |
isType(Attribute key,
byte type) |
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) |
protected boolean |
readBoolean(byte[] array,
int index) |
protected double |
readDouble(byte[] array,
int index) |
protected int |
readInt(byte[] array,
int index) |
protected long |
readLong(byte[] array,
int index) |
T |
readObject(int number) |
protected abstract T |
readObjectFromBlock(byte[] block,
int number,
boolean forAddingAttributes) |
protected short |
readShort(byte[] array,
int index) |
void |
swap(int index1,
int index2) |
java.lang.String |
toString(int number) |
void |
updateHeader(int number,
int... headerData) |
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) |
protected int |
writeBoolean(byte[] array,
int index,
boolean value) |
protected int |
writeDouble(byte[] array,
int index,
double value) |
protected int |
writeInt(byte[] array,
int index,
int value) |
protected int |
writeLong(byte[] array,
int index,
long value) |
protected int |
writeShort(byte[] array,
int index,
short value) |
protected static final long MAXHASH
protected static final org.deckfour.xes.factory.XFactory FACTORY
protected DataManager.StringHandler stringHandler
protected final gnu.trove.map.TObjectIntMap<Attribute> key2index
protected Attribute[] keys
protected int[] type2count
protected int usedBytesPerObject
protected int bytesReservedPerObject
protected int blockSize
protected int blocks
protected byte[][] store
protected int numberOfObjects
protected final int headerSize
protected final boolean handlesEventAttributes
protected int shift
protected int mask
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)
public boolean getAttributeValueBoolean(int object, Attribute key)
public boolean getAttributeValueBoolean(int object, int attrIndex)
public long getAttributeValueDiscrete(int object, Attribute key)
public long getAttributeValueDiscrete(int object, int attrIndex)
public double getAttributeValueContinuous(int object, Attribute key)
public double getAttributeValueContinuous(int object, int attrIndex)
public long getAttributeValueTimestamp(int object, Attribute key)
public long getAttributeValueTimestamp(int object, int attrIndex)
public java.lang.String getAttributeValueLiteral(int object, Attribute key)
public java.lang.String getAttributeValueLiteral(int object, int attrIndex)
public int getAttributeValueLiteralIndex(int object, Attribute key)
public int getAttributeValueLiteralIndex(int object, int attrIndex)
protected int writeInt(byte[] array, int index, int value)
protected int readInt(byte[] array, int index)
protected int writeShort(byte[] array, int index, short value)
protected short readShort(byte[] array, int index)
protected int writeBoolean(byte[] array, int index, boolean value)
protected boolean readBoolean(byte[] array, int index)
protected int writeLong(byte[] array, int index, long value)
protected long readLong(byte[] array, int index)
protected int writeDouble(byte[] array, int index, double value)
protected double readDouble(byte[] array, int index)
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)
protected void checkSizeForInsertion()
public void addObject(T object, gnu.trove.map.TObjectIntMap<java.lang.String> lit2index, java.util.Set<java.lang.String> errorKeys, int... headerData)
public void updateHeader(int number, int... headerData)
public T readObject(int number)
protected abstract T readObjectFromBlock(byte[] block, int number, boolean forAddingAttributes)
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)
public Attribute[] getKeysSortedByIndex()
public Attribute[] getKeysSortedAlphabetically()
public Attribute[] getKeys()
public Attribute[] getKeySortedByIndex(byte type)
public Attribute[] getKeysSortedAlphabetically(byte type)
public int[] getKeyIndices()
public int[] getKeyIndices(byte type)
public org.deckfour.xes.model.XAttribute getAttribute(int number, Attribute attribute, java.util.Map<java.lang.String,org.deckfour.xes.extension.XExtension> key2extension)
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)
public int getHeader(int number, int headerIndex)
public boolean isType(Attribute key, byte type)
public Statistics.Long getStatisticsDiscrete(Attribute attribute)
public Statistics.Double getStatisticsContinuous(Attribute attribute)
public Statistics.Long getStatisticsTimestamp(Attribute attribute)
public Histogram.Long getHistogramTimestamp(Attribute attribute, Statistics.Long s, int buckets)
public Histogram.Long getHistogramDiscrete(Attribute attribute, Statistics.Long s, int buckets)
public Histogram.Double getHistogramContinuous(Attribute attribute, Statistics.Double s, int buckets)
public int[] getAttributeValueIndicesLiteral(Attribute attribute, boolean sort)
public java.lang.String[] getAttributeValuesLiteral(Attribute attribute, int[] indices)
public java.lang.String[] getAttributeValuesLiteral(Attribute attribute, boolean sort)
public long[] getAttributeValuesDiscrete(Attribute attribute, boolean sort)
public long[] getAttributeValuesTimestamp(Attribute attribute, boolean sort)
public double[] getAttributeValuesContinuous(Attribute attribute, boolean sort)
public boolean[] getAttributeValuesBoolean(Attribute attribute, boolean sort)
public void addAttributes(DataManager.AttributeValueCalculator<T> calculator, Attribute... newAttribute)
calculator
- Objects will be given to the calculator in the order in which
they appeared in the original lognewAttribute
- the new attributes to be added to each object (a default value
is not provided since the calculator returns a result for each
event)public boolean containsKey(Attribute key)
public int getObjectCount()
public int getKeyIndex(Attribute attribute)
public void swap(int index1, int index2)
public DataManager.StringHandler getStringHandler()
public java.lang.String toString(int number)
public Attribute getAttributeForKey(java.lang.String attribute)
public int getObjectByteSize()
public byte[] getBytes(Attribute attribute, int number)
public byte[] getBytes(int index, int length, int number)
public int countValuesLiteral(int attributeIndex, java.lang.String s)