Nodenet Problem Set Javadocs

nodenet
Class OutputChannelVector

java.lang.Object
  extended bynodenet.OutputChannelVector
All Implemented Interfaces:
java.io.Serializable

public class OutputChannelVector
extends java.lang.Object
implements java.io.Serializable

OutputChannelVector is something which acts like a Vector of OutputChannels instead of Objects.

The methods of this class were previously synchronized, but Sun's Vector class uses synchronized methods. Since our only data field is the already synchronized Vector, locking on this object is redundant.

Copyright (c) 1998 Massachusetts Institute of Technology

Version:
$Id: OutputChannelVector.java,v 1.7 2004/01/14 20:23:21 gus Exp $
Author:
Todd C. Parnell, tparnell@ai.mit.edu
See Also:
Serialized Form

Constructor Summary
OutputChannelVector(Node owner)
          Constructs a new OutputChannelVector
 
Method Summary
 void addElement(OutputChannel obj)
          Adds an object to the OutputChannelVector.
 boolean contains(java.lang.Object elem)
          Checks to see if it contains an element.
 OutputChannel elementAt(int index)
          Returns the OutputChannel at a certain index.
 java.util.Enumeration elements()
          Transforms OutputChannelVector into yet another type of collection of objects, called an Enumeration.
 OutputChannel firstElement()
          Returns the first OutputChannel in the OutputChannelVector.
 Node getOwner()
          Find out who the owner of this object is.
 boolean isEmpty()
          Returns true if the OutputChannelVector is empty.
 OutputChannel lastElement()
          Returns the last OutputChannel in the OutputChannelVector.
 void removeAllElements()
          Removes all elements from the OutputChannelVector.
 boolean removeElement(OutputChannel obj)
          Removes a specific element from the OutputChannelVector.
 int size()
          Returns the size of the InputChannelVector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputChannelVector

public OutputChannelVector(Node owner)
Constructs a new OutputChannelVector

Method Detail

getOwner

public Node getOwner()
Find out who the owner of this object is.

Returns:
a reference to the owning Node

addElement

public final void addElement(OutputChannel obj)
Adds an object to the OutputChannelVector.


contains

public final boolean contains(java.lang.Object elem)
Checks to see if it contains an element.


elementAt

public final OutputChannel elementAt(int index)
Returns the OutputChannel at a certain index.

Parameters:
index - index of the OutputChannel being looked up

elements

public final java.util.Enumeration elements()
Transforms OutputChannelVector into yet another type of collection of objects, called an Enumeration.


firstElement

public final OutputChannel firstElement()
Returns the first OutputChannel in the OutputChannelVector.


isEmpty

public final boolean isEmpty()
Returns true if the OutputChannelVector is empty.


lastElement

public final OutputChannel lastElement()
Returns the last OutputChannel in the OutputChannelVector.


removeAllElements

public final void removeAllElements()
Removes all elements from the OutputChannelVector.


removeElement

public final boolean removeElement(OutputChannel obj)
Removes a specific element from the OutputChannelVector.

Parameters:
obj - the object being removed

size

public final int size()
Returns the size of the InputChannelVector.


Nodenet Problem Set Javadocs