| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_SIZE
Default size is 60, like in emacs. |
| private int | |
| private boolean | |
| private boolean | |
| private final String[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addBackwards(String
the string to add str)Adds the string to the kill-ring product of killing backwards. |
| public boolean | |
| private void | |
| private void | |
| public void | |
| public void | |
| public String | |
| public String | Returns: the text in the previous positionMoves the pointer to the current slot back and returns the text in that position. |
| DEFAULT_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_SIZE Default size is 60, like in emacs. | |
| head | back to summary |
|---|---|
| private int head | |
| lastKill | back to summary |
|---|---|
| private boolean lastKill | |
| lastYank | back to summary |
|---|---|
| private boolean lastYank | |
| slots | back to summary |
|---|---|
| private final String[] slots | |
| KillRing | back to summary |
|---|---|
| public KillRing(int size) Creates a new kill ring of the given size.
| |
| KillRing | back to summary |
|---|---|
| public KillRing() Creates a new kill ring of the default size. See | |
| add | back to summary |
|---|---|
| public void add(String str) Adds the string to the kill-ring. Also sets lastYank to false and lastKill to true.
| |
| addBackwards | back to summary |
|---|---|
| public void addBackwards(String str) Adds the string to the kill-ring product of killing backwards. If the previous command was a kill text one then adds the text at the beginning of the previous kill to avoid that two consecutive backwards kills followed by a yank leaves things reversed.
| |
| lastYank | back to summary |
|---|---|
| public boolean lastYank() Returns
| |
| next | back to summary |
|---|---|
| private void next() Moves the pointer to the current slot forward. If the end of the slots is reached then points back to the beginning. | |
| prev | back to summary |
|---|---|
| private void prev() Moves the pointer to the current slot backwards. If the beginning of the slots is reached then traverses the slot backwards until one with not null content is found. | |
| resetLastKill | back to summary |
|---|---|
| public void resetLastKill() Resets the last-kill state. | |
| resetLastYank | back to summary |
|---|---|
| public void resetLastYank() Resets the last-yank state. | |
| yank | back to summary |
|---|---|
| public String yank() Yanks a previously killed text. Returns
| |
| yankPop | back to summary |
|---|---|
| public String yankPop() Moves the pointer to the current slot back and returns the text in that position. If the previous command was not yank returns null.
| |