|
||||||||||
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.ModelList.Iterator | +--edu.rice.cs.drjava.model.definitions.reducedmodel.TokenList.Iterator
Field Summary | |
private int |
_offset
|
Fields inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.ModelList.Iterator |
_point, _pos |
Constructor Summary | |
|
TokenList.Iterator()
|
(package private) |
TokenList.Iterator(TokenList.Iterator that)
|
Method Summary | |
private int |
_calculateOffset(int delToSizePrev,
String delToTypePrev,
int delToSizeCurr,
String delToTypeCurr,
TokenList.Iterator delTo)
By contrasting the delTo token after the walk to what it was before the walk we can see how it has changed and where the offset should go. |
private boolean |
_checkPrevEquals(TokenList.Iterator delTo,
String match)
Checks if the previous token is of a certain type. |
TokenList.Iterator |
_copy()
Makes a fresh copy of this TokenList.Iterator. |
private int |
_delete(int count,
TokenList.Iterator copyCursor)
Helper function for delete. |
private int |
_move(int count,
int currentOffset)
Helper function for move(int). |
private int |
_moveLeft(int count,
int currentOffset)
Helper function that performs forward moves. |
private int |
_moveRight(int count,
int currentOffset)
Helper function that performs forward moves. |
(package private) void |
_splitCurrentIfCommentBlock(boolean splitClose,
boolean splitEscape)
Splits the current brace if it is a multiple character brace and fulfills certain conditions. |
(package private) void |
clipLeft()
Gets rid of extra text. |
(package private) void |
clipRight()
Gets rid of extra text. |
Object |
current()
Return the item associated with the current node. |
void |
delete(int count)
Update the BraceReduction to reflect text deletion. |
(package private) int |
deleteRight(TokenList.Iterator delTo)
Deletes from offset in delFrom to endOffset in delTo. |
int |
getBlockOffset()
|
ReducedModelState |
getStateAtCurrent()
Returns the current commented/quoted state at the cursor. |
void |
insert(Object x0)
Insert an item before the current item. |
(package private) void |
insertBraceToGap(String text)
Handles the details of the case where a brace is inserted into a gap. |
(package private) void |
insertNewBrace(String text)
Helper function to _insertBrace. |
void |
move(int count)
Updates the BraceReduction to reflect cursor movement. |
Object |
nextItem()
Return the item associated with the node after the current node. |
Object |
prevItem()
Return the item associated with the node before the current node. |
void |
setBlockOffset(int offset)
|
void |
setTo(TokenList.Iterator that)
|
String |
toString()
|
(package private) void |
updateBasedOnCurrentState()
The walk function. |
Methods inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.ModelList.Iterator |
atEnd, atFirstItem, atLastItem, atStart, collapse, copy, dispose, eq, next, notifyOfCollapse, notifyOfInsert, notifyOfRemove, prev, remove, setTo |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int _offset
Constructor Detail |
public TokenList.Iterator()
TokenList.Iterator(TokenList.Iterator that)
Method Detail |
public TokenList.Iterator _copy()
public void setTo(TokenList.Iterator that)
public int getBlockOffset()
public void setBlockOffset(int offset)
public ReducedModelState getStateAtCurrent()
void insertBraceToGap(String text)
void insertNewBrace(String text)
void _splitCurrentIfCommentBlock(boolean splitClose, boolean splitEscape)
void updateBasedOnCurrentState()
public void move(int count)
count
- indicates the direction and magnitude of cursor movementprivate int _move(int count, int currentOffset)
count
- the number of chars to move. Negative values move back,
positive values move forward.currentOffset
- the current offset for copyCursorprivate int _moveRight(int count, int currentOffset)
private int _moveLeft(int count, int currentOffset)
public void delete(int count)
Update the BraceReduction to reflect text deletion.
count
- indicates the size and direction of text deletion.
Negative values delete text to the left of the cursor, positive
values delete text to the right.
Always move count spaces to make sure we can delete.private int _delete(int count, TokenList.Iterator copyCursor)
count
- size of deletionoffset
- current offset for cursordelFrom
- where to delete fromdelTo
- where to delete tovoid clipLeft()
void clipRight()
int deleteRight(TokenList.Iterator delTo)
private int _calculateOffset(int delToSizePrev, String delToTypePrev, int delToSizeCurr, String delToTypeCurr, TokenList.Iterator delTo)
private boolean _checkPrevEquals(TokenList.Iterator delTo, String match)
delTo
- the cursor for calling prevItem onmatch
- the type we want to checkpublic String toString()
toString
in class Object
public void insert(Object x0)
ModelList.Iterator
insert
in class ModelList.Iterator
public Object nextItem()
ModelList.Iterator
nextItem
in class ModelList.Iterator
public Object prevItem()
ModelList.Iterator
prevItem
in class ModelList.Iterator
public Object current()
ModelList.Iterator
current
in class ModelList.Iterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |