gnu.jemacs.buffer
Class Buffer
java.lang.Object
|
+--gnu.jemacs.buffer.Buffer
- Direct Known Subclasses:
- ReplBuffer
- public class Buffer
- extends java.lang.Object
|
Constructor Summary |
Buffer(java.lang.String name)
|
|
Method Summary |
void |
backwardChar(int i)
|
int |
charWidth(char ch,
int column)
|
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. |
void |
deleteChar(int count)
|
Window |
display(boolean notThisWindow,
Frame frame)
|
static Buffer |
findFile(java.lang.String fname)
|
void |
forwardChar(int i)
|
static java.lang.String |
generateNewBufferName(java.lang.String start)
|
static Buffer |
getBuffer(java.lang.String name)
|
BufferContent |
getContent()
|
static Buffer |
getCurrent()
|
int |
getDot()
|
java.lang.String |
getFileName()
|
java.lang.String |
getName()
|
int |
getPoint()
|
Marker |
getPointMarker(boolean share)
|
void |
insert(char ch,
int count,
javax.swing.text.Style style)
Insert count copies of ch at point. |
void |
insert(java.lang.String string,
javax.swing.text.Style style)
|
void |
insertFile(java.io.Reader in)
|
void |
insertFile(java.lang.String filename)
|
int |
lineStartOffset()
|
int |
lineStartOffset(int offset)
|
int |
maxDot()
|
int |
minDot()
|
int |
moveToColumn(int column,
boolean force)
|
int |
positionToOffset(java.lang.Object position)
Convert an Emacs position (Marker, Position, or 1-origin integer)
to a (0-origin) buffer offset. |
void |
redrawModeline()
|
void |
remove(int start,
int count)
|
void |
removeAll()
|
void |
removeRegion(int start,
int end)
|
void |
save()
|
void |
save(java.io.Writer out)
|
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. |
static void |
setCurrent(Buffer buffer)
|
void |
setDot(int i)
|
void |
setFileName(java.lang.String fname)
|
void |
setPoint(int i)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
keymap
public final BufferKeymap keymap
buffers
public static java.util.Hashtable buffers
- Map buffer names to buffer.s
fileBuffers
public static java.util.Hashtable fileBuffers
- Map file names to buffer.s
Buffer
public Buffer(java.lang.String name)
getName
public java.lang.String getName()
getFileName
public java.lang.String getFileName()
getContent
public BufferContent getContent()
setFileName
public void setFileName(java.lang.String fname)
findFile
public static Buffer findFile(java.lang.String fname)
getBuffer
public static Buffer getBuffer(java.lang.String name)
coerceBuffer
public static Buffer coerceBuffer(java.lang.Object buf)
generateNewBufferName
public static java.lang.String generateNewBufferName(java.lang.String start)
redrawModeline
public void redrawModeline()
getCurrent
public static Buffer getCurrent()
setCurrent
public static void setCurrent(Buffer buffer)
getDot
public final int getDot()
getPoint
public int getPoint()
setDot
public final void setDot(int i)
setPoint
public final void setPoint(int i)
minDot
public int minDot()
maxDot
public int maxDot()
forwardChar
public void forwardChar(int i)
backwardChar
public void backwardChar(int i)
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
insert
public void insert(java.lang.String string,
javax.swing.text.Style style)
insert
public void insert(char ch,
int count,
javax.swing.text.Style style)
- Insert count copies of ch at point.
deleteChar
public void deleteChar(int count)
remove
public void remove(int start,
int count)
throws javax.swing.text.BadLocationException
removeRegion
public void removeRegion(int start,
int end)
throws javax.swing.text.BadLocationException
removeAll
public void removeAll()
getPointMarker
public Marker getPointMarker(boolean share)
positionToOffset
public int positionToOffset(java.lang.Object position)
- Convert an Emacs position (Marker, Position, or 1-origin integer)
to a (0-origin) buffer offset.
save
public void save(java.io.Writer out)
throws java.io.IOException,
javax.swing.text.BadLocationException
save
public void save()
insertFile
public void insertFile(java.io.Reader in)
throws java.io.IOException,
javax.swing.text.BadLocationException
insertFile
public void insertFile(java.lang.String filename)
charWidth
public int charWidth(char ch,
int column)
countColumns
public int countColumns(char[] chars,
int start,
int count,
int initial)
currentColumn
public int currentColumn()
currentColumn
public int currentColumn(int offset)
- Return the column number at a specified offset.
moveToColumn
public int moveToColumn(int column,
boolean force)
lineStartOffset
public int lineStartOffset(int offset)
lineStartOffset
public int lineStartOffset()
scan
public final 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.
If COUNT is positive, search forwards; END must be >= START.
If COUNT is negative, search backwards for the -COUNTth instance;
END must be <= START.
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).
- Returns:
- (SHORTAGE<<32|POS)
display
public Window display(boolean notThisWindow,
Frame frame)