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 TypeMethodDescriptionvoid
addListener
(RootStorageListener listener) Adds a listener.void
Adds a source and resorts all the sources.boolean
contains
(ResourceKey resource) long
get
(ResourceKey resource) boolean
Checks if a source is present.void
removeListener
(RootStorageListener listener) Removes a listener.void
removeSource
(Storage source) Removes a source .void
Sorts the sources in the backing storage.Methods inherited from interface com.refinedmods.refinedstorage.api.storage.ExtractableStorage
extract
Methods inherited from interface com.refinedmods.refinedstorage.api.storage.InsertableStorage
insert
Methods inherited from interface com.refinedmods.refinedstorage.api.storage.StorageView
getAll, getStored
Methods 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
-