Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.text
Class Format

java.lang.Object
  extended by oracle.adfnmc.java.text.Format
All Implemented Interfaces:
Serializable, Cloneable

public abstract class Format
extends java.lang.Object
implements Serializable, Cloneable

Format is the abstract superclass of classes which format and parse objects according to Locale specific rules.


Nested Class Summary
static class Format.Field
          This inner class is used to represent Format attributes in the AttributedCharacterIterator that formatToCharacterIterator() method returns in the Format subclasses.
 
Constructor Summary
Format()
          Constructs a new instance of Format.
 
Method Summary
 java.lang.String format(java.lang.Object object)
          Formats the specified object using the rules of this Format.
abstract  java.lang.StringBuffer format(java.lang.Object object, java.lang.StringBuffer buffer, FieldPosition field)
          Formats the specified object into the specified StringBuffer using the rules of this Format.
 java.lang.Object parseObject(java.lang.String string)
          Parse the specified String using the rules of this Format.
abstract  java.lang.Object parseObject(java.lang.String string, ParsePosition position)
          Parse the specified String starting at the index specified by the ParsePosition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Format

public Format()
Constructs a new instance of Format.

Method Detail

format

public final java.lang.String format(java.lang.Object object)
Formats the specified object using the rules of this Format.

Parameters:
object - the object to format
Returns:
the formatted String
Throws:
java.lang.IllegalArgumentException - when the object cannot be formatted by this Format

format

public abstract java.lang.StringBuffer format(java.lang.Object object,
                                              java.lang.StringBuffer buffer,
                                              FieldPosition field)
Formats the specified object into the specified StringBuffer using the rules of this Format. If the field specified by the FieldPosition is formatted, set the begin and end index of the formatted field in the FieldPosition.

Parameters:
object - the object to format
buffer - the StringBuffer
field - the FieldPosition
Returns:
the StringBuffer parameter buffer
Throws:
java.lang.IllegalArgumentException - when the object cannot be formatted by this Format

parseObject

public java.lang.Object parseObject(java.lang.String string)
                             throws ParseException
Parse the specified String using the rules of this Format.

Parameters:
string - the String to parse
Returns:
the object resulting from the parse
Throws:
ParseException - when an error occurs during parsing

parseObject

public abstract java.lang.Object parseObject(java.lang.String string,
                                             ParsePosition position)
Parse the specified String starting at the index specified by the ParsePosition. If the string is successfully parsed, the index of the ParsePosition is updated to the index following the parsed text.

Parameters:
string - the String to parse
position - the ParsePosition, updated on return with the index following the parsed text, or on error the index is unchanged and the error index is set to the index where the error occurred
Returns:
the object resulting from the parse, or null if there is an error

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.