/* SCCS - @(#)NslPort.java 1.1 - 10/05/98 - 19:18:30 */ // Copyright: Copyright (c) 1997 University of Southern California Brain Project. // Copyright: This software may be freely copied provided the toplevel // Copyright: COPYRIGHT file is included with each such copy. // Copyright: Email nsl@java.usc.edu. /* * $Log: NslPort.java,v $ * Revision 1.2 1997/07/30 21:19:22 erhan * nsl3.0 * * Revision 1.1.1.1 1997/03/12 22:52:20 nsl * new dir structure * * Revision 1.1.1.1 1997/02/08 00:40:40 nsl * Imported the Source directory * */ // // NslPort.java // ////////////////////////////////////////////////////////////////////// /** * Ports of a nsl module Ports are served as the communication point between modules, either between parent and child module or between sibling modules. The port that supplies data is called outport, while that receives data is called inport. The link between ports is called connection. Outports can have zero or more connection and Inports must have one and only one connection. See NslModule for the connection requirement, @see NslModule, NslConnection */ package nslj.src.lang; abstract public class NslPort { public static final int OUTPORT = 0; public static final int INPORT = 1; protected boolean doubleBuffering; // Double buffering public NslModule owner; String _name; // int _type; // 0->outport 1->inport /* public NslPort(String name, NslNumeric n, int type) { _name = name; _type = type; } */ public NslPort(String name, NslNumeric n) { _name = name; doubleBuffering=true; } public NslPort() {} public NslPort(NslNumeric n) { _name = n.getName(); doubleBuffering=true; } /** *get the name of this port */ public String getName() { return _name; } public void setBuffering(boolean v) { doubleBuffering=v; } public boolean getBuffering() { return doubleBuffering; } /** * get the type (INport or OUTport) of this port * @return NslPort.OUTPORT / NslPort.INPORT */ public int getType() { if(this instanceof NslOutport) return OUTPORT; else return INPORT; } /** * Check if this port is initialized * @return true if initialized. */ abstract public boolean isInitialized(); abstract public NslNumeric getData(); public NslModule getOwner() {return owner;} }