net.clackrouter.example
Class SourceTracker1

java.lang.Object
  extended by net.clackrouter.component.base.ClackComponent
      extended by net.clackrouter.example.SourceTracker1
All Implemented Interfaces:
Alarm

public class SourceTracker1
extends ClackComponent


Nested Class Summary
 
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent
ClackComponent.Waiter
 
Field Summary
static int NUM_PORTS
           
static int PORT_IN
           
static int PORT_OUT
           
 
Fields inherited from class net.clackrouter.component.base.ClackComponent
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view
 
Constructor Summary
SourceTracker1(Router r, java.lang.String name)
           
 
Method Summary
 java.util.Hashtable getCounter()
           
 javax.swing.JPanel getPropertiesView()
          Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state.
 VNSPacket handlePullRequest(int port_number)
          Called when a neighboring component wishes to "pull" a packet from this component.
protected  void setupPorts(int numPorts)
          Allocates an array of ClackPort objects to be used by this component
 
Methods inherited from class net.clackrouter.component.base.ClackComponent
acceptPacket, createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getColor, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, hasError, initializeProperties, isHierarchical, isModifying, log, notifyAlarm, poll, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setView, showErrorDialog, signalError, try_repaint, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT_IN

public static int PORT_IN

PORT_OUT

public static int PORT_OUT

NUM_PORTS

public static int NUM_PORTS
Constructor Detail

SourceTracker1

public SourceTracker1(Router r,
                      java.lang.String name)
Method Detail

setupPorts

protected void setupPorts(int numPorts)
Description copied from class: ClackComponent
Allocates an array of ClackPort objects to be used by this component

Overrides:
setupPorts in class ClackComponent
Parameters:
numPorts - the number of ports to create

getCounter

public java.util.Hashtable getCounter()

handlePullRequest

public VNSPacket handlePullRequest(int port_number)
Description copied from class: ClackComponent

Called when a neighboring component wishes to "pull" a packet from this component.

This function should only be valid for port numbers that are defined as pull ports. This is enforced by the ClackPort class. By default, we return nothing.

Overrides:
handlePullRequest in class ClackComponent
Parameters:
port_number - The port that a packet is being requested on
Returns:
A packet if available for pull, or null

getPropertiesView

public javax.swing.JPanel getPropertiesView()
Description copied from class: ClackComponent
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. This method creates a default property view, and can be overriden to provide custom properties views

Overrides:
getPropertiesView in class ClackComponent
Returns:
this component's property view