Package com.illumon.iris.db.v2
Class IndexedDataColumn<TYPE>
java.lang.Object
com.illumon.iris.db.v2.IndexedDataColumn<TYPE>
- All Implemented Interfaces:
DataColumn<TYPE>
,LongSizedDataStructure
public class IndexedDataColumn<TYPE> extends Object implements DataColumn<TYPE>
DataColumn implementation backed by a ColumnSource and an Index.
-
Constructor Summary
Constructors Constructor Description IndexedDataColumn(String name, Table table)
IndexedDataColumn(String name, Index index, ColumnSource<TYPE> columnSource)
-
Method Summary
Modifier and Type Method Description TYPE[]
get(int... positions)
Return the column's values for the specified rows.TYPE
get(long pos)
Returns the value in the column at the row designated by the indexTYPE[]
get(long... positions)
Return the column's values for the specified rows.TYPE[]
get(long startPosInclusive, long endPosExclusive)
Return the column's values for the specified row range.Boolean
getBoolean(long pos)
Boolean[]
getBooleans(int... positions)
Boolean[]
getBooleans(long... positions)
Boolean[]
getBooleans(long startPosInclusive, long endPosExclusive)
byte
getByte(long pos)
byte[]
getBytes(int... positions)
byte[]
getBytes(long... positions)
byte[]
getBytes(long startPosInclusive, long endPosExclusive)
char
getChar(long pos)
char[]
getChars(int... positions)
char[]
getChars(long... positions)
char[]
getChars(long startPosInclusive, long endPosExclusive)
Class
getComponentType()
Get the array component type, or the type itself.double
getDouble(long pos)
double[]
getDoubles(int... positions)
double[]
getDoubles(long... positions)
double[]
getDoubles(long startPosInclusive, long endPosExclusive)
float
getFloat(long pos)
float[]
getFloats(int... positions)
float[]
getFloats(long... positions)
float[]
getFloats(long startPosInclusive, long endPosExclusive)
int
getInt(long pos)
int[]
getInts(int... positions)
int[]
getInts(long... positions)
int[]
getInts(long startPosInclusive, long endPosExclusive)
long
getLong(long pos)
long[]
getLongs(int... positions)
long[]
getLongs(long... positions)
long[]
getLongs(long startPosInclusive, long endPosExclusive)
String
getName()
short
getShort(long pos)
short[]
getShorts(int... positions)
short[]
getShorts(long... positions)
short[]
getShorts(long startPosInclusive, long endPosExclusive)
Class<TYPE>
getType()
static <TYPE> IndexedDataColumn<TYPE>
makePreviousColumn(Index index, ColumnSource<TYPE> columnSource)
This is intended as a unit test helper.void
set(long pos, TYPE value)
void
setArray(long startPos, TYPE... values)
void
setBoolean(long pos, Boolean value)
void
setBooleans(long startPos, Boolean... values)
void
setByte(long pos, byte value)
void
setBytes(long startPos, byte... values)
void
setChar(long pos, char value)
void
setChars(long startPos, char... values)
void
setDouble(long pos, double value)
void
setDoubles(long startPos, double... values)
void
setFloat(long pos, float value)
void
setFloats(long startPos, float... values)
void
setInt(long pos, int value)
void
setInts(long startPos, int... values)
void
setLong(long pos, long value)
void
setLongs(long startPos, long... values)
void
setShort(long pos, short value)
void
setShorts(long startPos, short... values)
long
size()
The size of this data structure.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
IndexedDataColumn
-
IndexedDataColumn
public IndexedDataColumn(@NotNull String name, @NotNull Index index, @NotNull ColumnSource<TYPE> columnSource)
-
-
Method Details
-
makePreviousColumn
public static <TYPE> IndexedDataColumn<TYPE> makePreviousColumn(@NotNull Index index, @NotNull ColumnSource<TYPE> columnSource)This is intended as a unit test helper. It is not recommended for inexpert use.- Parameters:
index
- The indexcolumnSource
- The column source- Returns:
- A data column with previous values for the supplied column source, according to the previous version of the index
-
getName
- Specified by:
getName
in interfaceDataColumn<TYPE>
-
getType
- Specified by:
getType
in interfaceDataColumn<TYPE>
- Returns:
- the type of object contained within this column.
-
getComponentType
Description copied from interface:DataColumn
Get the array component type, or the type itself. For basic types, this is just the type. For example, if you have a column of java.lang.String, this also returns java.lang.String. For array types (java Arrays), or DbArray (which would be returned by getType), you get the type that is contained within the array. For example, if a single row in this column contains a DbDoubleArray, getComponentType returns double.- Specified by:
getComponentType
in interfaceDataColumn<TYPE>
- Returns:
- if type is an array, the type of object within the array. Otherwise type itself.
-
size
public long size()Description copied from interface:LongSizedDataStructure
The size of this data structure.- Specified by:
size
in interfaceLongSizedDataStructure
- Returns:
- The size
-
get
Description copied from interface:DataColumn
Returns the value in the column at the row designated by the index- Specified by:
get
in interfaceDataColumn<TYPE>
- Parameters:
pos
- - the index of the row for which the data is being retrieved- Returns:
- the value in the column at the row designated by the index
-
get
Description copied from interface:DataColumn
Return the column's values for the specified row range. Note that this will be a boxed array, for data columns of primitive types.- Specified by:
get
in interfaceDataColumn<TYPE>
- Parameters:
startPosInclusive
- The first position in the data column to include, inclusiveendPosExclusive
- One more than the last position in the data column to include- Returns:
- Return the column's values for the specified row range
-
get
Description copied from interface:DataColumn
Return the column's values for the specified rows. Note that this will be a boxed array, for data columns of primitive types.- Specified by:
get
in interfaceDataColumn<TYPE>
- Parameters:
positions
- The row indexes to fetch- Returns:
- Return the column's values for the specified rows
-
get
Description copied from interface:DataColumn
Return the column's values for the specified rows. Note that this will be a boxed array, for data columns of primitive types.- Specified by:
get
in interfaceDataColumn<TYPE>
- Parameters:
positions
- The row indexes to fetch- Returns:
- Return the column's values for the specified rows
-
getBoolean
- Specified by:
getBoolean
in interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleans
in interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleans
in interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleans
in interfaceDataColumn<TYPE>
-
getByte
public byte getByte(long pos)- Specified by:
getByte
in interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(long startPosInclusive, long endPosExclusive)- Specified by:
getBytes
in interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(long... positions)- Specified by:
getBytes
in interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(int... positions)- Specified by:
getBytes
in interfaceDataColumn<TYPE>
-
getChar
public char getChar(long pos)- Specified by:
getChar
in interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(long startPosInclusive, long endPosExclusive)- Specified by:
getChars
in interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(long... positions)- Specified by:
getChars
in interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(int... positions)- Specified by:
getChars
in interfaceDataColumn<TYPE>
-
getDouble
public double getDouble(long pos)- Specified by:
getDouble
in interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(long startPosInclusive, long endPosExclusive)- Specified by:
getDoubles
in interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(long... positions)- Specified by:
getDoubles
in interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(int... positions)- Specified by:
getDoubles
in interfaceDataColumn<TYPE>
-
getFloat
public float getFloat(long pos)- Specified by:
getFloat
in interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(long startPosInclusive, long endPosExclusive)- Specified by:
getFloats
in interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(long... positions)- Specified by:
getFloats
in interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(int... positions)- Specified by:
getFloats
in interfaceDataColumn<TYPE>
-
getInt
public int getInt(long pos)- Specified by:
getInt
in interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(long startPosInclusive, long endPosExclusive)- Specified by:
getInts
in interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(long... positions)- Specified by:
getInts
in interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(int... positions)- Specified by:
getInts
in interfaceDataColumn<TYPE>
-
getLong
public long getLong(long pos)- Specified by:
getLong
in interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(long startPosInclusive, long endPosExclusive)- Specified by:
getLongs
in interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(long... positions)- Specified by:
getLongs
in interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(int... positions)- Specified by:
getLongs
in interfaceDataColumn<TYPE>
-
getShort
public short getShort(long pos)- Specified by:
getShort
in interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(long startPosInclusive, long endPosExclusive)- Specified by:
getShorts
in interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(long... positions)- Specified by:
getShorts
in interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(int... positions)- Specified by:
getShorts
in interfaceDataColumn<TYPE>
-
set
- Specified by:
set
in interfaceDataColumn<TYPE>
-
setArray
- Specified by:
setArray
in interfaceDataColumn<TYPE>
-
setBoolean
- Specified by:
setBoolean
in interfaceDataColumn<TYPE>
-
setBooleans
- Specified by:
setBooleans
in interfaceDataColumn<TYPE>
-
setByte
public void setByte(long pos, byte value)- Specified by:
setByte
in interfaceDataColumn<TYPE>
-
setBytes
public void setBytes(long startPos, byte... values)- Specified by:
setBytes
in interfaceDataColumn<TYPE>
-
setChar
public void setChar(long pos, char value)- Specified by:
setChar
in interfaceDataColumn<TYPE>
-
setChars
public void setChars(long startPos, char... values)- Specified by:
setChars
in interfaceDataColumn<TYPE>
-
setDouble
public void setDouble(long pos, double value)- Specified by:
setDouble
in interfaceDataColumn<TYPE>
-
setDoubles
public void setDoubles(long startPos, double... values)- Specified by:
setDoubles
in interfaceDataColumn<TYPE>
-
setFloat
public void setFloat(long pos, float value)- Specified by:
setFloat
in interfaceDataColumn<TYPE>
-
setFloats
public void setFloats(long startPos, float... values)- Specified by:
setFloats
in interfaceDataColumn<TYPE>
-
setInt
public void setInt(long pos, int value)- Specified by:
setInt
in interfaceDataColumn<TYPE>
-
setInts
public void setInts(long startPos, int... values)- Specified by:
setInts
in interfaceDataColumn<TYPE>
-
setLong
public void setLong(long pos, long value)- Specified by:
setLong
in interfaceDataColumn<TYPE>
-
setLongs
public void setLongs(long startPos, long... values)- Specified by:
setLongs
in interfaceDataColumn<TYPE>
-
setShort
public void setShort(long pos, short value)- Specified by:
setShort
in interfaceDataColumn<TYPE>
-
setShorts
public void setShorts(long startPos, short... values)- Specified by:
setShorts
in interfaceDataColumn<TYPE>
-