cz.cuni.jagrlib.reg
Class InfoPlug

java.lang.Object
  extended by cz.cuni.jagrlib.reg.InfoPlug
All Implemented Interfaces:
java.lang.Cloneable

public class InfoPlug
extends java.lang.Object
implements java.lang.Cloneable

Information about a plug.

See Also:
InfoPlug.java

Field Summary
 java.lang.String description
          Plug description.
 HashMapChannels channels
          Connected channels.
 InfoPlugGUI infoGUI
          Information about plug's GUI.
 boolean input
          Plug type (input/output).
 InfoPlug linkToOrig
          Link to original plug (for groups).
 boolean mandatory
          Is the plug mandatory?
 boolean multi
          Is the plug is "multi"?
 java.lang.String name
          Name of plug (= interface!).
 java.util.Map<java.lang.String,java.lang.Object> nextInfo
          This is space for all other information.
 InfoModule owner
          Owner of plug.
static java.lang.String TI_PLUG
           
 java.lang.String type
          Type of plug.
 
Constructor Summary
InfoPlug()
          Default constructor.
InfoPlug(InfoPlug ip)
          Creates plug for groups with link to original plug.
InfoPlug(java.lang.String _name, java.lang.String _type, boolean _input, boolean _mandatory, boolean _multi, java.lang.String _description)
          Creates a new InfoPlug.
 
Method Summary
 java.lang.Object clone()
           
 InfoModule getModuleOwner()
          Get owner of the plug.
 int getState()
          Plug state check.
 java.lang.String inputOutput()
           
 boolean isAssigned()
          Tests whether this plug is connected to another plug.
 boolean isFree()
          Tests whether the plug is unconnected or multi-plug: i.e. - if it is posible to connect another channel.
static boolean isOpposite(InfoPlug _plug1, InfoPlug _plug2)
          Tests whether the two plugs are opposite.
 void registryChannel(InfoChannel _channel)
          Registry new connected channel.
 void setAssigned(boolean _assign)
          Set assigning of plug.
 void unregistryChannel(InfoChannel _channel)
          Unregistry connected channel.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Name of plug (= interface!).


type

public java.lang.String type
Type of plug. Unique for one module, used as hash-map key.


input

public boolean input
Plug type (input/output).


mandatory

public boolean mandatory
Is the plug mandatory? (only for output plugs)


multi

public boolean multi
Is the plug is "multi"?


description

public java.lang.String description
Plug description.


owner

public InfoModule owner
Owner of plug. It can be InfoModule.


channels

public HashMapChannels channels
Connected channels.


infoGUI

public InfoPlugGUI infoGUI
Information about plug's GUI.


nextInfo

public java.util.Map<java.lang.String,java.lang.Object> nextInfo
This is space for all other information.


linkToOrig

public InfoPlug linkToOrig
Link to original plug (for groups).


TI_PLUG

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

InfoPlug

public InfoPlug()
Default constructor.


InfoPlug

public InfoPlug(java.lang.String _name,
                java.lang.String _type,
                boolean _input,
                boolean _mandatory,
                boolean _multi,
                java.lang.String _description)
Creates a new InfoPlug.

Parameters:
_name - Name of plug.
_type - Type of plug.
_input - Plug type (input/output).
_mandatory - Flag if the plug is mandatory.
_multi - Flag if the plug is multi.
_description - Description of plug.

InfoPlug

public InfoPlug(InfoPlug ip)
Creates plug for groups with link to original plug.

Parameters:
ip - original plug.
Method Detail

inputOutput

public java.lang.String inputOutput()

registryChannel

public void registryChannel(InfoChannel _channel)
Registry new connected channel.


unregistryChannel

public void unregistryChannel(InfoChannel _channel)
Unregistry connected channel.


isAssigned

public boolean isAssigned()
Tests whether this plug is connected to another plug.

Returns:
true if plug is connected.

setAssigned

public void setAssigned(boolean _assign)
Set assigning of plug.

Parameters:
_assign - New value of assigned.

getModuleOwner

public InfoModule getModuleOwner()
Get owner of the plug.


isOpposite

public static boolean isOpposite(InfoPlug _plug1,
                                 InfoPlug _plug2)
Tests whether the two plugs are opposite.

Parameters:
_plug1 - First plug.
_plug2 - Second plug.
Returns:
true if they are opposite.

getState

public int getState()
Plug state check.

Returns:
One of InfoState constants.
See Also:
InfoState

isFree

public boolean isFree()
Tests whether the plug is unconnected or multi-plug: i.e. - if it is posible to connect another channel.

Returns:
true if it is posible to connect another channel.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object