java.text

Class FieldPosition

public class FieldPosition extends Object

This class is used by the java.text formatting classes to track field positions. A field position is defined by an identifier value and begin and end index positions. The formatting classes in java.text typically define constant values for the field identifiers.
Constructor Summary
FieldPosition(Format.Field field)
This method initializes a new instance of FieldPosition to have the specified field attribute.
FieldPosition(Format.Field field, int field_id)
This method initializes a new instance of FieldPosition to have the specified field attribute.
FieldPosition(int field_id)
This method initializes a new instance of FieldPosition to have the specified field id.
Method Summary
booleanequals(Object obj)
This method tests this object for equality against the specified object.
intgetBeginIndex()
This method returns the beginning index for this field.
intgetEndIndex()
This method returns the ending index for the field.
intgetField()
This method returns the field identifier value for this object.
Format.FieldgetFieldAttribute()
inthashCode()
This method returns a hash value for this object
voidsetBeginIndex(int begin)
This method sets the beginning index of this field to the specified value.
voidsetEndIndex(int end)
This method sets the ending index of this field to the specified value.
StringtoString()
This method returns a String representation of this object.

Constructor Detail

FieldPosition

public FieldPosition(Format.Field field)
This method initializes a new instance of FieldPosition to have the specified field attribute. The attribute will be used as an id. It is formally equivalent to calling FieldPosition(field, -1).

Parameters: field The field format attribute.

FieldPosition

public FieldPosition(Format.Field field, int field_id)
This method initializes a new instance of FieldPosition to have the specified field attribute. The attribute will be used as an id is non null. The integer field id is only used if the Format.Field attribute is not used by the formatter.

Parameters: field The field format attribute. field_id The field identifier value.

FieldPosition

public FieldPosition(int field_id)
This method initializes a new instance of FieldPosition to have the specified field id.

Parameters: field_id The field identifier value.

Method Detail

equals

public boolean equals(Object obj)
This method tests this object for equality against the specified object. The objects will be considered equal if and only if:

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

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

getBeginIndex

public int getBeginIndex()
This method returns the beginning index for this field.

Returns: The beginning index.

getEndIndex

public int getEndIndex()
This method returns the ending index for the field.

Returns: The ending index.

getField

public int getField()
This method returns the field identifier value for this object.

Returns: The field identifier.

getFieldAttribute

public Format.Field getFieldAttribute()

hashCode

public int hashCode()
This method returns a hash value for this object

Returns: A hash value for this object.

setBeginIndex

public void setBeginIndex(int begin)
This method sets the beginning index of this field to the specified value.

Parameters: begin The new beginning index.

setEndIndex

public void setEndIndex(int end)
This method sets the ending index of this field to the specified value.

Parameters: end The new ending index.

toString

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

Returns: A String representation of this object.