|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.extension.Counter
public class Counter
Simple component that transparently passes packets on to the next component , but graphically displays the number of packets that have passed through it.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
static int |
DEFAULT_WAIT_MILLIS
|
static int |
LAST_UNIQUE_COUNT
|
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 |
Constructor Summary | |
---|---|
Counter(Router router,
java.lang.String name)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
The starting point for packet-processing when packets are "pushed" to this component. |
java.lang.String |
getCLabel()
|
CounterView |
getCounterView()
|
int |
getMyUniqueCount()
|
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. |
VertexView |
getView(JGraph graph,
CellMapper mapper)
Override ClackComponent's method to provide for special drawing of the Counter with a CounterView object. |
boolean |
isModifying()
Reports whether this component modifies packets passed through it This value is used by the static checking algorithm used to make sure port connections are valid. |
void |
resetCounter()
|
void |
setCLabel(java.lang.String cLabel)
set the label for the counter |
void |
setCounterView(CounterView v)
|
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 |
---|
createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getColor, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, handlePullRequest, hasError, initializeProperties, isHierarchical, 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 |
---|
public static int PORT_IN
public static int PORT_OUT
public static int DEFAULT_WAIT_MILLIS
public static int LAST_UNIQUE_COUNT
Constructor Detail |
---|
public Counter(Router router, java.lang.String name)
Method Detail |
---|
public void setCounterView(CounterView v)
public CounterView getCounterView()
public int getMyUniqueCount()
public void setCLabel(java.lang.String cLabel)
public java.lang.String getCLabel()
protected void setupPorts(int numPorts)
ClackComponent
setupPorts
in class ClackComponent
numPorts
- the number of ports to createpublic boolean isModifying()
ClackComponent
isModifying
in class ClackComponent
public void acceptPacket(VNSPacket packet, int port_number)
ClackComponent
The starting point for packet-processing when packets are "pushed" to this component.
The default implementation warns that the packet is being ignored.
acceptPacket
in class ClackComponent
packet
- The pushed packetport_number
- The number of the port that this packet is arriving onpublic void resetCounter()
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class ClackComponent
public VertexView getView(JGraph graph, CellMapper mapper)
getView
in class ClackComponent
graph
- the Router Graphmapper
- the CellMapper associated with this Router Graph
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |