public Collection < Instruction > getInstructions ( ) { return new AbstractCollection < Instruction > ( ) { public Iterator < Instruction > iterator ( ) { return new Iterator < Instruction > ( ) { private Instruction mNext = mFirst ; public boolean hasNext ( ) { return mNext != null ; } public Instruction next ( ) { if ( mNext == null ) { throw new NoSuchElementException ( ) ; } Instruction current = mNext ; mNext = mNext . mNext ; return current ; } public void remove ( ) { throw new UnsupportedOperationException ( ) ; } } ; } public int size ( ) { int count = 0 ; for ( Instruction i = mFirst ; i != null ; i = i . mNext ) { count ++ ; } return count ; } } ; }
Returns an immutable collection of all the instructions in this InstructionList .