public T getLastOp() { if (lastElement != null) { return lastElement.getOp(); } return null; }
public List<T> getOps() { // this is a rather braindead way around the limitation that we can't explicitly // create an T[] array object ArrayList<T> list = new ArrayList<T>(); for (TraceElement<T> te = lastElement; te != null; te = te.prevElement) { list.add(te.getOp()); } // reverse for (int i = 0, j = list.size() - 1; i < j; i++, j--) { T tmp = list.get(j); list.set(j, list.get(i)); list.set(i, tmp); } return list; }