public class Columns extends java.util.AbstractCollection<ColumnMetadata> implements java.util.Collection<ColumnMetadata>
Note that in practice, it will either store only static columns, or only regular ones. When
we need both type of columns, we use a RegularAndStaticColumns object.
| Modifier and Type | Class and Description |
|---|---|
static class |
Columns.Serializer |
| Modifier and Type | Field and Description |
|---|---|
static ColumnMetadata |
FIRST_COMPLEX_REGULAR |
static ColumnMetadata |
FIRST_COMPLEX_STATIC |
static Columns |
NONE |
static Columns.Serializer |
serializer |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(java.util.function.Consumer<ColumnMetadata> function)
Apply a function to each column definition in forwards or reversed order.
|
int |
complexColumnCount()
The number of complex columns (non-frozen collections, udts, ...) in this object.
|
java.util.Iterator<ColumnMetadata> |
complexColumns()
Iterator over the complex columns of this object.
|
int |
complexIdx(ColumnMetadata c)
The index of the provided complex column in this object (if it contains
the provided column).
|
boolean |
contains(ColumnMetadata c)
Whether the provided column is contained by this object.
|
boolean |
containsAll(java.util.Collection<?> other)
Whether this object is a superset of the provided other
Columns object. |
void |
digest(Digest digest) |
boolean |
equals(java.lang.Object other) |
static Columns |
from(BTree.Builder<ColumnMetadata> builder) |
static Columns |
from(java.util.Collection<ColumnMetadata> s)
Returns a new
Columns object holding the same columns than the provided set. |
static Columns |
from(Row row)
Returns a new
Columns object holing the same columns as the provided Row. |
ColumnMetadata |
getComplex(int i)
Returns the ith complex column of this object.
|
ColumnMetadata |
getSimple(int i)
Returns the ith simple column of this object.
|
boolean |
hasComplex()
Whether this objects contains complex columns.
|
int |
hashCode() |
boolean |
hasSimple()
Whether this objects contains simple columns.
|
java.util.function.Predicate<ColumnMetadata> |
inOrderInclusionTester()
Returns a predicate to test whether columns are included in this
Columns object,
assuming that tes tested columns are passed to the predicate in sorted order. |
boolean |
isEmpty()
Whether this columns is empty.
|
BTreeSearchIterator<ColumnMetadata,ColumnMetadata> |
iterator()
Iterator over all the columns of this object.
|
Columns |
mergeTo(Columns other)
Returns the result of merging this
Columns object with the
provided one. |
static Columns |
of(ColumnMetadata c)
Creates a
Columns holding only the one column provided. |
java.util.Iterator<ColumnMetadata> |
selectOrderIterator()
An iterator that returns the columns of this object in "select" order (that
is in global alphabetical order, where the "normal" iterator returns simple
columns first and the complex second).
|
int |
simpleColumnCount()
The number of simple columns in this object.
|
java.util.Iterator<ColumnMetadata> |
simpleColumns()
Iterator over the simple columns of this object.
|
int |
simpleIdx(ColumnMetadata c)
The index of the provided simple column in this object (if it contains
the provided column).
|
int |
size()
The total number of columns in this object.
|
java.lang.String |
toString() |
long |
unsharedHeapSize() |
Columns |
without(ColumnMetadata column)
Returns the equivalent of those columns but with the provided column removed.
|
add, addAll, clear, contains, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final Columns.Serializer serializer
public static final Columns NONE
public static final ColumnMetadata FIRST_COMPLEX_STATIC
public static final ColumnMetadata FIRST_COMPLEX_REGULAR
public static Columns of(ColumnMetadata c)
Columns holding only the one column provided.c - the column for which to create a Columns object.Columns containing only c.public static Columns from(Row row)
Columns object holing the same columns as the provided Row.row - the row from which to create the new Columns.Columns containing the columns from row.public static Columns from(BTree.Builder<ColumnMetadata> builder)
public static Columns from(java.util.Collection<ColumnMetadata> s)
Columns object holding the same columns than the provided set.
This method assumes nothing about the order of s.s - the set from which to create the new Columns.Columns containing the columns from s.public boolean isEmpty()
isEmpty in interface java.util.Collection<ColumnMetadata>isEmpty in class java.util.AbstractCollection<ColumnMetadata>public int simpleColumnCount()
public int complexColumnCount()
public int size()
size in interface java.util.Collection<ColumnMetadata>size in class java.util.AbstractCollection<ColumnMetadata>public boolean hasSimple()
public boolean hasComplex()
public ColumnMetadata getSimple(int i)
i - the index for the simple column to fectch. This must
satisfy 0 <= i < simpleColumnCount().ith simple column in this object.public ColumnMetadata getComplex(int i)
i - the index for the complex column to fectch. This must
satisfy 0 <= i < complexColumnCount().ith complex column in this object.public int simpleIdx(ColumnMetadata c)
c - the simple column for which to return the index of.c if it is contains in this
objectpublic int complexIdx(ColumnMetadata c)
c - the complex column for which to return the index of.c if it is contains in this
objectpublic boolean contains(ColumnMetadata c)
c - the column to check presence of.c is contained by this object.public Columns mergeTo(Columns other)
Columns object with the
provided one.other - the other Columns to merge this object with.this and
other. The returned object may be one of the operand and that
operand is a subset of the other operand.public boolean containsAll(java.util.Collection<?> other)
Columns object.containsAll in interface java.util.Collection<ColumnMetadata>containsAll in class java.util.AbstractCollection<ColumnMetadata>other - the other object to test for inclusion in this object.other are contained by this object.public java.util.Iterator<ColumnMetadata> simpleColumns()
public java.util.Iterator<ColumnMetadata> complexColumns()
public BTreeSearchIterator<ColumnMetadata,ColumnMetadata> iterator()
iterator in interface java.lang.Iterable<ColumnMetadata>iterator in interface java.util.Collection<ColumnMetadata>iterator in class java.util.AbstractCollection<ColumnMetadata>public java.util.Iterator<ColumnMetadata> selectOrderIterator()
public Columns without(ColumnMetadata column)
column - the column to remove.this expect
for column.public java.util.function.Predicate<ColumnMetadata> inOrderInclusionTester()
Columns object,
assuming that tes tested columns are passed to the predicate in sorted order.public void digest(Digest digest)
public void apply(java.util.function.Consumer<ColumnMetadata> function)
function - public boolean equals(java.lang.Object other)
equals in interface java.util.Collection<ColumnMetadata>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<ColumnMetadata>hashCode in class java.lang.Objectpublic long unsharedHeapSize()
public java.lang.String toString()
toString in class java.util.AbstractCollection<ColumnMetadata>Copyright © 2009-2022 The Apache Software Foundation