|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rice.cs.drjava.model.definitions.reducedmodel.AbstractReducedModel
A refactoring of the common code between ReducedModelComment and ReducedModelBrace. Both of the refactored classes extend this class.
Field Summary | |
(package private) TokenList.Iterator |
_cursor
keeps track of cursor position in document |
(package private) TokenList |
_tokens
A list of ReducedTokens (braces and gaps). |
static char |
PTR_CHAR
The character that represents the cursor in toString(). |
Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates |
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER |
Constructor Summary | |
AbstractReducedModel()
Constructor. |
Method Summary | |
protected void |
_augmentCurrentGap(int length)
Assuming there is a gap to the right, this function increases the size of that gap. |
protected void |
_augmentGapToLeft(int length)
Assuming there is a gap to the left, this function increases the size of that gap. |
protected boolean |
_gapToLeft()
Determines if there is a gap immediately to the left of the cursor. |
protected boolean |
_gapToRight()
Determines there is a Gap immediately to the right of the cursor. |
void |
_insertGap(int length)
Inserts a block of text into the reduced model which has no special consideration in the reduced model. |
protected void |
_insertNewGap(int length)
Helper function for _insertGap. |
(package private) int |
absOffset()
Package private absolute offset for tests. |
protected ReducedToken |
current()
Get the ReducedToken currently pointed at by the cursor. |
(package private) int |
getBlockOffset()
Get the offset into the current ReducedToken. |
protected ReducedModelState |
getStateAtCurrent()
Wrapper for TokenList.Iterator.getStateAtCurrent that returns the current state for some iterator. |
abstract void |
insertChar(char ch)
Inserts a character into the reduced model. |
protected abstract void |
insertGapBetweenMultiCharBrace(int length)
Inserts a gap between a multiple character brace. |
TokenList.Iterator |
makeCopyCursor()
Make a copy of the token list's iterator. |
protected void |
next()
Move to the token immediately right. |
protected void |
prev()
Move to the token immediately left. |
protected abstract void |
resetLocation()
Resets the walker to the current position in document |
(package private) void |
setBlockOffset(int offset)
Change the offset into the current ReducedToken. |
String |
simpleString()
A toString replacement for testing - easier to read. |
protected abstract ReducedModelState |
stateAtRelLocation(int relLocation)
Returns the state at the relLocation, where relLocation is the location relative to the walker |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final char PTR_CHAR
Object.toString()
TokenList _tokens
ModelList
TokenList.Iterator _cursor
ModelList.Iterator
Constructor Detail |
public AbstractReducedModel()
Method Detail |
int getBlockOffset()
void setBlockOffset(int offset)
offset
- the number of characters into the token to set the cursorint absOffset()
public String simpleString()
public abstract void insertChar(char ch)
public void _insertGap(int length)
length
- the length of the inserted textprotected abstract void insertGapBetweenMultiCharBrace(int length)
public TokenList.Iterator makeCopyCursor()
protected ReducedModelState getStateAtCurrent()
protected boolean _gapToRight()
protected boolean _gapToLeft()
protected void _augmentGapToLeft(int length)
length
- the amount of increaseprotected void _augmentCurrentGap(int length)
length
- the amount of increaseprotected void _insertNewGap(int length)
length
- size of gap to insertprotected abstract ReducedModelState stateAtRelLocation(int relLocation)
relLocation
- distance from walker to get state at.protected abstract void resetLocation()
protected ReducedToken current()
protected void next()
protected void prev()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |