|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.assembler.TokenList
Represents the list of tokens in a single line of MIPS code. It uses, but is not a subclass of, ArrayList.
Constructor Summary | |
TokenList()
Constructor for objects of class TokenList |
Method Summary | |
void |
add(Token token)
Adds a Token object to the end of the list. |
java.lang.Object |
clone()
Makes clone (shallow copy) of this token list object. |
Token |
get(int pos)
Returns requested token given position number (starting at 0). |
boolean |
isEmpty()
Returns empty/non-empty status of list. |
void |
remove(int pos)
Removes Token object at specified list position. |
int |
size()
Returns number of tokens in list. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TokenList()
Method Detail |
public Token get(int pos)
pos
- Position in token list.
public int size()
public void add(Token token)
token
- Token object to be added.public void remove(int pos)
pos
- Position in token list. Subsequent Tokens are shifted one position left.
java.lang.IndexOutOfBoundsException
- if pos is < 0 or >= size()public boolean isEmpty()
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |