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.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
Methods inherited from interface com.illumon.iris.db.tables.DataColumn
getDirect, getDirect, getDirect, getDirect
-
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>
-