public class Dictionary extends ADictionary
| Constructor and Description |
|---|
Dictionary(double[] values) |
| Modifier and Type | Method and Description |
|---|---|
double |
aggregate(double init,
Builtin fn)
Aggregate all the contained values, useful in value only computations where the operation is iterating through
all values contained in the dictionary.
|
Dictionary |
apply(ScalarOperator op)
Applies the scalar operation on the dictionary.
|
Dictionary |
applyScalarOp(ScalarOperator op,
double newVal,
int numCols)
Applies the scalar operation on the dictionary.
|
Dictionary |
clone()
Returns a deep clone of the dictionary.
|
long |
getExactSizeOnDisk()
Calculate the space consumption if the dictionary is stored on disk.
|
long |
getInMemorySize()
Returns the memory usage of the dictionary.
|
int |
getNumberOfValues(int ncol)
Get the number of values given that the column group has n columns
|
double |
getValue(int i)
Get Specific value contained in the dictionary at index.
|
double[] |
getValues()
Get all the values contained in the dictionary as a linearized double array.
|
int |
getValuesLength()
returns the count of values contained in the dictionary.
|
int |
hasZeroTuple(int ncol)
Determines if the content has a zero tuple.
|
static Dictionary |
read(DataInput in) |
void |
write(DataOutput out)
Write the dictionary to a DataOutput.
|
aggregateCols, readpublic double[] getValues()
ADictionarygetValues in class ADictionarypublic double getValue(int i)
ADictionarygetValue in class ADictionaryi - The index to extract the value frompublic long getInMemorySize()
ADictionarygetInMemorySize in class ADictionarypublic int hasZeroTuple(int ncol)
ADictionaryhasZeroTuple in class ADictionaryncol - The number of columns in the dictionary.public double aggregate(double init,
Builtin fn)
ADictionaryaggregate in class ADictionaryinit - The initial Value, in cases such as Max value, this could be -infinityfn - The Function to apply to valuespublic Dictionary apply(ScalarOperator op)
ADictionaryapply in class ADictionaryop - The operator to apply to the dictionary values.public Dictionary applyScalarOp(ScalarOperator op, double newVal, int numCols)
ADictionaryapplyScalarOp in class ADictionaryop - The operator to apply to the dictionary values.newVal - The value to append to the dictionary.numCols - The number of columns stored in the dictionary.public Dictionary clone()
ADictionaryclone in class ADictionarypublic int getValuesLength()
ADictionarygetValuesLength in class ADictionarypublic static Dictionary read(DataInput in) throws IOException
IOExceptionpublic void write(DataOutput out) throws IOException
ADictionarywrite in class ADictionaryout - the output sink to write the dictionary to.IOException - if the sink fails.public long getExactSizeOnDisk()
ADictionarygetExactSizeOnDisk in class ADictionarypublic int getNumberOfValues(int ncol)
ADictionarygetNumberOfValues in class ADictionaryncol - The number of Columns in the ColumnGroup.Copyright © 2020 The Apache Software Foundation. All rights reserved.