PrintGame
Class InstructionList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byPrintGame.InstructionList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class InstructionList
extends java.util.ArrayList

class represting a List of instructions which are excecuted by the turing machine.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
InstructionList()
           
 
Method Summary
 void addInstruction(Instruction instruction)
          method adds an instruction at the end of an instruction list.
 void addInstructionAtPos(int index, Instruction instruction)
          method adds an instruction at the specified position to the instruction list.
 Instruction getInstructionAtPos(int index)
          method gets an instruction at the specified position in the instruction list.
 void removeInstructionAtPos(int index)
          method removes the instruction at the specified position.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

InstructionList

public InstructionList()
Method Detail

addInstruction

public void addInstruction(Instruction instruction)
method adds an instruction at the end of an instruction list.

Parameters:
instruction - instruction to insert

addInstructionAtPos

public void addInstructionAtPos(int index,
                                Instruction instruction)
method adds an instruction at the specified position to the instruction list.

Parameters:
index - zero based position of the element to add.
instruction - instruction to insert

getInstructionAtPos

public Instruction getInstructionAtPos(int index)
method gets an instruction at the specified position in the instruction list.

Parameters:
index - zero based position of the requested instruction.

removeInstructionAtPos

public void removeInstructionAtPos(int index)
method removes the instruction at the specified position.

Parameters:
index - zero based position of the element to remove.