noope.core
Class Laws

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--noope.core.Laws
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class Laws
extends java.util.Vector

This class maintains a list of Law objects. It is a subclass of Vector, and as such it implements the List interface. In addition to the normal Vector element accessor methods, Law objects are referable by a String name, using the getLaw(String) method - this is only used when initialising the LawPropertyRecords of Entity objects. The Law objects to be stored are constructed and added to the Laws object by the Physics() constructor, using a BlockReader.

Version:
28-Apr-2001 Removed ListIterator for compatibility with Java 1.1 [Miklos Reiter]
Author:
James Kermode
See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Laws(BlockReader br, Physics phys)
          Constructs the Laws object from the supplied BlockReader.
 
Method Summary
 void dispose()
          Disposes of resources by calling dispose() on each of the Laws stored in the List.
 Law getLaw(java.lang.String lawname)
          Return a Law identified by the a string, or throw a LawNotFoundException if this Law does not exist.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Laws

public Laws(BlockReader br,
            Physics phys)
     throws BRLoadingException
Constructs the Laws object from the supplied BlockReader. This should be the laws{...} block from the main BlockReader. This constructor will only be called by the Physics(BlockReader) constructor.
Parameters:
br - BlockReader used to read in the Law objects
phys - Physics object passed on to Law() constructors
Throws:
BRLoadingException - if invalid data is read from the BlockReader
See Also:
Law.Law(BlockReader, int, Physics)
Method Detail

getLaw

public Law getLaw(java.lang.String lawname)
           throws LawNotFoundException
Return a Law identified by the a string, or throw a LawNotFoundException if this Law does not exist.
Parameters:
lawname - search for a Law whose getName() returns lawname
Throws:
LawNotFoundException - if the Law is not found

dispose

public void dispose()
Disposes of resources by calling dispose() on each of the Laws stored in the List.