Package gnu.lists

Class Sequences

java.lang.Object
gnu.lists.Sequences

public class Sequences extends Object
  • Constructor Details

    • Sequences

      public Sequences()
  • Method Details

    • asGVectorOrNull

      public static GVector asGVectorOrNull(Object value)
    • asGVector

      public static GVector asGVector(Object value)
    • asSequenceOrNull

      public static List asSequenceOrNull(Object value)
    • asIntSequenceOrNull

      public static IntSequence asIntSequenceOrNull(Object value)
    • coerceToSequence

      public static List coerceToSequence(Object value)
    • getAt

      public static Object getAt(List seq, int index)
    • 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.
    • subList

      public static Object subList(Object base, int fromIndex, int toIndex)
    • indirectIndexed

      public static List indirectIndexed(List lst, IntSequence indexes)
    • drop

      public static Object drop(Object base, int count)
    • drop

      public static Object drop(Object base, int fromStart, int fromEnd)
    • 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)
    • copyInPlaceIsSafe

      public static boolean copyInPlaceIsSafe(Object src, Object dst)
    • replace

      public static void replace(List lst, int fromStart, int fromEnd, List values)
    • writeUInt

      public static void writeUInt(int value, Consumer out)
    • writeULong

      public static void writeULong(long value, Consumer out)