DRCL JavaSim API

drcl.ruv
Class Term

java.lang.Object
  |
  +--drcl.DrclObj
        |
        +--drcl.comp.Component
              |
              +--drcl.ruv.Term
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, RUVOutput, java.io.Serializable
Direct Known Subclasses:
Dterm, DtermAWT

public abstract class Term
extends Component
implements RUVOutput

The base class for all terminal classes. Ports

See Also:
Serialized Form

Inner classes inherited from class drcl.comp.Component
Component.LockPack
 
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, lockHead, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
Term()
           
Term(java.lang.String id_)
           
 
Method Summary
protected abstract  void _write(java.lang.String msg_)
          Puts the message on the terminal.
protected  void addCmdToHistory(java.lang.String cmd_)
           
protected  void autocomplete(java.lang.String cmd_, int pos_)
           
protected  void diagnoze(java.lang.String cmd_)
           
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
protected  boolean evalCommand(java.lang.String cmd_)
          Return false if the previous command is not finished yet.
protected  void evalFile(java.lang.String filename_)
           
 void exit()
          Exits the terminal.
protected  java.lang.String getHistory(int increment_)
           
protected  java.lang.String getHistoryDown(java.lang.String partial_)
          Returns the most early command in history from the current position down that starts with partial_.
protected  int getHistorySize()
           
protected  java.lang.String getHistoryUp(java.lang.String partial_)
          Returns the most recent command in history from the current position up that starts with partial_.
protected  java.lang.String getPrompt()
           
 java.lang.String getTitle()
           
abstract  void hide()
           
protected  java.lang.String historySubList(int start_)
           
protected  java.lang.String historySubList(int start_, int end_)
           
 java.lang.String info()
          Returns information regarding this component.
protected  void interrupt()
           
abstract  boolean isFocused()
           
static boolean isOutBoundCommand(java.lang.String cmd_)
           
 boolean isOutputEnabled()
          Returns true if the terminal is enabled to output via the "output" port.
protected  boolean isPrevousCommandFinished()
           
 boolean isStdoutEnabled()
          Returns true if the terminal is enabled to output to the stdout device.
 boolean isTerminalDisplayEnabled()
          Returns true if the terminal is enabled to display output.
 void process(java.lang.Object data_, Port inPort_)
          The main callback method of a component.
 void quit()
          Quits the application.
 void reset()
          Resets the component for being used anew.
 void RUVOutput(java.lang.String msg_)
          Implements the RUVOutput interface.
protected  void saveHistory(java.io.BufferedWriter bw_)
           
protected abstract  void setCommand(java.lang.String newCmd_, int pos_)
           
 void setOutputEnabled(boolean enabled_)
          Enables/disables output via the "output" port.
protected  void setPrompt(java.lang.String prompt_)
           
 void setStdoutEnabled(boolean enabled_)
          Enables/disables output to the stdout device.
 void setTerminalDisplayEnabled(boolean enabled_)
          Enables/disables terminal output display.
 void setTitle(java.lang.String title_)
           
abstract  void show()
           
 void write(java.lang.String msg_)
          Puts the message on the terminal.
 
Methods inherited from class drcl.comp.Component
_resume, _start, _stop, addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, componentAdded, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, finishing, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getForkManager, getID, getName, getParent, getPort, getPort, getRoot, getRuntime, getTime, iduplicate, isAncestorOf, isComponentNotificationEnabled, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortNotificationEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, portAdded, portRemoved, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setComponentNotificationEnabled, setContract, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setPortNotificationEnabled, setPortRemovable, setRuntime, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Term

public Term()

Term

public Term(java.lang.String id_)
Method Detail

reset

public void reset()
Description copied from class: Component
Resets the component for being used anew. All the internal variables must be set to the initial state. All the ports and child components are reset as well.
Overrides:
reset in class Component

info

public java.lang.String info()
Description copied from class: Component
Returns information regarding this component. Subclasses should override this method to provide useful information at run-time.
Overrides:
info in class Component

process

public void process(java.lang.Object data_,
                    Port inPort_)
Description copied from class: Component
The main callback method of a component. Being invoked when data arrives at a port of its.
Overrides:
process in class Component
Following copied from class: drcl.comp.Component
Parameters:
data_ - the arrival data.
inPort_ - the port where the data arrives.

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.
Overrides:
duplicate in class Component

isStdoutEnabled

public boolean isStdoutEnabled()
Returns true if the terminal is enabled to output to the stdout device.

setStdoutEnabled

public void setStdoutEnabled(boolean enabled_)
Enables/disables output to the stdout device.

isOutputEnabled

public boolean isOutputEnabled()
Returns true if the terminal is enabled to output via the "output" port.

setOutputEnabled

public void setOutputEnabled(boolean enabled_)
Enables/disables output via the "output" port.

isTerminalDisplayEnabled

public boolean isTerminalDisplayEnabled()
Returns true if the terminal is enabled to display output.

setTerminalDisplayEnabled

public void setTerminalDisplayEnabled(boolean enabled_)
Enables/disables terminal output display.

write

public final void write(java.lang.String msg_)
Puts the message on the terminal. Subclasses should override _write(String) to implement their own display mechanism.

_write

protected abstract void _write(java.lang.String msg_)
Puts the message on the terminal. Subclasses should override this method to implement their own display mechanism.

RUVOutput

public final void RUVOutput(java.lang.String msg_)
Implements the RUVOutput interface.
Specified by:
RUVOutput in interface RUVOutput

show

public abstract void show()

hide

public abstract void hide()

isFocused

public abstract boolean isFocused()

setCommand

protected abstract void setCommand(java.lang.String newCmd_,
                                   int pos_)

setTitle

public void setTitle(java.lang.String title_)

getTitle

public java.lang.String getTitle()

setPrompt

protected void setPrompt(java.lang.String prompt_)

getPrompt

protected java.lang.String getPrompt()

evalCommand

protected final boolean evalCommand(java.lang.String cmd_)
Return false if the previous command is not finished yet.

evalFile

protected final void evalFile(java.lang.String filename_)

isPrevousCommandFinished

protected final boolean isPrevousCommandFinished()

isOutBoundCommand

public static final boolean isOutBoundCommand(java.lang.String cmd_)

autocomplete

protected final void autocomplete(java.lang.String cmd_,
                                  int pos_)

interrupt

protected final void interrupt()

exit

public void exit()
Exits the terminal. Subclasses must call super if overriding this method.

quit

public void quit()
Quits the application. Subclasses must call super if overriding this method.

getHistorySize

protected int getHistorySize()

addCmdToHistory

protected void addCmdToHistory(java.lang.String cmd_)

getHistory

protected java.lang.String getHistory(int increment_)

getHistoryUp

protected java.lang.String getHistoryUp(java.lang.String partial_)
Returns the most recent command in history from the current position up that starts with partial_.
Returns:
null if no such command is found.

getHistoryDown

protected java.lang.String getHistoryDown(java.lang.String partial_)
Returns the most early command in history from the current position down that starts with partial_.
Returns:
null if no such command is found.

historySubList

protected java.lang.String historySubList(int start_)

historySubList

protected java.lang.String historySubList(int start_,
                                          int end_)

saveHistory

protected void saveHistory(java.io.BufferedWriter bw_)

diagnoze

protected void diagnoze(java.lang.String cmd_)

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~