net.rim.device.api.i18n
Class FieldPosition

java.lang.Object
  |
  +--net.rim.device.api.i18n.FieldPosition

public class FieldPosition
extends Object

Used by Format and its subclasses to identify fields in formatted output.

You can use this class's functionality to determine where a certain field starts in the formatted String buffer, which you could then use to position a change box over a given field.

Compatible with java.text.FieldPosition from Java's standard edition.


Constructor Summary
FieldPosition(int field)
          Constructs a new FieldPosition instance for a field.
 
Method Summary
 int getBeginIndex()
          Retrieves position of first character in underlying field.
 int getEndIndex()
          Retrieves position of last character in underlying field.
 int getField()
          Retrieves underlying field's ID.
 void setBeginIndex(int beginindex)
          Sets new first character mark.
 void setEndIndex(int endindex)
          Sets new last character mark.
 void setField(int field)
          Sets new underlying field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldPosition

public FieldPosition(int field)
Constructs a new FieldPosition instance for a field.

Parameters:
field - Underlying field for this field position instance.
Method Detail

getBeginIndex

public int getBeginIndex()
Retrieves position of first character in underlying field.

Returns:
Index of first character in underlying field.

getEndIndex

public int getEndIndex()
Retrieves position of last character in underlying field.

Returns:
Index of last character in underlying field.

getField

public int getField()
Retrieves underlying field's ID.

Returns:
Underlying field's ID.

setBeginIndex

public void setBeginIndex(int beginindex)
Sets new first character mark.

Invoke this method to specify the "first" character in the underlying field. Once set, getBeginIndex() returns this value.

Parameters:
beginindex - New first character mark for the underlying field.

setEndIndex

public void setEndIndex(int endindex)
Sets new last character mark.

Invoke this method to specify the "last" character in the underlying field. Once set, getEndIndex() returns this value.

Parameters:
beginindex - New last character mark for the underlying field.

setField

public void setField(int field)
Sets new underlying field.

Invoke this method to set a new underlying field for this position object; this can help you avoid instantiating unnecessary position objects.

Parameters:
field - ID of new underlying field.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.