Package apg

Class UdtLib.Alphanum

  • Enclosing class:
    UdtLib

    public static class UdtLib.Alphanum
    extends Parser.UdtCallback
    UDT for recognizing alpha-numeric phrases. Alpha-numeric phrases begin with an alphabetic character a-z or A-Z. Characters after the first may be alphabetic or numeric, 0-9.
    • Constructor Summary

      Constructors 
      Constructor Description
      Alphanum​(Parser p)
      Default constructor.
      Alphanum​(Parser p, char otherChar)
      Constructor defining one other character which is allowed in addition to alpha-numeric after the first.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int callback​(int offset)
      The UDT function.
      • Methods inherited from class java.lang.Object

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

      • Alphanum

        public Alphanum​(Parser p)
        Default constructor.
        Parameters:
        p - the Parser object the UDT is attached to.
      • Alphanum

        public Alphanum​(Parser p,
                        char otherChar)
        Constructor defining one other character which is allowed in addition to alpha-numeric after the first.
        Parameters:
        p - the Parser object the UDT is attached to.
        otherChar - the other character to allow.
    • Method Detail

      • callback

        public int callback​(int offset)
        Description copied from class: Parser.UdtCallback
        The UDT function.
        Specified by:
        callback in class Parser.UdtCallback
        Parameters:
        offset - offset into the input string to the first character of the parsed phrase.
        Returns:
        the matched phrase length, L, or -1 if no phrase was matched. The phrase length must be in the range 0 <= L <=(n-1), where n is the remaining number of characters in the input string.