scanner
Class InvalidCharacterEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byscanner.InvalidCharacterEvent
All Implemented Interfaces:
PositionableInCharStream, java.io.Serializable

public class InvalidCharacterEvent
extends java.util.EventObject
implements PositionableInCharStream

This event is thrown when an unexpected character is encountered.

See Also:
Serialized Form

Constructor Summary
InvalidCharacterEvent(java.lang.Object source, char character, CharStreamPosition position)
          Creates a new event with the following parameters.
 
Method Summary
 char getCharacter()
          Returns the invalid character.
 int getLength()
          Returns the length of this positionable object.
 CharStreamPosition getPosition()
          Returns the position where the invalid character has been detected.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidCharacterEvent

public InvalidCharacterEvent(java.lang.Object source,
                             char character,
                             CharStreamPosition position)
Creates a new event with the following parameters.

Parameters:
source - The source that has detected the invalid character.
character - The invalid character.
position - The position where the invalid character has been detected.
Method Detail

getCharacter

public char getCharacter()
Returns the invalid character.

Returns:
The invalid character.

getLength

public int getLength()
Description copied from interface: PositionableInCharStream
Returns the length of this positionable object.

Specified by:
getLength in interface PositionableInCharStream
Returns:
The length of this positionable object.

getPosition

public CharStreamPosition getPosition()
Returns the position where the invalid character has been detected.

Specified by:
getPosition in interface PositionableInCharStream
Returns:
The position where the invalid character has been detected.

toString

public java.lang.String toString()