Package gnu.lists

Class Sequences


  • public class Sequences
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Sequences.CharacterIterator
      Iterator 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 GVector asGVector​(java.lang.Object value)  
      static GVector asGVectorOrNull​(java.lang.Object value)  
      static IntSequence asIntSequenceOrNull​(java.lang.Object value)  
      static java.util.List asSequenceOrNull​(java.lang.Object value)  
      static java.util.List coerceToSequence​(java.lang.Object value)  
      static SimpleVector copy​(SimpleVector base, int start, int end, boolean writable)  
      static SimpleVector copy​(java.util.List base, Range.IntRange range, boolean writable)  
      static boolean copyInPlaceIsSafe​(java.lang.Object src, java.lang.Object dst)  
      static SimpleVector copySimple​(SimpleVector base, int start, int end, boolean writable)
      Do a logical substring operation with sharing.
      static java.lang.Object drop​(java.lang.Object base, int count)  
      static java.lang.Object drop​(java.lang.Object base, int fromStart, int fromEnd)  
      static java.lang.Object getAt​(java.util.List seq, int index)  
      static java.util.Iterator getIterator​(java.lang.Object object)
      Get an Iterator for a "sequence-like" object.
      static int getSize​(java.lang.Object values)  
      static java.util.List indirectIndexed​(java.util.List lst, IntSequence indexes)  
      static void replace​(java.util.List lst, int fromStart, int fromEnd, java.util.List values)  
      static java.lang.Object subList​(java.lang.Object base, int fromIndex, int toIndex)  
      static void writeUInt​(int value, Consumer out)  
      static void writeULong​(long value, Consumer out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sequences

        public Sequences()
    • Method Detail

      • asGVectorOrNull

        public static GVector asGVectorOrNull​(java.lang.Object value)
      • asGVector

        public static GVector asGVector​(java.lang.Object value)
      • asSequenceOrNull

        public static java.util.List asSequenceOrNull​(java.lang.Object value)
      • asIntSequenceOrNull

        public static IntSequence asIntSequenceOrNull​(java.lang.Object value)
      • coerceToSequence

        public static java.util.List coerceToSequence​(java.lang.Object value)
      • getAt

        public static java.lang.Object getAt​(java.util.List seq,
                                             int index)
      • getSize

        public static int getSize​(java.lang.Object values)
      • getIterator

        public static java.util.Iterator getIterator​(java.lang.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 java.lang.Object subList​(java.lang.Object base,
                                               int fromIndex,
                                               int toIndex)
      • indirectIndexed

        public static java.util.List indirectIndexed​(java.util.List lst,
                                                     IntSequence indexes)
      • drop

        public static java.lang.Object drop​(java.lang.Object base,
                                            int count)
      • drop

        public static java.lang.Object drop​(java.lang.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.
      • copyInPlaceIsSafe

        public static boolean copyInPlaceIsSafe​(java.lang.Object src,
                                                java.lang.Object dst)
      • replace

        public static void replace​(java.util.List lst,
                                   int fromStart,
                                   int fromEnd,
                                   java.util.List values)
      • writeUInt

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

        public static void writeULong​(long value,
                                      Consumer out)