Contents
Class LookupTableAssetMap<K, T extends JsonAssetWithMap<K, LookupTableAssetMap<K,T>> >
java.lang.Object
com.hypixel.hytale.assetstore.AssetMap<K,T>
com.hypixel.hytale.assetstore.map.DefaultAssetMap<K,T>
com.hypixel.hytale.assetstore.map.AssetMapWithIndexes<K,T>
com.hypixel.hytale.assetstore.map.LookupTableAssetMap<K,T>
public class LookupTableAssetMap<K, T extends JsonAssetWithMap<K, LookupTableAssetMap<K,T>>>
extends AssetMapWithIndexes<K,T>
Store index to asset mapping.
The index of the asset is calculated with a function provided to the asset map on construction.
Note: The size of the backing array will be the the same as what is supplied to maxIndexGetter. TODO: We could use a map instead of an array to reduce wasted RAM
- Since:
- 16/9/17.
- Version:
- 1.0
-
Field Summary
Fields inherited from class AssetMapWithIndexes
NOT_FOUNDFields inherited from class DefaultAssetMap
DEFAULT_PACK_KEY, EMPTY_PAIR_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionLookupTableAssetMap(IntFunction<T[]> arrayProvider, ToIntFunction<K> indexGetter, IntSupplier maxIndexGetter) -
Method Summary
Modifier and TypeMethodDescriptiongetAsset(int index) getAssetOrDefault(int index, T def) booleanMethods inherited from class AssetMapWithIndexes
getIndexesForTagMethods inherited from class DefaultAssetMap
getAsset, getAsset, getAssetCount, getAssetMap, getAssetPack, getChildren, getKeys, getKeysForPack, getKeysForTag, getPath, getPathMap, getTagCount, getTagIndexes
-
Constructor Details
-
LookupTableAssetMap
public LookupTableAssetMap(@Nonnull IntFunction<T[]> arrayProvider, ToIntFunction<K> indexGetter, IntSupplier maxIndexGetter)
-
-
Method Details
-
getAsset
-
getAssetOrDefault
-
requireReplaceOnRemove
public boolean requireReplaceOnRemove()- Overrides:
requireReplaceOnRemovein classAssetMapWithIndexes<K, T extends JsonAssetWithMap<K, LookupTableAssetMap<K,T>>>
-