Jeospace API

org.jeospace.text
Class FieldAttributor

java.lang.Object
  extended byorg.jeospace.text.FieldAttributor

public class FieldAttributor
extends java.lang.Object

The field attributor maps a format StringBuffer's Fields to beginning and ending indices within the buffer. Once the format has completed, this information can then be called upon to initialize a FieldPosition object or to create an AttributedCharacterIterator.

This class is limited to only allowing a single attribute (the Field) per substring. The creation of this class was necessitated by the fact that potentially useful classes, constructors and methods within the java.text package were limited to package accessibility.

Version:
$Revision: 1.1.1.1 $
Author:
Rex Melton

Constructor Summary
protected FieldAttributor()
          Protected Constructor
 
Method Summary
protected  void add(java.text.Format.Field attr, int begin, int end)
          Add a Field - index pair mapping
 void getFieldPosition(java.text.FieldPosition pos)
          Initialize the begin and end indices of the FieldPosition object.
 java.text.AttributedCharacterIterator getIterator()
          Return the AttributedCharacterIterator for the formatted StringBuffer
protected  void initialize(java.lang.StringBuffer buffer)
          Initialize and reset the FieldAttributor's objects to process a new formatting StringBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldAttributor

protected FieldAttributor()
Protected Constructor

Method Detail

initialize

protected void initialize(java.lang.StringBuffer buffer)
Initialize and reset the FieldAttributor's objects to process a new formatting StringBuffer.


add

protected void add(java.text.Format.Field attr,
                   int begin,
                   int end)
Add a Field - index pair mapping


getFieldPosition

public void getFieldPosition(java.text.FieldPosition pos)
Initialize the begin and end indices of the FieldPosition object. The indices will be set to coorespond to a field within the formatted StringBuffer if the buffer contains a field specified in the FieldPosition object. Otherwise the indices are set to 0.


getIterator

public java.text.AttributedCharacterIterator getIterator()
Return the AttributedCharacterIterator for the formatted StringBuffer


Jeospace API

Copyright © 2006 - jeospace.org