java.lang.Object | |
↳ | java.text.FieldPosition |
Identifies fields in formatted strings. If a FieldPosition
is passed
to the format method with such a parameter, then the indices will be set to
the start and end indices of the field in the formatted string.
A FieldPosition
can be created by using the integer constants in the
various format classes (for example NumberFormat.INTEGER_FIELD
) or
one of the fields of type Format.Field
.
If more than one field information is needed, the method
formatToCharacterIterator(Object)
should be used.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
FieldPosition for the specified field. | |||||||||||
Constructs a new
FieldPosition for the specified Field
attribute. | |||||||||||
Constructs a new
FieldPosition for the specified Field
attribute and field id. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares the specified object to this field position and indicates if
they are equal.
| |||||||||||
Returns the index of the beginning of the field.
| |||||||||||
Returns the index one past the end of the field.
| |||||||||||
Returns the field which is being identified.
| |||||||||||
Returns the attribute which is being identified.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Sets the index of the beginning of the field.
| |||||||||||
Sets the index of the end of the field.
| |||||||||||
Returns the string representation of this field position.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constructs a new FieldPosition
for the specified field.
field | the field to identify. |
---|
Constructs a new FieldPosition
for the specified Field
attribute.
attribute | the field attribute to identify. |
---|
Constructs a new FieldPosition
for the specified Field
attribute and field id.
attribute | the field attribute to identify. |
---|---|
field | the field to identify. |
Compares the specified object to this field position and indicates if
they are equal. In order to be equal, object
must be an instance
of FieldPosition
with the same field, begin index and end index.
object | the object to compare with this object. |
---|
true
if the specified object is equal to this field
position; false
otherwise.Returns the index of the beginning of the field.
Returns the index one past the end of the field.
Returns the field which is being identified.
Returns the attribute which is being identified.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Sets the index of the beginning of the field.
index | the index of the first character in the field. |
---|
Sets the index of the end of the field.
index | one past the index of the last character in the field. |
---|
Returns the string representation of this field position.