java.text

Class ParsePosition

public class ParsePosition extends Object

This class is used to keep track of the current position during parsing operations.
Constructor Summary
ParsePosition(int index)
This method initializes a new instance of ParsePosition to have the specified initial index value.
Method Summary
booleanequals(Object obj)
This method tests the specified object for equality with this object.
intgetErrorIndex()
This method returns the error index value.
intgetIndex()
This method returns the current parsing index.
inthashCode()
Return the hash code for this object.
voidsetErrorIndex(int error_index)
This method sets the error index to the specified value.
voidsetIndex(int index)
This method sets the current parsing index to the specified value.
StringtoString()
This method returns a String representation of this object.

Constructor Detail

ParsePosition

public ParsePosition(int index)
This method initializes a new instance of ParsePosition to have the specified initial index value.

Parameters: index The initial parsing index.

Method Detail

equals

public boolean equals(Object obj)
This method tests the specified object for equality with this object. The two objects will be considered equal if and only if all of the following conditions are met.

Parameters: obj The Object to test for equality against this object.

Returns: true if the specified object is equal to this object, false otherwise.

getErrorIndex

public int getErrorIndex()
This method returns the error index value. This value defaults to -1 unless explicitly set to another value.

Returns: The error index.

getIndex

public int getIndex()
This method returns the current parsing index.

Returns: The current parsing index

hashCode

public int hashCode()
Return the hash code for this object.

Returns: the hash code

setErrorIndex

public void setErrorIndex(int error_index)
This method sets the error index to the specified value.

Parameters: error_index The new error index

setIndex

public void setIndex(int index)
This method sets the current parsing index to the specified value.

Parameters: index The new parsing index.

toString

public String toString()
This method returns a String representation of this object.

Returns: A String that represents this object.