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.TYPEget(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.BooleangetBoolean(long pos)Boolean[]getBooleans(int... positions)Boolean[]getBooleans(long... positions)Boolean[]getBooleans(long startPosInclusive, long endPosExclusive)bytegetByte(long pos)byte[]getBytes(int... positions)byte[]getBytes(long... positions)byte[]getBytes(long startPosInclusive, long endPosExclusive)chargetChar(long pos)char[]getChars(int... positions)char[]getChars(long... positions)char[]getChars(long startPosInclusive, long endPosExclusive)ClassgetComponentType()Get the array component type, or the type itself.doublegetDouble(long pos)double[]getDoubles(int... positions)double[]getDoubles(long... positions)double[]getDoubles(long startPosInclusive, long endPosExclusive)floatgetFloat(long pos)float[]getFloats(int... positions)float[]getFloats(long... positions)float[]getFloats(long startPosInclusive, long endPosExclusive)intgetInt(long pos)int[]getInts(int... positions)int[]getInts(long... positions)int[]getInts(long startPosInclusive, long endPosExclusive)longgetLong(long pos)long[]getLongs(int... positions)long[]getLongs(long... positions)long[]getLongs(long startPosInclusive, long endPosExclusive)StringgetName()shortgetShort(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.voidset(long pos, TYPE value)voidsetArray(long startPos, TYPE... values)voidsetBoolean(long pos, Boolean value)voidsetBooleans(long startPos, Boolean... values)voidsetByte(long pos, byte value)voidsetBytes(long startPos, byte... values)voidsetChar(long pos, char value)voidsetChars(long startPos, char... values)voidsetDouble(long pos, double value)voidsetDoubles(long startPos, double... values)voidsetFloat(long pos, float value)voidsetFloats(long startPos, float... values)voidsetInt(long pos, int value)voidsetInts(long startPos, int... values)voidsetLong(long pos, long value)voidsetLongs(long startPos, long... values)voidsetShort(long pos, short value)voidsetShorts(long startPos, short... values)longsize()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:
getNamein interfaceDataColumn<TYPE>
-
getType
- Specified by:
getTypein interfaceDataColumn<TYPE>- Returns:
- the type of object contained within this column.
-
getComponentType
Description copied from interface:DataColumnGet 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:
getComponentTypein 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:LongSizedDataStructureThe size of this data structure.- Specified by:
sizein interfaceLongSizedDataStructure- Returns:
- The size
-
get
Description copied from interface:DataColumnReturns the value in the column at the row designated by the index- Specified by:
getin 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:DataColumnReturn 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:
getin 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:DataColumnReturn the column's values for the specified rows. Note that this will be a boxed array, for data columns of primitive types.- Specified by:
getin interfaceDataColumn<TYPE>- Parameters:
positions- The row indexes to fetch- Returns:
- Return the column's values for the specified rows
-
get
Description copied from interface:DataColumnReturn the column's values for the specified rows. Note that this will be a boxed array, for data columns of primitive types.- Specified by:
getin interfaceDataColumn<TYPE>- Parameters:
positions- The row indexes to fetch- Returns:
- Return the column's values for the specified rows
-
getBoolean
- Specified by:
getBooleanin interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleansin interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleansin interfaceDataColumn<TYPE>
-
getBooleans
- Specified by:
getBooleansin interfaceDataColumn<TYPE>
-
getByte
public byte getByte(long pos)- Specified by:
getBytein interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(long startPosInclusive, long endPosExclusive)- Specified by:
getBytesin interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(long... positions)- Specified by:
getBytesin interfaceDataColumn<TYPE>
-
getBytes
public byte[] getBytes(int... positions)- Specified by:
getBytesin interfaceDataColumn<TYPE>
-
getChar
public char getChar(long pos)- Specified by:
getCharin interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(long startPosInclusive, long endPosExclusive)- Specified by:
getCharsin interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(long... positions)- Specified by:
getCharsin interfaceDataColumn<TYPE>
-
getChars
public char[] getChars(int... positions)- Specified by:
getCharsin interfaceDataColumn<TYPE>
-
getDouble
public double getDouble(long pos)- Specified by:
getDoublein interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(long startPosInclusive, long endPosExclusive)- Specified by:
getDoublesin interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(long... positions)- Specified by:
getDoublesin interfaceDataColumn<TYPE>
-
getDoubles
public double[] getDoubles(int... positions)- Specified by:
getDoublesin interfaceDataColumn<TYPE>
-
getFloat
public float getFloat(long pos)- Specified by:
getFloatin interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(long startPosInclusive, long endPosExclusive)- Specified by:
getFloatsin interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(long... positions)- Specified by:
getFloatsin interfaceDataColumn<TYPE>
-
getFloats
public float[] getFloats(int... positions)- Specified by:
getFloatsin interfaceDataColumn<TYPE>
-
getInt
public int getInt(long pos)- Specified by:
getIntin interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(long startPosInclusive, long endPosExclusive)- Specified by:
getIntsin interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(long... positions)- Specified by:
getIntsin interfaceDataColumn<TYPE>
-
getInts
public int[] getInts(int... positions)- Specified by:
getIntsin interfaceDataColumn<TYPE>
-
getLong
public long getLong(long pos)- Specified by:
getLongin interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(long startPosInclusive, long endPosExclusive)- Specified by:
getLongsin interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(long... positions)- Specified by:
getLongsin interfaceDataColumn<TYPE>
-
getLongs
public long[] getLongs(int... positions)- Specified by:
getLongsin interfaceDataColumn<TYPE>
-
getShort
public short getShort(long pos)- Specified by:
getShortin interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(long startPosInclusive, long endPosExclusive)- Specified by:
getShortsin interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(long... positions)- Specified by:
getShortsin interfaceDataColumn<TYPE>
-
getShorts
public short[] getShorts(int... positions)- Specified by:
getShortsin interfaceDataColumn<TYPE>
-
set
- Specified by:
setin interfaceDataColumn<TYPE>
-
setArray
- Specified by:
setArrayin interfaceDataColumn<TYPE>
-
setBoolean
- Specified by:
setBooleanin interfaceDataColumn<TYPE>
-
setBooleans
- Specified by:
setBooleansin interfaceDataColumn<TYPE>
-
setByte
public void setByte(long pos, byte value)- Specified by:
setBytein interfaceDataColumn<TYPE>
-
setBytes
public void setBytes(long startPos, byte... values)- Specified by:
setBytesin interfaceDataColumn<TYPE>
-
setChar
public void setChar(long pos, char value)- Specified by:
setCharin interfaceDataColumn<TYPE>
-
setChars
public void setChars(long startPos, char... values)- Specified by:
setCharsin interfaceDataColumn<TYPE>
-
setDouble
public void setDouble(long pos, double value)- Specified by:
setDoublein interfaceDataColumn<TYPE>
-
setDoubles
public void setDoubles(long startPos, double... values)- Specified by:
setDoublesin interfaceDataColumn<TYPE>
-
setFloat
public void setFloat(long pos, float value)- Specified by:
setFloatin interfaceDataColumn<TYPE>
-
setFloats
public void setFloats(long startPos, float... values)- Specified by:
setFloatsin interfaceDataColumn<TYPE>
-
setInt
public void setInt(long pos, int value)- Specified by:
setIntin interfaceDataColumn<TYPE>
-
setInts
public void setInts(long startPos, int... values)- Specified by:
setIntsin interfaceDataColumn<TYPE>
-
setLong
public void setLong(long pos, long value)- Specified by:
setLongin interfaceDataColumn<TYPE>
-
setLongs
public void setLongs(long startPos, long... values)- Specified by:
setLongsin interfaceDataColumn<TYPE>
-
setShort
public void setShort(long pos, short value)- Specified by:
setShortin interfaceDataColumn<TYPE>
-
setShorts
public void setShorts(long startPos, short... values)- Specified by:
setShortsin interfaceDataColumn<TYPE>
-