|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.jagrlib.BasicChannel
public class BasicChannel
Simple Channel implementation. HashSets are used for left- and
right-side connections.
| Field Summary | |
|---|---|
protected java.lang.Object |
leftInterface
Interface object for the left-side (called by right-side Piece[s]). |
protected java.lang.String |
leftInterfaceName
Fully-qualified interface name of the left side (called from the right side). |
protected java.util.HashSet<Plug> |
leftSet
Set of Plugs connected to the left side. |
protected java.lang.Object |
rightInterface
Interface object for the right-side (called by left-side Piece[s]). |
protected java.lang.String |
rightInterfaceName
Fully-qualified interface name of the right side (called from the left side). |
protected java.util.HashSet<Plug> |
rightSet
Set of Plugs connected to the right side. |
| Constructor Summary | |
|---|---|
BasicChannel(java.lang.String _leftInterfaceName,
java.lang.String _rightInterfaceName)
Initializing constructor. |
|
| Method Summary | |
|---|---|
void |
connectAnti(Plug newPlug,
Plug antiPlug)
Connects a new Plug to the opposite Channel-side. |
void |
connectLeft(Plug newPlug)
Connects a new Plug to the left Channel-side. |
void |
connectPro(Plug newPlug,
Plug proPlug)
Connects a new Plug to the same Channel-side. |
void |
connectRight(Plug newPlug)
Connects a new Plug to the right Channel-side. |
void |
disconnect(Plug oldPlug)
Disconnects the old Plug from the Channel. |
void |
disconnectAll()
Disconnects all Plugs from the Channel. |
Plug[] |
getAnti(Plug antiPlug)
Returns the array of opposite-side objects ( Plugs). |
java.lang.Object |
getInterface(Plug caller)
Returns the interface object of the given Channel-side. |
java.lang.String |
getInterfaceNameAnti(Plug antiPlug)
Returns an interface name of the opposite Channel-side. |
java.lang.String |
getInterfaceNamePro(Plug proPlug)
Returns an interface name of the same Channel-side. |
Plug[] |
getLeft()
Returns the array of left-side objects ( Plugs). |
int |
getLeftCount()
Returns the left Channel-side count. |
java.lang.Object |
getLeftInterface()
Returns the interface object of the left Channel-side. |
java.lang.String |
getLeftInterfaceName()
Returns an interface name of the left Channel-side. |
Plug[] |
getPro(Plug proPlug)
Returns the array of same-side objects ( Plugs). |
Plug[] |
getRight()
Returns the array of right-side objects ( Plugs). |
int |
getRightCount()
Returns the right Channel-side count. |
java.lang.Object |
getRightInterface()
Returns the interface object of the right Channel-side. |
java.lang.String |
getRightInterfaceName()
Returns an interface name of the right Channel-side. |
boolean |
isLeft(Plug oldPlug)
Is the given Plug connected to the left Channel-side? |
boolean |
isRight(Plug oldPlug)
Is the given Plug connected to the right Channel-side? |
boolean |
prepare()
Prepares the Channel to regular operation. |
java.lang.Object |
setInterface(java.lang.Object newInterface,
Plug called)
Sets new interface object for the given Channel-side. |
void |
setInterfaceNames(java.lang.String _leftInterfaceName,
java.lang.String _rightInterfaceName)
(Re-)initialize both interface names. |
java.lang.Object |
setLeftInterface(java.lang.Object newLeftInterface)
Sets new interface object for the left Channel-side. |
java.lang.Object |
setRightInterface(java.lang.Object newRightInterface)
Sets new interface object for the right Channel-side. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String leftInterfaceName
protected java.lang.Object leftInterface
Piece[s]).
protected java.util.HashSet<Plug> leftSet
Plugs connected to the left side.
protected java.lang.String rightInterfaceName
protected java.lang.Object rightInterface
Piece[s]).
protected java.util.HashSet<Plug> rightSet
Plugs connected to the right side.
| Constructor Detail |
|---|
public BasicChannel(java.lang.String _leftInterfaceName,
java.lang.String _rightInterfaceName)
_leftInterfaceName - Fully-qualified interface name of the left side (called
from the right side)._rightInterfaceName - Fully-qualified interface name of the right side (called
from the left side).setInterfaceNames(java.lang.String, java.lang.String)| Method Detail |
|---|
public void setInterfaceNames(java.lang.String _leftInterfaceName,
java.lang.String _rightInterfaceName)
setInterfaceNames in interface Channel_leftInterfaceName - Fully-qualified interface name of the left side (called
from the right side)._rightInterfaceName - Fully-qualified interface name of the right side (called
from the left side).getLeftInterfaceName(),
getRightInterfaceName()public java.lang.String getLeftInterfaceName()
getLeftInterfaceName in interface ChannelsetInterfaceNames(java.lang.String, java.lang.String),
getRightInterfaceName()public java.lang.String getRightInterfaceName()
getRightInterfaceName in interface ChannelsetInterfaceNames(java.lang.String, java.lang.String),
getLeftInterfaceName()public java.lang.String getInterfaceNamePro(Plug proPlug)
getInterfaceNamePro in interface ChannelproPlug - The Plug connected to the same side.
getInterfaceNameAnti(cz.cuni.jagrlib.Plug)public java.lang.String getInterfaceNameAnti(Plug antiPlug)
getInterfaceNameAnti in interface ChannelantiPlug - The Plug connected to the opposite side.
getInterfaceNamePro(cz.cuni.jagrlib.Plug)public java.lang.Object setLeftInterface(java.lang.Object newLeftInterface)
setLeftInterface in interface ChannelnewLeftInterface - New interface object (= object called from the opposite side).
null.setRightInterface(java.lang.Object),
setInterface(java.lang.Object, cz.cuni.jagrlib.Plug)public java.lang.Object setRightInterface(java.lang.Object newRightInterface)
setRightInterface in interface ChannelnewRightInterface - New interface object (= object called from the opposite side).
null.setLeftInterface(java.lang.Object),
setInterface(java.lang.Object, cz.cuni.jagrlib.Plug)
public java.lang.Object setInterface(java.lang.Object newInterface,
Plug called)
Plug connected to it.
setInterface in interface ChannelnewInterface - New interface object (= object called from the opposite side).called - The Plug defining the side.
null.setLeftInterface(java.lang.Object),
setRightInterface(java.lang.Object)public java.lang.Object getLeftInterface()
getLeftInterface in interface Channelnull.setLeftInterface(java.lang.Object)public java.lang.Object getRightInterface()
getRightInterface in interface Channelnull.setRightInterface(java.lang.Object)public java.lang.Object getInterface(Plug caller)
Plug which calls it.
getInterface in interface Channelcaller - The Plug defining the opposite (caller) side.
null.setInterface(java.lang.Object, cz.cuni.jagrlib.Plug)public void connectLeft(Plug newPlug)
Plug to the left Channel-side.
Updates the Plug's Piece, too.
connectLeft in interface ChannelnewPlug - The Plug to be connected.connectRight(cz.cuni.jagrlib.Plug)public void connectRight(Plug newPlug)
Plug to the right Channel-side.
connectRight in interface ChannelnewPlug - The Plug to be connected.connectLeft(cz.cuni.jagrlib.Plug)
public void connectPro(Plug newPlug,
Plug proPlug)
Plug to the same Channel-side.
connectPro in interface ChannelnewPlug - The Plug to be connected.proPlug - The Plug connected to the same side.connectAnti(cz.cuni.jagrlib.Plug, cz.cuni.jagrlib.Plug)
public void connectAnti(Plug newPlug,
Plug antiPlug)
Plug to the opposite Channel-side.
connectAnti in interface ChannelnewPlug - The Plug to be connected.antiPlug - The Plug connected to the opposite side.connectPro(cz.cuni.jagrlib.Plug, cz.cuni.jagrlib.Plug)public void disconnect(Plug oldPlug)
Plug from the Channel.
disconnect in interface ChanneloldPlug - The Plug to be disconnected.disconnectAll()public void disconnectAll()
Plugs from the Channel.
disconnectAll in interface Channeldisconnect(cz.cuni.jagrlib.Plug)public int getLeftCount()
getLeftCount in interface ChannelPlugs connected to that side).getRightCount()public int getRightCount()
getRightCount in interface ChannelPlugs connected to that side).getLeftCount()public boolean isLeft(Plug oldPlug)
Plug connected to the left Channel-side?
isLeft in interface ChanneloldPlug - The checked Plug.
Plug is connected to the left side.isRight(cz.cuni.jagrlib.Plug)public boolean isRight(Plug oldPlug)
Plug connected to the right Channel-side?
isRight in interface ChanneloldPlug - The checked Plug.
Plug is connected to the right side.isLeft(cz.cuni.jagrlib.Plug)public Plug[] getLeft()
Plugs).
getLeft in interface ChannelPlugs connected to the left side.public Plug[] getRight()
Plugs).
getRight in interface ChannelPlugs connected to the right side.public Plug[] getPro(Plug proPlug)
Plugs).
getPro in interface ChannelproPlug - The Plug connected to the same side.
Plugs.public Plug[] getAnti(Plug antiPlug)
Plugs).
getAnti in interface ChannelantiPlug - The Plug connected to the opposite side.
Plugs.public boolean prepare()
Channel to regular operation.
prepare in interface ChannelChannel is prepared
for operation).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||