org.dyncle
Class Port<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by org.dyncle.Port<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess

public class Port<T>
extends java.util.ArrayList<T>

Port of component

Author:
h-nakagawa Ver 1.01: add component reference (2011.6.1)
See Also:
Serialized Form

Field Summary
static int _EXCLUSIVE_MODE_
           
static int _QUEUE_MODE_
           
static int _STACK_MODE_
           
 
Constructor Summary
Port(java.lang.String name, PortType type)
           
Port(java.lang.String name, PortType type, ComponentBehaviour aComp)
           
 
Method Summary
 T get()
          Gets an object from the port.
 ComponentBehaviour getComponent()
           
 java.lang.String getName()
           
 Port<T> getPairPort()
           
 int getPriority()
           
 PortType getType()
           
 boolean isArrive()
          Check whether objects are stored in the port buffer.
 boolean isConnected()
          Check whether the port is connected with other port or not.
 void put(T obj)
           
 void setComponent(ComponentBehaviour comp)
           
 void setMode(int mode)
           
 void setPairPort(Port<?> pairPort)
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, 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, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

_EXCLUSIVE_MODE_

public static final int _EXCLUSIVE_MODE_
See Also:
Constant Field Values

_QUEUE_MODE_

public static final int _QUEUE_MODE_
See Also:
Constant Field Values

_STACK_MODE_

public static final int _STACK_MODE_
See Also:
Constant Field Values
Constructor Detail

Port

public Port(java.lang.String name,
            PortType type,
            ComponentBehaviour aComp)

Port

public Port(java.lang.String name,
            PortType type)
Method Detail

setMode

public void setMode(int mode)

put

public void put(T obj)
         throws PortException
Throws:
PortException

get

public T get()
      throws PortException
Gets an object from the port. Acquired object is removed from the port buffer.

Returns:
Object
Throws:
PortException

isConnected

public boolean isConnected()
Check whether the port is connected with other port or not.

Returns:
true if the port is connected with other port.

isArrive

public boolean isArrive()
Check whether objects are stored in the port buffer.

Returns:
true if the port buffer stores objects.

getPairPort

public Port<T> getPairPort()

setPairPort

public void setPairPort(Port<?> pairPort)

getName

public java.lang.String getName()

getType

public PortType getType()

getComponent

public ComponentBehaviour getComponent()

setComponent

public void setComponent(ComponentBehaviour comp)

getPriority

public int getPriority()