public abstract class Values<E> extends AbstractSequence<E> implements Consumable, java.io.Externalizable
Modifier and Type | Class and Description |
---|---|
static class |
Values.FromArray<E>
An implementation of Values that stores the values in an array.
|
static class |
Values.FromList<E>
An implementation of Values that uses a java.util.List.
|
static class |
Values.FromTreeList
An implementation of Values that uses a TreeList.
|
static class |
Values.Values2<E,V1 extends E,V2 extends E>
A specialization of Values for exactly 2 values.
|
Modifier and Type | Field and Description |
---|---|
static Values |
empty |
static java.lang.Object[] |
noArgs |
noInts
Modifier | Constructor and Description |
---|---|
protected |
Values() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
call_with(Procedure proc)
Apply a Procedure with these values as the arguments.
|
java.lang.Object |
canonicalize()
If a simple value, return that value.
|
static void |
checkFinalPos(java.lang.Object values,
int pos) |
static int |
countValues(java.lang.Object value) |
static java.lang.Object |
getFromPos(java.lang.Object values,
int pos) |
static java.lang.Object |
getFromPosFinal(java.lang.Object values,
int pos) |
java.lang.Object[] |
getValues()
Get the values encapsulated.
|
static int |
incrPos(java.lang.Object values,
int pos) |
static Values |
make() |
static <E> java.lang.Object |
make(E[] vals)
Create a value for each element of an array.
|
static <E> java.lang.Object |
make(java.util.List<E> seq)
Create a value for each element of a list.
|
static java.lang.Object |
make(TreeList list,
int startPosition,
int endPosition)
Extract a value (single or Values) from a sub-range of a TreeList.
|
static <E> Values<E> |
makeFromArray(E... vals) |
protected int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
static int |
nextIndex(java.lang.Object values,
int curIndex)
Helper method called by compiled code.
|
static java.lang.Object |
nextValue(java.lang.Object values,
int curIndex)
Helper method called by compiled code.
|
void |
print(Consumer out) |
java.lang.Object |
readResolve() |
static java.lang.Object |
values(java.lang.Object... vals) |
static <E,V1 extends E,V2 extends E> |
values2(V1 val1,
V2 val2) |
void |
writeExternal(java.io.ObjectOutput out) |
static void |
writeValues(java.lang.Object value,
Consumer out) |
add, add, addAll, addAll, addPos, asImmutable, badRank, boundedHash, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedException
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
consume
public static final java.lang.Object[] noArgs
public static final Values empty
public java.lang.Object[] getValues()
public static java.lang.Object values(java.lang.Object... vals)
public static <E,V1 extends E,V2 extends E> Values.Values2<E,V1,V2> values2(V1 val1, V2 val2)
public static Values make()
public static <E> java.lang.Object make(E[] vals)
vals
- values to use.
The array should be immutable, as may be re-used for the result.public static <E> Values<E> makeFromArray(E... vals)
public static <E> java.lang.Object make(java.util.List<E> seq)
seq
- values to use.
The list should be immutable, as may be re-used for the result.public static java.lang.Object make(TreeList list, int startPosition, int endPosition)
list
- the TreeList to copystartPosition
- start of range, as a raw index in dataendPosition
- end of range, as a raw index in datapublic java.lang.Object canonicalize()
public java.lang.Object call_with(Procedure proc) throws java.lang.Throwable
java.lang.Throwable
public void print(Consumer out)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
public static int incrPos(java.lang.Object values, int pos)
public static java.lang.Object getFromPos(java.lang.Object values, int pos)
public static java.lang.Object getFromPosFinal(java.lang.Object values, int pos)
public static void checkFinalPos(java.lang.Object values, int pos)
public static int nextIndex(java.lang.Object values, int curIndex)
public static java.lang.Object nextValue(java.lang.Object values, int curIndex)
protected int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence<E>
public static void writeValues(java.lang.Object value, Consumer out)
public static int countValues(java.lang.Object value)