Class AbstractProxyMutableResourceList
java.lang.Object
com.refinedmods.refinedstorage.api.resource.list.AbstractProxyMutableResourceList
- All Implemented Interfaces:
- MutableResourceList,- ResourceList
- Direct Known Subclasses:
- FuzzyResourceListImpl,- ListenableResourceList
@API(status=STABLE,
     since="2.0.0-milestone.1.2")
public abstract class AbstractProxyMutableResourceList
extends Object
implements MutableResourceList
This is a utility class to easily decorate a 
MutableResourceListImpl.- 
Nested Class SummaryNested classes/interfaces inherited from interface com.refinedmods.refinedstorage.api.resource.list.MutableResourceListMutableResourceList.OperationResult
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotected
- 
Method SummaryModifier and TypeMethodDescriptionadd(ResourceKey resource, long amount) Adds a given resource to the list.voidclear()Clears the list.booleancontains(ResourceKey resource) copy()Copies the list.Retrieves all resources and their amounts from the list.longget(ResourceKey resource) getAll()booleanisEmpty()remove(ResourceKey resource, long amount) Removes as much of a certain amount of a resource in the list.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.refinedmods.refinedstorage.api.resource.list.MutableResourceListadd, remove
- 
Constructor Details- 
AbstractProxyMutableResourceList
 
- 
- 
Method Details- 
addDescription copied from interface:MutableResourceListAdds a given resource to the list.- Specified by:
- addin interface- MutableResourceList
- Parameters:
- resource- the resource, may not be null
- amount- the amount, must be larger than 0
- Returns:
- the result of the operation
 
- 
removeDescription copied from interface:MutableResourceListRemoves as much of a certain amount of a resource in the list. If the amount reaches 0 due to this removal, the resource is removed from the list.- Specified by:
- removein interface- MutableResourceList
- Parameters:
- resource- the resource, may not be null
- amount- the amount, must be larger than 0
- Returns:
- a result if the removal operation was successful, otherwise null
 
- 
copyStateDescription copied from interface:ResourceListRetrieves all resources and their amounts from the list.- Specified by:
- copyStatein interface- ResourceList
- Returns:
- a list of resource amounts
 
- 
get- Specified by:
- getin interface- ResourceList
- Parameters:
- resource- the resource
- Returns:
- the amount stored, or zero if not stored
 
- 
contains- Specified by:
- containsin interface- ResourceList
- Parameters:
- resource- the resource
- Returns:
- whether the list contains this resource
 
- 
getAll- Specified by:
- getAllin interface- ResourceList
- Returns:
- set of resources contained in this list
 
- 
copyDescription copied from interface:MutableResourceListCopies the list.- Specified by:
- copyin interface- MutableResourceList
 
- 
clearpublic void clear()Description copied from interface:MutableResourceListClears the list.- Specified by:
- clearin interface- MutableResourceList
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- ResourceList
- Returns:
- whether the list is empty
 
- 
toString
 
-