public abstract class Buffer extends AbstractSequence<Char> implements CharSeq
Modifier and Type | Field and Description |
---|---|
EKeymap[] |
activeKeymaps |
static java.util.Hashtable |
buffers
Map buffer names to buffers.
|
static java.util.Hashtable |
fileBuffers
Map file names to buffer.s
|
Marker |
markMarker |
Marker |
pointMarker |
noInts
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE
Constructor and Description |
---|
Buffer(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
backwardChar(int i) |
char |
charAt(int index)
The index is in terms of code units.
|
int |
charWidth(char ch,
int column) |
int |
checkMark() |
static Buffer |
coerceBuffer(java.lang.Object buf) |
int |
countColumns(char[] chars,
int start,
int count,
int initial) |
int |
currentColumn() |
int |
currentColumn(int offset)
Return the column number at a specified offset.
|
EWindow |
display(boolean notThisWindow,
EFrame frame) |
static Buffer |
findFile(java.lang.String fname) |
void |
forwardChar(int i) |
int |
forwardLine(int lines) |
long |
forwardLine(int lines,
int start)
Find the position a give number of lines forward or backward.
|
static java.lang.String |
generateNewBufferName(java.lang.String start) |
static Buffer |
getBuffer(java.lang.String name) |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
Copy characters into a destination buffer.
|
static Buffer |
getCurrent() |
int |
getDot() |
java.lang.String |
getFileName() |
abstract int |
getLength() |
EKeymap |
getLocalKeymap() |
Marker |
getMarkMarker(boolean force) |
java.lang.String |
getName() |
gnu.kawa.io.Path |
getPath() |
int |
getPoint() |
Marker |
getPointMarker(boolean share) |
boolean |
getReadOnly() |
abstract CharSeq |
getStringContent() |
void |
insert(char[] chars,
int offset,
int count,
java.lang.Object style,
int ipos)
Insert character with given style at position pair.
|
void |
insert(java.lang.Object value,
java.lang.Object style) |
void |
insert(java.lang.String string,
java.lang.Object style) |
abstract void |
insert(java.lang.String string,
java.lang.Object style,
int ipos)
Insert string with given style at position pair.
|
void |
insertAll(java.lang.Object[] values,
java.lang.Object style) |
void |
insertChar(int ch,
int count)
Insert count copies of ch at point.
|
void |
insertChar(int ch,
int count,
java.lang.Object style)
Insert count copies of ch at point.
|
abstract void |
insertFile(java.io.Reader in) |
void |
insertFile(java.lang.String filename) |
abstract void |
invoke(java.lang.Runnable doRun)
This is intended for Runnable's that may affect the state of the buffer.
|
int |
length()
Get length of string, in code units (not characters).
|
int |
lineStartOffset() |
abstract int |
lineStartOffset(int offset) |
static void |
makeBufferLocal(java.lang.Object symbol,
boolean all) |
abstract int |
maxDot() |
int |
minDot() |
int |
moveToColumn(int column,
boolean force) |
abstract gnu.kawa.io.InPort |
openReader(int start,
int count) |
int |
positionToOffset(java.lang.Object position)
Convert an Emacs position (Marker, or 1-origin integer)
to a (0-origin) buffer offset.
|
abstract void |
redrawModeline() |
void |
removeAll() |
void |
removeChar(int count) |
abstract void |
removeRegion(int start,
int end) |
abstract void |
restorePointMark(long pointMark) |
void |
save() |
abstract void |
save(java.io.Writer out) |
abstract long |
savePointMark() |
abstract long |
scan(char target,
int start,
int end,
int count,
boolean allowQuit)
Search in BUF for COUNT instances of the character TARGET between START and END.
|
void |
setCharacterAt(int index,
int ch) |
void |
setCharAt(int index,
char ch) |
static void |
setCurrent(Buffer buffer) |
void |
setDot(int i)
Set the current position (point) (0-origin).
|
void |
setFileName(java.lang.String fname) |
void |
setLocalKeymap(EKeymap map) |
void |
setPath(gnu.kawa.io.Path path) |
void |
setPoint(int i)
Set the current position (point) (1-origin).
|
void |
setReadOnly(boolean readOnly) |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
void |
writeTo(java.lang.Appendable dest) |
void |
writeTo(int start,
int count,
java.lang.Appendable dest)
Append a specified subsequence to an
Appendable . |
add, add, addAll, addAll, addPos, asImmutable, badRank, boundedHash, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
consume
boundedHash
public Marker pointMarker
public Marker markMarker
public static java.util.Hashtable buffers
public static java.util.Hashtable fileBuffers
public EKeymap[] activeKeymaps
public java.lang.String getName()
public gnu.kawa.io.Path getPath()
public void setPath(gnu.kawa.io.Path path)
public java.lang.String getFileName()
public void setFileName(java.lang.String fname)
public abstract CharSeq getStringContent()
public char charAt(int index)
CharSeq
charAt
in interface CharSeq
charAt
in interface java.lang.CharSequence
CharSeq.charAt(int)
public void setCharAt(int index, char ch)
setCharAt
in interface CharSeq
CharSeq.setCharAt(int, char)
public void setCharacterAt(int index, int ch)
setCharacterAt
in interface CharSeq
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
CharSeq
getChars
in interface CharSeq
srcBegin
- source start position, in 16-bit code units.srcEnd
- source end position, in 16-bit code units.dst
- destinationdstBegin
- index (in code units) in dst arrayCharSeq.getChars(int, int, char[], int)
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public void writeTo(int start, int count, java.lang.Appendable dest) throws java.io.IOException
CharSeq
Appendable
.
An allowable implementation is:
dest.append(this, start, start+count)
.
Hence implementors of Appendable
should avoid calling
writeTo
- though they can call getChars
.writeTo
in interface CharSeq
java.io.IOException
CharSeq.writeTo(int, int, Appendable)
public void writeTo(java.lang.Appendable dest) throws java.io.IOException
public static Buffer findFile(java.lang.String fname)
public static Buffer getBuffer(java.lang.String name)
public static Buffer coerceBuffer(java.lang.Object buf)
public static java.lang.String generateNewBufferName(java.lang.String start)
public abstract void redrawModeline()
public int checkMark()
public static Buffer getCurrent()
public static void setCurrent(Buffer buffer)
public int getDot()
public int getPoint()
public void setDot(int i)
public final void setPoint(int i)
public int minDot()
public abstract int getLength()
public final int length()
CharSeq
public abstract int maxDot()
public void forwardChar(int i)
public void backwardChar(int i)
public java.lang.String toString()
toString
in interface CharSeq
toString
in interface java.lang.CharSequence
toString
in class AbstractSequence<Char>
public abstract void insert(java.lang.String string, java.lang.Object style, int ipos)
public void insert(char[] chars, int offset, int count, java.lang.Object style, int ipos)
public void insertAll(java.lang.Object[] values, java.lang.Object style)
public void insert(java.lang.String string, java.lang.Object style)
public void insert(java.lang.Object value, java.lang.Object style)
public void insertChar(int ch, int count)
public void insertChar(int ch, int count, java.lang.Object style)
public void removeChar(int count)
public abstract void removeRegion(int start, int end)
public void removeAll()
public Marker getPointMarker(boolean share)
public Marker getMarkMarker(boolean force)
public int positionToOffset(java.lang.Object position)
public abstract void insertFile(java.io.Reader in) throws java.lang.Exception
java.lang.Exception
public abstract void save(java.io.Writer out) throws java.lang.Exception
java.lang.Exception
public void save()
public void insertFile(java.lang.String filename)
public int charWidth(char ch, int column)
public int countColumns(char[] chars, int start, int count, int initial)
public int currentColumn()
public int currentColumn(int offset)
public int moveToColumn(int column, boolean force)
public abstract int lineStartOffset(int offset)
public int lineStartOffset()
public abstract long scan(char target, int start, int end, int count, boolean allowQuit)
END >= START
is required.
If COUNT is negative, search backwards for the -COUNTth instance;
inn this case END <= START
is required.
If COUNT is zero, do anything you please; run rogue, for all I care.
If END is zero, use beginning or end of (FIXME: accessible part of)
the buffer, as appropriate for the direction indicated by COUNT.
If we find COUNT instances, SHORTAGE is zero, and return the
position after the COUNTth match. Note that for reverse motion
this is not the same as the usual convention for Emacs motion commands.
If we don't find COUNT instances before reaching END, set SHORTAGE
to the number of TARGETs left unfound,
and return (shortage<<32|END)
.(SHORTAGE<<32|POS)
public final long forwardLine(int lines, int start)
lines
- number of lines forward (or backward if negative)start
- initial position (buffer offset)(SHORTAGE<<32|POS)
public int forwardLine(int lines)
public static void makeBufferLocal(java.lang.Object symbol, boolean all)
all
- true if make-variable-buffer-local,
false if make-local-variable FIXMEpublic EKeymap getLocalKeymap()
public void setLocalKeymap(EKeymap map)
public abstract gnu.kawa.io.InPort openReader(int start, int count)
public abstract long savePointMark()
public abstract void restorePointMark(long pointMark)
public abstract void invoke(java.lang.Runnable doRun)
doRun
- public boolean getReadOnly()
public void setReadOnly(boolean readOnly)