Package gnu.lists
Class Range<E>
- java.lang.Object
-
- gnu.lists.AbstractSequence<E>
-
- gnu.lists.Range<E>
-
- All Implemented Interfaces:
BoundedHashable
,Array<E>
,AVector<E>
,Consumable
,GVector<E>
,Sequence<E>
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
- Direct Known Subclasses:
Range.IntRange
public class Range<E> extends AbstractSequence<E> implements GVector<E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Range.IntRange
-
Field Summary
Fields Modifier and Type Field Description static Range.IntRange
zeroAndUp
-
Fields inherited from class gnu.lists.AbstractSequence
noInts
-
Fields inherited from interface gnu.lists.Sequence
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Range.IntRange
downto(IntNum iistart, IntNum iistep, IntNum iiend, boolean orEqual)
E
get(int index)
See java.util.List.E
getRaw(int index)
Given an "effective index", return element as object.E
getStart()
Object
getStep()
boolean
isUnbounded()
boolean
isUnspecifiedLast()
boolean
isUnspecifiedStart()
static void
listAll(Range r)
int
size()
See java.util.List.String
toString()
static Range.IntRange
upto(IntNum iistart, IntNum iistep, IntNum iiend, boolean orEqual)
-
Methods inherited from class gnu.lists.AbstractSequence
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, 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, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedException
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gnu.lists.Array
asImmutable, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, get, get, get, get, getBooleanRaw, getByteRaw, getCharRaw, getDoubleRaw, getElementKind, getFloatRaw, getInt, getInt, getInt, getInt, getInt, getIntRaw, getLongRaw, getLowBound, getRowMajor, getShortRaw, getSize, getSize, isEmpty, rank, set, setRaw
-
Methods inherited from interface gnu.kawa.util.BoundedHashable
boundedHash
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface gnu.lists.Consumable
consume
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
-
-
-
-
Field Detail
-
zeroAndUp
public static final Range.IntRange zeroAndUp
-
-
Method Detail
-
getStart
public E getStart()
-
getStep
public Object getStep()
-
getRaw
public E getRaw(int index)
Description copied from interface:Array
Given an "effective index", return element as object.
-
size
public int size()
Description copied from interface:Sequence
See java.util.List.
-
isUnbounded
public boolean isUnbounded()
-
isUnspecifiedStart
public boolean isUnspecifiedStart()
-
isUnspecifiedLast
public boolean isUnspecifiedLast()
-
listAll
public static void listAll(Range r)
-
toString
public String toString()
- Overrides:
toString
in classAbstractSequence<E>
-
upto
public static Range.IntRange upto(IntNum iistart, IntNum iistep, IntNum iiend, boolean orEqual)
-
downto
public static Range.IntRange downto(IntNum iistart, IntNum iistep, IntNum iiend, boolean orEqual)
-
-