Package gnu.lists

Class FString

    • Constructor Detail

      • FString

        public FString()
      • FString

        public FString​(int num)
      • FString

        public FString​(int num,
                       int value)
      • FString

        public FString​(char[] values)
        Create an FString from a char[]. Note that this contructor does *not* copy the argument.
      • FString

        public FString​(char[] buffer,
                       int offset,
                       int length)
        This constructor makes a copy.
      • FString

        public FString​(CharSequence seq,
                       int offset,
                       int length)
        Copy a substring of a CharSequence.
        Parameters:
        offset - - start offset in 16-bit char units
        length - - length in 16-bit char units
    • Method Detail

      • createPos

        public int createPos​(int index,
                             boolean isAfter)
        Description copied from class: AbstractSequence
        Generate a position at a given index. The result is a position cookie that must be free'd with releasePos.
        Overrides:
        createPos in class AbstractSequence<Char>
        Parameters:
        index - offset from beginning of desired position
        isAfter - should the position have the isAfter property
      • nextIndex

        protected int nextIndex​(int ipos)
        Description copied from class: AbstractSequence
        Get the offset from the beginning corresponding to a position cookie.
        Overrides:
        nextIndex in class AbstractSequence<Char>
      • alloc

        public static FString alloc​(int sz)
        Create a empty string, but with a given initial buffer size.
      • indexOf

        public int indexOf​(int ch,
                           int fromChar)
        Parameters:
        fromChar - offset in 16-bit code units
      • lastIndexOf

        public int lastIndexOf​(int ch,
                               int fromChar)
        Parameters:
        fromChar - offset in 16-bit code units
      • set

        public Char set​(int index,
                        Char value)
        Description copied from interface: Sequence
        See java.util.List.
        Specified by:
        set in interface List<Char>
        Specified by:
        set in interface Sequence<Char>
        Overrides:
        set in class AbstractSequence<Char>
        Parameters:
        index - offset in character units (Unicode code points)
      • setRaw

        public final void setRaw​(int index,
                                 Char value)
        Description copied from class: AbstractSequence
        Given an "effective index", set selected element.
        Specified by:
        setRaw in interface Array<Char>
        Overrides:
        setRaw in class AbstractSequence<Char>
        Parameters:
        index - offset in character units (Unicode code points)
      • characterAt

        public final int characterAt​(int index)
        Parameters:
        index - offset in 16-bit code units
      • toCharArray

        public char[] toCharArray()
        Return a char[] contain the characters of this string. It is unspecified if the result is a copy or shares with this FString.
      • shift

        public void shift​(int srcStart,
                          int dstStart,
                          int count)
        Overrides:
        shift in class SimpleVector<Char>
      • copy

        public FString copy​(int start,
                            int end)
      • insert

        public void insert​(int where,
                           int ch,
                           boolean beforeMarkers)
      • insert

        public void insert​(int where,
                           String str,
                           boolean beforeMarkers)
      • addAllStrings

        public void addAllStrings​(Object[] args,
                                  int startIndex)
        Append arguments to this FString. Used to implement Scheme's string-append.
        Parameters:
        args - an array of FString value
        startIndex - index of first string in args to use
      • substring

        public String substring​(int start,
                                int end)
      • setCharAt

        public void setCharAt​(int index,
                              char ch)
        Specified by:
        setCharAt in interface CharSeq
      • setCharacterAt

        public void setCharacterAt​(int index,
                                   int ch)
        Specified by:
        setCharacterAt in interface CharSeq
      • replace

        public void replace​(CharSequence src,
                            int srcStart,
                            int srcEnd,
                            int dstStart,
                            int dstEnd)
        Replace a substring of this string with another. The two strings may have different lengths, so this generalizes insertion and deletion. All indexes are code-unit (16-bit char) offsets.
      • setCharAtBuffer

        public void setCharAtBuffer​(int index,
                                    char ch)
      • insertRepeated

        public void insertRepeated​(int where,
                                   int value,
                                   int count)
      • replace

        public void replace​(int where,
                            char[] chars,
                            int start,
                            int count)
      • replace

        public void replace​(int where,
                            String string)
      • getTag

        public String getTag()
        Description copied from class: SimpleVector
        This is convenience hack for printing "uniform vectors" (srfi 4). It may go away without notice!
        Overrides:
        getTag in class SimpleVector<Char>
      • appendCharacter

        public FString appendCharacter​(int c)
        Append a Unicode code point.
      • prependCharacter

        public FString prependCharacter​(int c)
      • writeTo

        public void writeTo​(int start,
                            int count,
                            Appendable dest)
                     throws IOException
        Description copied from interface: CharSeq
        Append a specified subsequence to an Appendable. An allowable implementation is: dest.append(this, start, start+count). Hence implementors of Appendable should avoid calling writeTo - though they can call getChars.
        Specified by:
        writeTo in interface CharSeq
        Throws:
        IOException