Class palString


  • public class palString
    extends java.lang.Object
    A String with positional information
    • Constructor Summary

      Constructors 
      Constructor Description
      palString​(java.lang.String s)
      Create a new string
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void backChar()
      Move the string pointer back one character
      char getChar()
      Get the character at the current position in the string
      char getChar​(int n)
      Get the character at a set position in the string
      int getDigit()
      Get the Digit Flag
      int getFlag()
      Get the Status flag
      char getlastChar()
      Get the last character
      char getNextChar()
      Get the next character of the string
      int getPos()
      Get the current character position
      java.lang.String getString()
      Get the string
      void incrChar()
      Move the string pointer forward one character
      int length()
      Get the length of the string
      void setDigit​(int n)
      Set the Digit Flag
      void setFlag​(int n)
      Set the Status flag
      void setPos​(int n)
      Set the current character position
      java.lang.String toString()
      Get the string
      • Methods inherited from class java.lang.Object

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

      • palString

        public palString​(java.lang.String s)
        Create a new string
        Parameters:
        s - The text to store
    • Method Detail

      • getString

        public java.lang.String getString()
        Get the string
        Returns:
        The text of the string
      • getNextChar

        public char getNextChar()
        Get the next character of the string
        Returns:
        The next character
      • backChar

        public void backChar()
        Move the string pointer back one character
      • incrChar

        public void incrChar()
        Move the string pointer forward one character
      • getChar

        public char getChar​(int n)
        Get the character at a set position in the string
        Parameters:
        n - The position of the character to get
        Returns:
        The character at position n
      • getChar

        public char getChar()
        Get the character at the current position in the string
        Returns:
        The current character
      • getlastChar

        public char getlastChar()
        Get the last character
        Returns:
        The previous character
      • getPos

        public int getPos()
        Get the current character position
        Returns:
        The current character position (starting at 1)
      • setPos

        public void setPos​(int n)
        Set the current character position
        Parameters:
        n - The current character position (starting at 1)
      • setDigit

        public void setDigit​(int n)
        Set the Digit Flag
        Parameters:
        n - The digit flag
      • getDigit

        public int getDigit()
        Get the Digit Flag
        Returns:
        The digit flag
      • setFlag

        public void setFlag​(int n)
        Set the Status flag
        Parameters:
        n - Flag value
      • getFlag

        public int getFlag()
        Get the Status flag
        Returns:
        Flag value
      • length

        public int length()
        Get the length of the string
        Returns:
        String length
      • toString

        public java.lang.String toString()
        Get the string
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string