StackType
- public class MEMonitorHandler<StackType extends IAEStack> extends java.lang.Object implements IMEMonitor<StackType>
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasChanged |
Constructor and Description |
---|
MEMonitorHandler(IMEInventoryHandler<StackType> t) |
MEMonitorHandler(IMEInventoryHandler<StackType> t,
StorageChannel chan) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IMEMonitorHandlerReceiver<StackType> l,
java.lang.Object verificationToken)
add a new Listener to the monitor, be sure to properly remove yourself when your done.
|
boolean |
canAccept(StackType input)
determine if an item can be accepted and stored.
|
StackType |
extractItems(StackType request,
Actionable mode,
BaseActionSource src)
Extract the specified item from the ME Inventory
|
AccessRestriction |
getAccess()
determine if items can be injected/extracted.
|
IItemList<StackType> |
getAvailableItems(IItemList out)
This method is discouraged when accessing data via a IMEMonitor
|
StorageChannel |
getChannel() |
protected IMEInventoryHandler<StackType> |
getHandler() |
protected java.util.Iterator<java.util.Map.Entry<IMEMonitorHandlerReceiver<StackType>,java.lang.Object>> |
getListeners() |
int |
getPriority()
determine what the priority of the inventory is.
|
int |
getSlot()
pass back value for blinkCell.
|
IItemList<StackType> |
getStorageList()
Get access to the full item list of the network, preferred over
IMEInventory .getAvailableItems(...) |
StackType |
injectItems(StackType input,
Actionable mode,
BaseActionSource src)
Store new items, or simulate the addition of new items into the ME Inventory.
|
boolean |
isPrioritized(StackType input)
determine if a particular item is prioritized for this inventory handler, if it is, then it will be added to this
inventory prior to any non-prioritized inventories.
|
protected void |
notifyListenersOfChange(java.lang.Iterable<StackType> diff,
BaseActionSource src) |
protected void |
postChangesToListeners(java.lang.Iterable<StackType> changes,
BaseActionSource src) |
void |
removeListener(IMEMonitorHandlerReceiver<StackType> l)
remove a Listener to the monitor.
|
boolean |
validForPass(int i)
AE Uses a two pass placement system, the first pass checks contents and tries to find a place where the item
belongs, however in some cases you can save processor time, or require that the second, or first pass is simply
ignored, this allows you to do that.
|
public MEMonitorHandler(IMEInventoryHandler<StackType> t)
public MEMonitorHandler(IMEInventoryHandler<StackType> t, StorageChannel chan)
public void addListener(IMEMonitorHandlerReceiver<StackType> l, java.lang.Object verificationToken)
IBaseMonitor
addListener
in interface IBaseMonitor<StackType extends IAEStack>
public void removeListener(IMEMonitorHandlerReceiver<StackType> l)
IBaseMonitor
removeListener
in interface IBaseMonitor<StackType extends IAEStack>
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
IMEInventory
injectItems
in interface IMEInventory<StackType extends IAEStack>
input
- item to add.mode
- action typesrc
- action sourceprotected IMEInventoryHandler<StackType> getHandler()
protected void postChangesToListeners(java.lang.Iterable<StackType> changes, BaseActionSource src)
protected void notifyListenersOfChange(java.lang.Iterable<StackType> diff, BaseActionSource src)
protected java.util.Iterator<java.util.Map.Entry<IMEMonitorHandlerReceiver<StackType>,java.lang.Object>> getListeners()
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
IMEInventory
extractItems
in interface IMEInventory<StackType extends IAEStack>
request
- item to request ( with stack size. )mode
- simulate, or perform action?public StorageChannel getChannel()
getChannel
in interface IMEInventory<StackType extends IAEStack>
public AccessRestriction getAccess()
IMEInventoryHandler
getAccess
in interface IMEInventoryHandler<StackType extends IAEStack>
public IItemList<StackType> getStorageList()
IMEMonitor
IMEInventory
.getAvailableItems(...)getStorageList
in interface IMEMonitor<StackType extends IAEStack>
public boolean isPrioritized(StackType input)
IMEInventoryHandler
isPrioritized
in interface IMEInventoryHandler<StackType extends IAEStack>
input
- - item that might be addedpublic boolean canAccept(StackType input)
IMEInventoryHandler
canAccept
in interface IMEInventoryHandler<StackType extends IAEStack>
input
- - item that might be addedpublic IItemList<StackType> getAvailableItems(IItemList out)
IMEMonitor
getAvailableItems
in interface IMEInventory<StackType extends IAEStack>
getAvailableItems
in interface IMEMonitor<StackType extends IAEStack>
out
- the IItemList the results will be written toopublic int getPriority()
IMEInventoryHandler
getPriority
in interface IMEInventoryHandler<StackType extends IAEStack>
public int getSlot()
IMEInventoryHandler
getSlot
in interface IMEInventoryHandler<StackType extends IAEStack>
ICellContainer
will be called with this value, only trust the return value of this method if you
are the implementer of this.public boolean validForPass(int i)
IMEInventoryHandler
validForPass
in interface IMEInventoryHandler<StackType extends IAEStack>
i
- - pass number ( 1 or 2 )