fr.emn.reactiveinput
Class In

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

public class In
extends Slot

Input slot.

** Input slot states: **

During design, the following assertions are true:

isValid(t) -> isConnected(t)

During execution (inside init() and update() methods), the following assertions are true:

isObligatory(t) -> hasValue(t) -> isValid(t)

hasSignal(t) -> hasValue(t) -> isValid(t)

isObligatory(t) isObligatory(t+1)

isValid(t) isValid(t+1)

hasValue(t) -> hasValue(t+1)


Field Summary
 
Fields inherited from class fr.emn.reactiveinput.Slot
description, dynamic, help, mutable, name, owner, supertype, type
 
Constructor Summary
In(Device owner, java.lang.String name, int type, boolean obligatory)
          USE: Design.
In(MutableDevice owner, java.lang.String name, int supertype, boolean obligatory, boolean mutable)
          USE: Design.
In(MutableDevice owner, java.lang.String name, int supertype, boolean obligatory, boolean mutable, boolean dynamic)
          USE: Design.
 
Method Summary
 boolean getBooleanValue()
          USE: Execution.
 Out getConnected()
          REMOVE.
 int getConnectedType()
          USE: Design.
 double getDoubleValue()
          USE: Execution.
 int getIntValue()
          USE: Execution.
 java.lang.Object getObjectValue()
          USE: Execution.
 java.lang.String getStringValue()
          USE: Execution.
 boolean hasSignal()
          USE: Execution.
 boolean hasValue()
          USE: Execution.
 boolean isConnected()
          USE: Design.
 boolean isObligatory()
          USE: Design / Execution.
 boolean isValid()
          USE: Design / Execution.
 
Methods inherited from class fr.emn.reactiveinput.Slot
flatten, flatten, flatten, getDescription, getHelp, getName, getParent, getProperties, getSupertype, getType, isDynamic, isMutable, remove, rename, setDescription, setHelp, setInfo, setProperties, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

In

public In(Device owner,
          java.lang.String name,
          int type,
          boolean obligatory)
USE: Design.


In

public In(MutableDevice owner,
          java.lang.String name,
          int supertype,
          boolean obligatory,
          boolean mutable)
USE: Design. If mutable==true, a mutable slot is created.


In

public In(MutableDevice owner,
          java.lang.String name,
          int supertype,
          boolean obligatory,
          boolean mutable,
          boolean dynamic)
USE: Design.

Method Detail

getBooleanValue

public boolean getBooleanValue()
USE: Execution.


getConnected

public Out getConnected()
REMOVE. (This method should not be public).


getConnectedType

public int getConnectedType()
USE: Design.

This gives the type of connected slot. This is used in Mutable Devices to adapt themselves to connected devices.

This method returns the type of the connected Output Slot, or Slot.NULL if it's not connected.

Throws NonMutableException if this slot is not mutable.

Specified by:
getConnectedType in class Slot

getDoubleValue

public double getDoubleValue()
USE: Execution.


getIntValue

public int getIntValue()
USE: Execution.


getObjectValue

public java.lang.Object getObjectValue()
USE: Execution.


getStringValue

public java.lang.String getStringValue()
USE: Execution.


hasSignal

public boolean hasSignal()
USE: Execution. Returns true if this slot has received a signal during the current tick. This may signify that its value has changed.

Returns false if this slot has not received a signal during the current tick or if it is not valid.


hasValue

public boolean hasValue()
USE: Execution. Returns true if this slot's value has been initialized.

Returns false if this slot has no value yet or is not valid (which also means that it will never receive a value).


isConnected

public boolean isConnected()
USE: Design. Returns true if this slot is connected to an output slot.

Used in mutable devices. To test a slot validity, use isValid() instead.


isObligatory

public boolean isObligatory()
USE: Design / Execution. Returns true if this input slot is obligatory, i.e. must have a value before device's init() method is called by the reactive machine.


isValid

public boolean isValid()
USE: Design / Execution. Returns true if this slot will be able to receive values.

An input slot is valid if it is properly connected to a compatible output slot (compatibility = COMPATIBLE_ALWAYS or COMPATIBLE_FOR_NOW), and if this output slot is valid itself.

!! Don't retrieve values from an input slot before checking isValid(), hasValue() or hasSignal(). This never happens with obligatory input slots, but may happen with optional input slots.

Specified by:
isValid in class Slot