DRCL J-Sim API

drcl.comp.lib
Class Talk

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.comp.lib.Talk
All Implemented Interfaces:
ActiveComponent, java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class Talk
extends Component
implements ActiveComponent

A simple chat client component. It is a frame with two areas inside: a display area and an input area. Whenever a line is formed in the input area, the line is sent out from the "inout" port. And whenever a message is received from the port, it is displayed in the display area. Ports (in addition to those defined in drcl.comp.Component):

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static java.lang.String INOUT_PORT_ID
           
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
Talk()
          Constructor.
Talk(java.lang.String id_)
          Constructor.
 
Method Summary
 void duplicate(java.lang.Object source_)
          Copies the content from the source_ to this component.
 java.lang.String info()
          Script interface which reveals the internal states of the component.
 boolean isAnonymous()
           
 boolean isEchoEnabled()
           
 void process(java.lang.Object data_, Port inPort_)
          Invoked when data_ arrives this component at the inPort_ port.
 void reset()
          Resets this component to the initial state for use anew.
 void setAnonymous(boolean v_)
           
 void setDisplaySize(int rows_, int cols_)
          Sets the number of rows and columns of the display text area.
 void setEchoEnabled(boolean v_)
           
 void setInputSize(int rows_, int cols_)
          Sets the number of rows and columns of the input text area.
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INOUT_PORT_ID

public static final java.lang.String INOUT_PORT_ID
See Also:
Constant Field Values
Constructor Detail

Talk

public Talk()
Constructor.


Talk

public Talk(java.lang.String id_)
Constructor.

Method Detail

process

public void process(java.lang.Object data_,
                    Port inPort_)
Invoked when data_ arrives this component at the inPort_ port.

Parameters:
data_ - the arrival data.
inPort_ - the port where the data arrives.

reset

public void reset()
Resets this component to the initial state for use anew. Must call super.reset() in the beginning.

Overrides:
reset in class Component

duplicate

public void duplicate(java.lang.Object source_)
Copies the content from the source_ to this component. Must call super.duplicate() in the beginning.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Component

info

public java.lang.String info()
Script interface which reveals the internal states of the component. It is for debugging and demonstration purpose.

Overrides:
info in class Component

setAnonymous

public void setAnonymous(boolean v_)

isAnonymous

public boolean isAnonymous()

setEchoEnabled

public void setEchoEnabled(boolean v_)

isEchoEnabled

public boolean isEchoEnabled()

setDisplaySize

public void setDisplaySize(int rows_,
                           int cols_)
Sets the number of rows and columns of the display text area. The number of columns also affects that of the input text area.

Parameters:
rows_ - number of rows; no effect if nonpositive value is given.
cols_ - number of columns; no effect if nonpositive value is given.

setInputSize

public void setInputSize(int rows_,
                         int cols_)
Sets the number of rows and columns of the input text area. The number of columns also affects that of the display text area.

Parameters:
rows_ - number of rows; no effect if nonpositive value is given.
cols_ - number of columns; no effect if nonpositive value is given.

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~