Java APG, Version 1.0
Author Lowell D. Thomas
Copyright © Coast to Coast Research, Inc. 2011

com.coasttocoastresearch.apg
Class UdtLib.WhiteSpace

java.lang.Object
  extended by com.coasttocoastresearch.apg.Parser.UdtCallback
      extended by com.coasttocoastresearch.apg.UdtLib.WhiteSpace
Enclosing class:
UdtLib

public static class UdtLib.WhiteSpace
extends Parser.UdtCallback

UDT for any of several choices for white space characters.


Field Summary
 
Fields inherited from class com.coasttocoastresearch.apg.Parser.UdtCallback
callbackData
 
Constructor Summary
UdtLib.WhiteSpace(Parser parser)
          Default constructor.
UdtLib.WhiteSpace(Parser parser, boolean optional, UdtLib.Comment comment, UdtLib.LineEnd foldingLineEnd)
          General constructor.
 
Method Summary
 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

UdtLib.WhiteSpace

public UdtLib.WhiteSpace(Parser parser)
Default constructor. White space is an optional string of space (x20) or horizontal tab (x09) characters.

Parameters:
parser - the Parser object this UDT is attached to.

UdtLib.WhiteSpace

public UdtLib.WhiteSpace(Parser parser,
                         boolean optional,
                         UdtLib.Comment comment,
                         UdtLib.LineEnd foldingLineEnd)
General constructor. White space always includes the standard white space characters space(x20) or horizontal tab(x09). Optionally white space additionally may include line comments and/or folding white space. Folding white space, found in many Internet standards, is a line end followed by one standard white space character.

Parameters:
parser - the Parser object this UDT is attached to.
optional - if true, the white space is optional, if false at least one white space character or entity is required.
comment - if null, comments are not considered white space, otherwise comment is a Comment class object or any Comment extension object.
foldingLineEnd - if null, folding white space is not allowed. Otherwise folding white space is allowed and foldingLineEnd is a LineEnd class object or any LineEnd extension object.
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.

Java APG, Version 1.0
Author Lowell D. Thomas
Copyright © Coast to Coast Research, Inc. 2011

Licence Notification

All the software in this distribution is free software:
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program in the COPYING file. If not, see GPL, Version 2
or GPL, Version 3 or write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.