Class ParseState


  • class ParseState
    extends java.lang.Object
    Since:
    22.08.2006
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int pos  
      private java.lang.String str  
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseState​(java.lang.String str)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char ch()  
      char ch​(int index)  
      int gatherInt​(java.lang.String errorMsg, int maxValue)
      Parses a integer from the source and sets the pointer after it.
      boolean hasNext()  
      int length()  
      int pos()  
      void skip()
      Skips the next char.
      • Methods inherited from class java.lang.Object

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

      • str

        private java.lang.String str
      • pos

        private int pos
    • Constructor Detail

      • ParseState

        public ParseState​(java.lang.String str)
        Parameters:
        str - initializes the parser container
    • Method Detail

      • length

        public int length()
        Returns:
        Returns the length of the input.
      • hasNext

        public boolean hasNext()
        Returns:
        Returns whether there are more chars to come.
      • ch

        public char ch​(int index)
        Parameters:
        index - index of char
        Returns:
        Returns char at a certain index.
      • ch

        public char ch()
        Returns:
        Returns the current char or 0x0000 if there are no more chars.
      • skip

        public void skip()
        Skips the next char.
      • pos

        public int pos()
        Returns:
        Returns the current position.
      • gatherInt

        public int gatherInt​(java.lang.String errorMsg,
                             int maxValue)
                      throws XMPException
        Parses a integer from the source and sets the pointer after it.
        Parameters:
        errorMsg - Error message to put in the exception if no number can be found
        maxValue - the max value of the number to return
        Returns:
        Returns the parsed integer.
        Throws:
        XMPException - Thrown if no integer can be found.