public final void append(Token t) { if (fFirst == null) { fFirst = t; fLast = t; } else { fLast.setNext(t); fLast = t; } t.setNext(null); }
void cutAfter(Token l) { if (l == null) { fFirst = null; fLast = null; } else { l.setNext(null); fLast = l; } }
public final void prepend(TokenList prepend) { final Token first = prepend.fFirst; if (first != null) { final Token last = prepend.fLast; last.setNext(fFirst); fFirst = first; if (fLast == null) { fLast = last; } } }
public final void appendAll(TokenList tl) { final Token t = tl.first(); if (t != null) { if (fFirst == null) { fFirst = tl.fFirst; } else { fLast.setNext(tl.fFirst); } fLast = tl.fLast; } tl.fFirst = null; tl.fLast = null; }
final void removeBehind(Token l) { if (l == null) { Token t = fFirst; if (t != null) { t = (Token) t.getNext(); fFirst = t; if (t == null) { fLast = null; } } } else { final Token r = (Token) l.getNext(); if (r != null) { l.setNext(r.getNext()); if (r == fLast) { fLast = l; } } } }