T - - enum element typepublic class EnumColumn<T extends Enum<T>> extends Object implements Column<T>
EnumColumn is a view wrapping a ByteColumn, with the
byte values interpreted as ordinals of the specified enum type.
EnumColumns are not first-class columns - they cannot be directly
added to a DataFrame, and the getType() method returns null.
wrap(Class, ByteColumn),
unwrap()BASE_CHARACTERISTICS| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(int index,
Collection<? extends T> c) |
EnumColumn<T> |
append(Column<T> tail)
Appends two columns with the same element type.
|
T |
ceiling(T value)
Returns the least element in this column greater than or equal to the given
element, or
null if there is no such element. |
int |
characteristics()
Returns the
Spliterator.characteristics() for this column. |
void |
clear() |
Comparator<? super T> |
comparator()
Returns the comparator used to order the elements in this column.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
EnumColumn<T> |
copy()
Returns a column equal to this one, but with elements stored in a newly
allocated buffer.
|
boolean |
equals(Object o) |
T |
first()
Returns the first (lowest) element in this column.
|
T |
floor(T value)
Returns the greatest element in this column less than or equal to the given
element, or
null if there is no such element. |
T |
get(int index) |
ColumnType<T> |
getType() |
int |
hashCode() |
EnumColumn<T> |
head(T toElement)
Same behavior as
Column.head(Object, boolean), with inclusive set
to false. |
EnumColumn<T> |
head(T toElement,
boolean inclusive)
Returns a view of the portion of this column whose elements are less than (or
equal to, if
inclusive is true) toElement. |
T |
higher(T value)
Returns the least element in this column strictly greater than the given
element, or
null if there is no such element. |
int |
indexOf(Object o) |
boolean |
isEmpty() |
boolean |
isNull(int index)
Test if a value is null at a given index.
|
Iterator<T> |
iterator() |
T |
last()
Returns the last (highest) element in this column.
|
int |
lastIndexOf(Object o) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
T |
lower(T value)
Returns the greatest element in this column strictly less than the given
element, or
null if there is no such element. |
T |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
T |
set(int index,
T element) |
int |
size() |
EnumColumn<T> |
subColumn(int fromIndex,
int toIndex)
Returns a view of the portion of this column between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
EnumColumn<T> |
subColumnByValue(T fromElement,
boolean fromInclusive,
T toElement,
boolean toInclusive)
Returns a view of the portion of this column whose elements range from
fromElement to toElement. |
EnumColumn<T> |
subColumnByValue(T fromElement,
T toElement)
Same behavior as
Column#subColumn(Object, boolean, Object, Boolean),
with fromInclusive set to true and toInclusive set to false. |
List<T> |
subList(int fromIndex,
int toIndex) |
EnumColumn<T> |
tail(T fromElement)
Same behavior as
Column.tail(Object, boolean), with inclusive set
to true. |
EnumColumn<T> |
tail(T fromElement,
boolean inclusive)
Returns a view of the portion of this column whose elements are greater than
(or equal to, if
inclusive is true) fromElement. |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
EnumColumn<T> |
toDistinct()
Converts a column to a unique index.
|
EnumColumn<T> |
toHeap()
Converts an index into a heap.
|
EnumColumn<T> |
toSorted()
Converts a heap to an index.
|
ByteColumn |
unwrap()
Returns the
ByteColumn containing the ordinal values. |
static <T extends Enum<T>> |
wrap(Class<T> enumType,
ByteColumn delegate)
Wraps the specified
ByteColumn, interpreting the byte values
as ordinals of the specified enum type. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitappend, isDistinct, isNonnull, isSorted, spliteratorreplaceAll, sortparallelStream, removeIf, streampublic static <T extends Enum<T>> EnumColumn<T> wrap(Class<T> enumType, ByteColumn delegate)
ByteColumn, interpreting the byte values
as ordinals of the specified enum type.T - - enum element typeenumType - - the enum element typedelegate - - the ByteColumn containing ordinal valuesByteColumnpublic ByteColumn unwrap()
ByteColumn containing the ordinal values.ByteColumn containing the ordinal values.public boolean equals(Object o)
public int hashCode()
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public int lastIndexOf(Object o)
lastIndexOf in interface List<T extends Enum<T>>public Object[] toArray()
public <E> E[] toArray(E[] a)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T extends Enum<T>>containsAll in interface List<T extends Enum<T>>public ListIterator<T> listIterator()
listIterator in interface List<T extends Enum<T>>public ListIterator<T> listIterator(int index)
listIterator in interface List<T extends Enum<T>>public int characteristics()
ColumnSpliterator.characteristics() for this column.characteristics in interface Column<T extends Enum<T>>public EnumColumn<T> toHeap()
Columnpublic EnumColumn<T> toSorted()
ColumnColumn.characteristics() of this column:
SORTED flag
set. If not already sorted then Column.copy() will be invoked, and the
resulting column will be sorted.
DISTINCT flag unset.
public EnumColumn<T> toDistinct()
ColumnColumn.characteristics() of this column:
SORTED and DISTINCT flags set. If not already sorted and
distinct then Column.copy() will be invoked, and the resulting column will
be sorted and deduplicated.
DISTINCT
flag set. If duplicates are present then Column.copy() will be invoked, and
the resulting column will be deduplicated.
toDistinct in interface Column<T extends Enum<T>>public ColumnType<T> getType()
public boolean isNull(int index)
Columnpublic EnumColumn<T> subColumn(int fromIndex, int toIndex)
Columnpublic EnumColumn<T> append(Column<T> tail)
ColumnBoth columns must have the same characteristics. If they're both unique indices then the first value of the provided column must be greater than the last value of this column.
public EnumColumn<T> copy()
Columnpublic Comparator<? super T> comparator()
Columncomparator in interface Column<T extends Enum<T>>public T first()
Columnpublic T last()
Columnpublic T lower(T value)
Columnnull if there is no such element.public T higher(T value)
Columnnull if there is no such element.public T floor(T value)
Columnnull if there is no such element.public T ceiling(T value)
Columnnull if there is no such element.public EnumColumn<T> subColumnByValue(T fromElement, boolean fromInclusive, T toElement, boolean toInclusive)
ColumnfromElement to toElement. If fromElement and
toElement are equal, the returned column is empty unless fromInclusive and toInclusive are both true. The returned column is
backed by this column.
This method is only available when Column.isDistinct() returns
true.
subColumnByValue in interface Column<T extends Enum<T>>fromElement - low endpoint of the returned columnfromInclusive - true if the low endpoint is to be included in the resulttoElement - high endpoint of the returned columntoInclusive - true if the high endpoint is to be included in the
resultfromElement to toElementpublic EnumColumn<T> subColumnByValue(T fromElement, T toElement)
ColumnColumn#subColumn(Object, boolean, Object, Boolean),
with fromInclusive set to true and toInclusive set to false.
This method is only available when Column.isDistinct() returns
true.
subColumnByValue in interface Column<T extends Enum<T>>fromElement - low endpoint of the returned column, inclusivetoElement - high endpoint of the returned column, exclusivefromElement, inclusive, to toElement, exclusivepublic EnumColumn<T> head(T toElement, boolean inclusive)
Columninclusive is true) toElement. The returned
column is backed by this column.
This method is only available when Column.isDistinct() returns
true.
head in interface Column<T extends Enum<T>>toElement - high endpoint of the returned columninclusive - true if the high endpoint is to be included in the
returned viewinclusive is true) toElementpublic EnumColumn<T> head(T toElement)
ColumnColumn.head(Object, boolean), with inclusive set
to false.
This method is only available when Column.isDistinct() returns
true.
public EnumColumn<T> tail(T fromElement, boolean inclusive)
Columninclusive is true) fromElement. The returned
column is backed by this column.
This method is only available when Column.isDistinct() returns
true.
public EnumColumn<T> tail(T fromElement)
ColumnColumn.tail(Object, boolean), with inclusive set
to true.
This method is only available when Column.isDistinct() returns
true.
public boolean add(T e)
public boolean remove(Object o)
public boolean addAll(Collection<? extends T> c)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public void clear()
public boolean addAll(int index,
Collection<? extends T> c)
Copyright © 2020. All rights reserved.