|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.instantreality.InstantIO.Slot
public abstract class Slot
Abstract superclass of OutSlots and InSlots.
Field Summary | |
---|---|
static int |
In
Gets returned by the getDirection
method when the Slot is an InSlot . |
static int |
Out
Gets returned by the getDirection
method when the Slot is an OutSlot . |
Constructor Summary | |
---|---|
protected |
Slot(java.lang.Class type)
Creates a new Slot object with a type. |
protected |
Slot(java.lang.Class type,
java.lang.String description)
Creates a new Slot object with a type and a description. |
Method Summary | |
---|---|
java.lang.String |
getDescription()
Returns the description of the Slot. |
abstract int |
getDirection()
Returns the direction of the Slot. |
java.lang.Class |
getType()
Returns the type of data that can be sent to or received from this Slot. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int In
getDirection
method when the Slot is an InSlot
.
public static final int Out
getDirection
method when the Slot is an OutSlot
.
Constructor Detail |
---|
protected Slot(java.lang.Class type)
type
- The type of data that can be sent to or received from
this Slot. Slots can only connect to other Slots
that have the same type of data. To use basic Java types (e.g.
boolean
, int
or float
)
you have to use the wrapper classes provided by Java (e.g.
Boolean
, Integer
or Float
).protected Slot(java.lang.Class type, java.lang.String description)
type
- The type of data that can be sent to or received from
this Slot. Slots can only connect to other Slots
that have the same type of data. To use basic Java types (e.g.
boolean
, int
or float
)
you have to use the wrapper classes provided by Java (e.g.
Boolean
, Integer
or Float
).description
- The description of this Slot. The
description is not used by the system in any way. It
primarily serves documentation purposes. Some user interfaces
that allow to manage the system print the description
alongside with the InSlot.Method Detail |
---|
public final java.lang.Class getType()
The following example demonstrates how to check if an OutSlot and an InSlot can be connected to each other:
OutSlot outSlot = ...; InSlot inSlot = ...; if (outSlot.getType() == inSlot.getType()) { // They can be connected } else { // They cannot be connected }
Constructor
,
Constructor
public final java.lang.String getDescription()
The following example demonstrates how to print the description of an OutSlot to the console:
OutSlot outSlot = ...; System.out.println("Description = " + outSlot.getDescription());
Constructor
public abstract int getDirection()
In
when the Slot is an InSlot
,
and Out
when the Slot is an OutSlot
.
The following example demonstrates how to determine if a given Slot is an InSlot or an OutSlot:
Slot slot = ...; switch (slot.getDirection()) { case Slot.In: // We have an InSlot break; case Slot.Out: // We have an OutSlot break; }
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |