Package gnu.lists
Class Sequences
- java.lang.Object
-
- gnu.lists.Sequences
-
public class Sequences extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSequences.CharacterIteratorIterator subclass to iterate of CharSequences.
-
Constructor Summary
Constructors Constructor Description Sequences()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GVectorasGVector(Object value)static GVectorasGVectorOrNull(Object value)static IntSequenceasIntSequenceOrNull(Object value)static ListasSequenceOrNull(Object value)static ListcoerceToSequence(Object value)static SimpleVectorcopy(SimpleVector base, int start, int end, boolean writable)static SimpleVectorcopy(List base, Range.IntRange range, boolean writable)static booleancopyInPlaceIsSafe(Object src, Object dst)static SimpleVectorcopySimple(SimpleVector base, int start, int end, boolean writable)Do a logical substring operation with sharing.static Objectdrop(Object base, int count)static Objectdrop(Object base, int fromStart, int fromEnd)static ObjectgetAt(List seq, int index)static IteratorgetIterator(Object object)Get an Iterator for a "sequence-like" object.static intgetSize(Object values)static ListindirectIndexed(List lst, IntSequence indexes)static voidreplace(List lst, int fromStart, int fromEnd, List values)static ObjectsubList(Object base, int fromIndex, int toIndex)static voidwriteUInt(int value, Consumer out)static voidwriteULong(long value, Consumer out)
-
-
-
Method Detail
-
asIntSequenceOrNull
public static IntSequence asIntSequenceOrNull(Object value)
-
getSize
public static int getSize(Object values)
-
getIterator
public static Iterator getIterator(Object object)
Get an Iterator for a "sequence-like" object. This handles Iterables, CharSequences, and Java arrays. A CharSequences is treated as a sequence of (20-bit) code-points, not 16-bit char values.
-
indirectIndexed
public static List indirectIndexed(List lst, IntSequence indexes)
-
copySimple
public static SimpleVector copySimple(SimpleVector base, int start, int end, boolean writable)
Do a logical substring operation with sharing. Requires base.isVerySimple() || base.isSubRange(). Note also that if base is an FString, the indexes count 16-bit code units.
-
copy
public static SimpleVector copy(SimpleVector base, int start, int end, boolean writable)
-
copy
public static SimpleVector copy(List base, Range.IntRange range, boolean writable)
-
writeUInt
public static void writeUInt(int value, Consumer out)
-
writeULong
public static void writeULong(long value, Consumer out)
-
-