|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.javatools.buffer.CharArrayReadTextBuffer
public final class CharArrayReadTextBuffer
The CharArrayReadTextBuffer is a wrapper implementation
that provides a ReadTextBuffer interface on top of a
String datasource. This class is for convenience so
that a String instance can be used where a
ReadTextBuffer is required, such as for the parser
package.
This is declared package-private intentionally as it is an
implementation, and not part of the published API. To create
a new instance, use the TextBufferFactory.
ReadTextBuffer| Field Summary |
|---|
| Fields inherited from interface oracle.javatools.buffer.ReadTextBuffer |
|---|
LOCK_STATUS_NONE, LOCK_STATUS_READ, LOCK_STATUS_UNSUPPORTED, LOCK_STATUS_WRITE |
| Constructor Summary | |
|---|---|
CharArrayReadTextBuffer(char[] dataSource)
Constructs a CharArrayReadTextBuffer to provide a
ReadTextBuffer implementation around a String. |
|
| Method Summary | |
|---|---|
char |
getChar(int offset)
Fetches the character from the given offset. |
char[] |
getChars(int offset,
int length)
Fetches a number of characters from the indicated offset in the buffer. |
int |
getLength()
Fetches the number of characters in this buffer. |
int |
getLockStatus()
Fetch the lock status for the current thread only. |
java.lang.String |
getString(int offset,
int length)
Fetches a number of characters from the indicated offset in the buffer and returns it as a String. |
void |
getText(int offset,
int length,
javax.swing.text.Segment segment)
Fetches the text contained within the given section of the TextBuffer The Segment object is
provided by the caller. |
void |
readLock()
Attempts to acquire a read lock on this text buffer for the purposes of reading the buffer - this is a blocking call. |
void |
readUnlock()
Releases a held read lock on this text buffer. |
boolean |
tryReadLock()
Attempts to acquire a read lock on this buffer in a non-blocking manner. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CharArrayReadTextBuffer(char[] dataSource)
CharArrayReadTextBuffer to provide a
ReadTextBuffer implementation around a String. This
is declared package-private intentionally as it is not part of
the published API.
dataSource - the String to use as the data| Method Detail |
|---|
public int getLength()
getLength in interface ReadTextBuffer
public char getChar(int offset)
throws java.lang.IndexOutOfBoundsException
getChar in interface ReadTextBufferoffset - the offset in the buffer to get the character from
java.lang.IndexOutOfBoundsException - if offset is invalid
public char[] getChars(int offset,
int length)
throws java.lang.IndexOutOfBoundsException
getChars in interface ReadTextBufferoffset - the offset in the buffer to start fromlength - number of characters to fetch
java.lang.IndexOutOfBoundsException - if offset or length are invalid
public java.lang.String getString(int offset,
int length)
throws java.lang.IndexOutOfBoundsException
getString in interface ReadTextBufferoffset - the offset in the buffer to start fromlength - number of characters to fetch
java.lang.IndexOutOfBoundsException - if offset or length are invalid
public void getText(int offset,
int length,
javax.swing.text.Segment segment)
throws java.lang.IndexOutOfBoundsException
TextBuffer The Segment object is
provided by the caller.
getText in interface ReadTextBufferoffset - the offset into the buffer representing the desired
start of the data >= 0length - the length of the desired data >= 0segment - the caller's Segment object to return the data in
java.lang.IndexOutOfBoundsExceptionDocument.getText(int, int)public void readLock()
readLock in interface ReadTextBufferTextBuffer.getLineMap(),
TextBuffer.writeLock()public boolean tryReadLock()
tryReadLock in interface ReadTextBufferReadTextBuffer.readLock()public void readUnlock()
readUnlock in interface ReadTextBufferpublic int getLockStatus()
getLockStatus in interface ReadTextBuffer
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||