| 
 | Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.4.0) E17493-05 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.javatools.buffer.TextBufferFactory
public final class TextBufferFactory
The TextBufferFactory is a static factory class for
 creating TextBuffer instances for use.  This is done
 in order to separate our published API from our implementation
 details from TextBuffer clients. 
| Method Summary | |
|---|---|
| static TextBuffer | createArrayTextBuffer()Creates a new empty instance of the TextBufferusing
 a flat array implementation. | 
| static java.text.CharacterIterator | createCharacterIterator(ReadTextBuffer textBuffer)Constructs a new CharacterIteratorwrapper for the
 given text buffer instance so that the buffer can be used with
 aBreakIteratorin the java.text package. | 
| static TextBuffer | createExpirableTextBufferSnapshot(TextBuffer textBuffer)Constructs an expirable snapshot of the specified TextBuffer. | 
| static TextBuffer | createGapTextBuffer()Creates a new empty instance of the TextBufferusing
 a gap buffer implementation. | 
| static java.io.Reader | createReader(ReadTextBuffer textBuffer)Constructs a new Readerwrapper for the given
 text buffer instance so that the buffer can be read using theReaderAPI. | 
| static java.io.Reader | createReader(ReadTextBuffer textBuffer,
             int startOffset)Constructs a new Readerwrapper for the given
 text buffer instance so that the buffer can be read using theReaderAPI. | 
| static TextBuffer | createReadOnlyTextBufferWrapper(TextBuffer textBuffer)Creates a read-only wrapper that implements the TextBufferinterface around the specified
 interface. | 
| static ReadTextBuffer | createReadTextBuffer(char[] dataSource)Creates a ReadTextBufferwrapper implementation for
 the givenStringdata source so that it can be
 used with other classes that accept aReadTextBuffersuch as the parser package. | 
| static ReadTextBuffer | createReadTextBuffer(java.lang.String dataSource)Creates a ReadTextBufferwrapper implementation for
 the givenStringdata source so that it can be
 used with other classes that accept aReadTextBuffersuch as the parser package. | 
| static TextBuffer | createTextBuffer()Creates a new empty instance of the TextBufferusing
 a default implementation. | 
| static TextBuffer | createTextBuffer(ReadWriteLock lockToUse)Creates a new empty instance of the TextBufferusing
 a default implementation. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static TextBuffer createTextBuffer()
TextBuffer using
 a default implementation.  The current default is to use a gap
 implementation. 
TextBuffer instancecreateGapTextBuffer()public static TextBuffer createTextBuffer(ReadWriteLock lockToUse)
TextBuffer using
 a default implementation.  The current default is to use a gap
 implementation. The specified lock will be used for locking for the buffer. This allows clients to coordinate locking with that used by the TextBuffer.
lockToUse - the ReadWriteLock instance to use for this buffer
        instance
TextBuffer instanceReadWriteLockpublic static TextBuffer createArrayTextBuffer()
TextBuffer using
 a flat array implementation.  This implementation uses a flat
 array with extra space at the end to store the data.  This performs
 well when the buffer contains nearly static data as it requires
 less overhead when accessing (reading) the buffer as compared
 to the gap implementation.
TextBuffer instancepublic static TextBuffer createGapTextBuffer()
TextBuffer using
 a gap buffer implementation.  This implementation uses an array
 containing a gap to store the data.  This performs well for
 typical edits which are frequently clustered together. 
TextBuffer instancepublic static TextBuffer createReadOnlyTextBufferWrapper(TextBuffer textBuffer)
TextBuffer interface around the specified
 interface.  This wrapper can be provided to other clients (like
 an editor) to allow it to read the contents of the text buffer,
 but not modify it.
textBuffer - the source text buffer to wrap
public static ReadTextBuffer createReadTextBuffer(java.lang.String dataSource)
ReadTextBuffer wrapper implementation for
 the given String data source so that it can be
 used with other classes that accept a ReadTextBuffer
 such as the parser package.
dataSource - the String dataSource
ReadTextBuffer wrapper instancepublic static ReadTextBuffer createReadTextBuffer(char[] dataSource)
ReadTextBuffer wrapper implementation for
 the given String data source so that it can be
 used with other classes that accept a ReadTextBuffer
 such as the parser package.
dataSource - the String dataSource
ReadTextBuffer wrapper instancepublic static java.text.CharacterIterator createCharacterIterator(ReadTextBuffer textBuffer)
CharacterIterator wrapper for the
 given text buffer instance so that the buffer can be used with
 a BreakIterator in the java.text package.  It is
 the responsibility of the caller to guarantee that the contents
 of the text buffer do not change for the duration that this
 CharacterIterator is used.
textBuffer - the text buffer to provide a CharacterIterator
        wrapper on top of
public static java.io.Reader createReader(ReadTextBuffer textBuffer)
Reader wrapper for the given
 text buffer instance so that the buffer can be read using the
 Reader API.  Note that as long as the Reader
 wrapper is open, the text buffer will be held with a read lock.
 Clients should make sure to close() the
 Reader when it is no longer needed.
textBuffer - the text buffer to provide a Reader wrapper on top of
public static java.io.Reader createReader(ReadTextBuffer textBuffer,
                                          int startOffset)
Reader wrapper for the given
 text buffer instance so that the buffer can be read using the
 Reader API.  Note that as long as the Reader
 wrapper is open, the text buffer will be held with a read lock.
 Clients should make sure to close() the
 Reader when it is no longer needed.
textBuffer - the text buffer to provide a Reader wrapper on top of
public static TextBuffer createExpirableTextBufferSnapshot(TextBuffer textBuffer)
TextBuffer.
 This snapshot provides access to the contents of the buffer as long
 as the buffer has not been modified since the snapshot was created.  Once
 the buffer is modified, any access through the snapshot will generate
 an ExpiredTextBufferException.  Note the only supported
 operations on this snapshot are for fetching the buffer contents or
 buffer attributes.  All other operations will generate an
 UnsupportedOperationException.
textBuffer - the textbuffer to create a snapshot on top of
| 
 | Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.4.0) E17493-05 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||