designtools
Class ConnectedWires

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

public class ConnectedWires
extends java.util.ArrayList

Lists interconnected wires and stores the circuit component which is the source for the wires. Extends java.util.ArrayList.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ConnectedWires()
          Constructor
 
Method Summary
 void addExclusive(Wire wire)
          Add a wire to the list but only if it wasn't previously a member
 CircuitComponent getSourceComponent()
           
 void setSourceComponent(CircuitComponent component)
          Set the source component for these wires.
 
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

ConnectedWires

public ConnectedWires()
Constructor

Method Detail

setSourceComponent

public void setSourceComponent(CircuitComponent component)
Set the source component for these wires. There will only be one source component or else outputs will have been connected which is illegal.

Parameters:
component - The component whose output connects to this wire group

getSourceComponent

public CircuitComponent getSourceComponent()
Returns:
The source component for this wire collection

addExclusive

public void addExclusive(Wire wire)
Add a wire to the list but only if it wasn't previously a member

Parameters:
wire - The wire to add