A class that includes properties and functionality associated with the storage and assignment of a flow item to Storage.Slots.
The Storage.Item class is primarily used for managing and retrieving the slots that a flow item is assigned to and/or stored in.
The Storage.Item is NOT the same as the item object. In other words, you can't just set a Storage.Item to the item itself.
Object item = param(2);
Storage.Item storageItem = item; // RUN-TIME ERROR
Instead, the Storage.Item is associated with, not the same as the item. To access the Storage.Item of a given flow item, use the Storage.Item() constructor.
A Storage.Item holds data associated directly with the flow item itself. A Storage.Item should not be confused with a Storage.Slot.Item. The Storage.Item may have both a current slot (the slot that the flow item is currently stored in), and/or an assigned slot (the slot that the item has been assigned to be placed in). If the flow item has been placed in its assigned slot, and has not been assigned to any new slot, then its assigned slot is the same as its current slot.
A Storage.Item may simultaneously have two associated Storage.Slot.Items, namely one for its assigned slot, and one for its current slot. These can be accessed respectively with the assignedSlotItem and currentSlotItem properties.
assignedSlot | The item's assigned slot. |
assignedSlotItem | The Storage.Slot.Item associated with the item's assigned slot. |
currentSlot | The item's current slot. |
currentSlotItem | The Storage.Slot.Item associated with the item's current slot. |
state | The current transit state of the item. |
Storage.Item | Gets/Asserts the Storage.Item object associated with the given flow item. |
Storage.Slot assignedSlot
The item's assigned slot.
You can set this property to a specific slot through several methods:
Once you have assigned the item to a slot, move the item into the slot's storage object, either immediately or through some transit process. Once the item is moved into the storage object, its assigned slot will become its current slot.
readonly Storage.Slot.Item assignedSlotItem
The Storage.Slot.Item associated with the item's assigned slot.
readonly Storage.Slot currentSlot
The item's current slot.
The item's current slot is the slot that the item is currently stored in. You cannot directly set the item's current slot. Instead, you can do one of the following:
readonly Storage.Slot.Item currentSlotItem
The Storage.Slot.Item associated with the item's current slot.
readonly int state
The current transit state of the item.
The state value is a function of the item's currentSlot and assignedSlot property values.
Valid values are:
static Storage.Item Storage.Item( treenode item ) |
item | A flow item. |
Storage.Item | A Storage.Item object. If an associated Storage.Item does not already exist for the flow item, it will be automatically created. |
Gets/Asserts the Storage.Item object associated with the given flow item.
A Storage.Item can only be accessed by calling this method. Casting from a treenode is not correct.Storage.Item storageItem = Storage.Item(item); // correct
Storage.Item storageItem = item; // incorrect