|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.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 TextBuffer using a flat array implementation. |
static java.text.CharacterIterator |
createCharacterIterator(ReadTextBuffer textBuffer) Constructs a new CharacterIterator wrapper for the given text buffer instance so that the buffer can be used with a BreakIterator in 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 TextBuffer using a gap buffer implementation. |
static java.io.Reader |
createReader(ReadTextBuffer textBuffer) Constructs a new Reader wrapper for the given text buffer instance so that the buffer can be read using the Reader API. |
static java.io.Reader |
createReader(ReadTextBuffer textBuffer, int startOffset) Constructs a new Reader wrapper for the given text buffer instance so that the buffer can be read using the Reader API. |
static TextBuffer |
createReadOnlyTextBufferWrapper(TextBuffer textBuffer) Creates a read-only wrapper that implements the TextBuffer interface around the specified interface. |
static ReadTextBuffer |
createReadTextBuffer(char[] dataSource) Creates a 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. |
static ReadTextBuffer |
createReadTextBuffer(java.lang.String dataSource) Creates a 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. |
static TextBuffer |
createTextBuffer() Creates a new empty instance of the TextBuffer using a default implementation. |
static TextBuffer |
createTextBuffer(ReadWriteLock lockToUse) Creates a new empty instance of the TextBuffer using 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 instanceTextBuffer
instanceReadWriteLock
public 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 wrappublic 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 dataSourceReadTextBuffer
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 dataSourceReadTextBuffer
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 ofpublic 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 ofpublic 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 ofpublic 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 Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |