fr.emn.reactiveinput
Class Slot

java.lang.Object
  extended byfr.emn.reactiveinput.Slot
Direct Known Subclasses:
In, Out

public abstract class Slot
extends java.lang.Object

Superclass for In/Out slots.


Field Summary
protected  java.lang.String description
           
protected  boolean dynamic
           
protected  java.lang.String help
           
protected  boolean mutable
           
protected  java.lang.String name
           
protected  Device owner
           
protected  int supertype
           
protected  int type
           
 
Method Summary
static In[] flatten(In in)
          Returns an array of equivalent slots belonging to non-compound nodes
static In[] flatten(In[] ins)
          Returns an array of equivalent slots belonging to non-(pin/compound) nodes
static Out flatten(Out out)
          Returns the equivalent slot belonging to a non-(pin/compound) node
abstract  int getConnectedType()
          This gives the type of connected slot.
 java.lang.String getDescription()
           
 java.lang.String getHelp()
           
 java.lang.String getName()
           
 Device getParent()
           
 SlotProperties getProperties()
           
 int getSupertype()
          This is used to recall the original type of a mutable slot (i.e. the one that was assigned to the slot when created).
 int getType()
          The slot's type may be different from the type of its shared value (but it must be a subtype).
 boolean isDynamic()
          Returns true if this slot is dynamic, i.e. if it can been added/removed after the device's constructor has been called.
 boolean isMutable()
          Returns true if this slot is mutable, i.e. if its type can change and/or if its a dynamic slot.
abstract  boolean isValid()
          -- COMMENTAIRE A REVOIR.
 void remove()
          Removes this slot from its device.
 void rename(java.lang.String name)
          Rename the slot.
 void setDescription(java.lang.String description)
           
 void setHelp(java.lang.String help)
           
 void setInfo(java.lang.String description, java.lang.String help)
           
 void setProperties(SlotProperties properties)
           
 void setType(int type)
          USE: Design.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

owner

protected Device owner

mutable

protected final boolean mutable

dynamic

protected final boolean dynamic

name

protected java.lang.String name

description

protected java.lang.String description

help

protected java.lang.String help

supertype

protected int supertype

type

protected int type
Method Detail

getConnectedType

public abstract int getConnectedType()
This gives the type of connected slot. This is used in Mutable Devices to adapt themselves to connected devices.


getDescription

public java.lang.String getDescription()

getHelp

public java.lang.String getHelp()

getName

public java.lang.String getName()

getParent

public Device getParent()

getProperties

public SlotProperties getProperties()

getSupertype

public int getSupertype()
This is used to recall the original type of a mutable slot (i.e. the one that was assigned to the slot when created).


getType

public int getType()
The slot's type may be different from the type of its shared value (but it must be a subtype). REVOIR CE COMMENTAIRE.


isDynamic

public boolean isDynamic()
Returns true if this slot is dynamic, i.e. if it can been added/removed after the device's constructor has been called.

Only mutable slots can be dynamic.


isMutable

public boolean isMutable()
Returns true if this slot is mutable, i.e. if its type can change and/or if its a dynamic slot.


isValid

public abstract boolean isValid()
-- COMMENTAIRE A REVOIR. Returns true if values can be set/retrieved on this slot.

In an output slot, values (setXXXValue) can not be set if this method returns false. Usually, this happens when the slot is of type ANY.

In an input slot, values (getXXXValue) can not be retrieved if this method returns false. Usually, this is because the slot is of type AN


remove

public void remove()
Removes this slot from its device.

This methods unaffect slot's parent, to make it unusable.

Throws NonMutableException if this slot is not mutable.


rename

public void rename(java.lang.String name)
Rename the slot.

Throws NonMutableException if this slot is not mutable.


setDescription

public void setDescription(java.lang.String description)

setHelp

public void setHelp(java.lang.String help)

setInfo

public void setInfo(java.lang.String description,
                    java.lang.String help)

setProperties

public void setProperties(SlotProperties properties)

setType

public void setType(int type)
USE: Design. Changes the type of this slot.

Throws NonMutableException if this slot is not mutable.

Throws IllegalTypeException if the type you try to assign is not a subtype of the original slot's type.

Throws NetworkStartedException if not in design mode.


toString

public java.lang.String toString()

flatten

public static In[] flatten(In in)
Returns an array of equivalent slots belonging to non-compound nodes


flatten

public static In[] flatten(In[] ins)
Returns an array of equivalent slots belonging to non-(pin/compound) nodes


flatten

public static Out flatten(Out out)
Returns the equivalent slot belonging to a non-(pin/compound) node