Interface RootStorage
- All Superinterfaces:
ExtractableStorage,InsertableStorage,Storage,StorageView,TrackedStorage
- All Known Subinterfaces:
FuzzyRootStorage,StorageNetworkComponent
- All Known Implementing Classes:
PlatformStorageNetworkComponent,RootStorageImpl,com.refinedmods.refinedstorage.api.network.impl.storage.StorageNetworkComponentImpl
@API(status=STABLE,
since="2.0.0-milestone.1.0")
public interface RootStorage
extends Storage, TrackedStorage
The entry-point for various storage operations.
It acts as a storage, and is usually backed by a
CompositeStorage.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(RootStorageListener listener) Adds a listener.voidAdds a source and resorts all the sources.booleancontains(ResourceKey resource) longget(ResourceKey resource) booleanChecks if a source is present.voidremoveListener(RootStorageListener listener) Removes a listener.voidremoveSource(Storage source) Removes a source .voidSorts the sources in the backing storage.Methods inherited from interface com.refinedmods.refinedstorage.api.storage.ExtractableStorage
extractMethods inherited from interface com.refinedmods.refinedstorage.api.storage.InsertableStorage
insertMethods inherited from interface com.refinedmods.refinedstorage.api.storage.StorageView
getAll, getStoredMethods inherited from interface com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage
findTrackedResourceByActorType
-
Method Details
-
addListener
Adds a listener.- Parameters:
listener- the listener
-
removeListener
Removes a listener.- Parameters:
listener- the listener
-
get
- Parameters:
resource- the resource- Returns:
- the amount stored, or zero if not stored
-
contains
- Parameters:
resource- the resource- Returns:
- whether the storage contains the resource
-
sortSources
void sortSources()Sorts the sources in the backing storage. -
addSource
Adds a source and resorts all the sources.- Parameters:
source- the source
-
removeSource
Removes a source .- Parameters:
source- the source
-
hasSource
Checks if a source is present.- Parameters:
matcher- a predicate- Returns:
- whether the predicate matched
-