T - The type this palette will maintainpublic interface Palette<T extends CatalogType>
CatalogTypes to int id's for storage purposes,
or for converting stored information to a representable format back into
CatalogTypes.| Modifier and Type | Method and Description |
|---|---|
Optional<T> |
get(int id)
Gets the
type represented by the given identifier from the mapping. |
Optional<Integer> |
get(T type)
Gets the identifier for the given
type T if it exists within the
mapping. |
Collection<T> |
getEntries()
Gets all
type Ts contained in this palette. |
int |
getHighestId()
Gets the highest identifier in this palette.
|
int |
getOrAssign(T type)
Gets the identifier for the given
type T from the mapping. |
PaletteType<T> |
getType()
Gets the type of this palette.
|
boolean |
remove(T type)
Removes the given
type T from the mapping. |
PaletteType<T> getType()
int getHighestId()
Optional<T> get(int id)
type represented by the given identifier from the mapping.id - The identifierOptional<Integer> get(T type)
type T if it exists within the
mapping.type - The typeint getOrAssign(T type)
type T from the mapping. If the
type T is not yet registered in the mapping then it is registered and
given the next available identifier.type - The typeboolean remove(T type)
type T from the mapping.
Note that if this palette is considered a global palette, removal is not supported.
type - The type to removeCollection<T> getEntries()
type Ts contained in this palette.