A static factory class for creating and accessing the tactical symbols provided in this module via a programmer friendly method.
Make sure to call initialise()
early in your application startup
to get the most expensive part of starting up out of the way. This triggers
the reading of the index file and will create an ArrayList of TacticalSymbolResource
with instances for every symbol. If not explicitely called, it will be
called on the first attempt to access the symbols via getTacticalSymbols()
.
- Since:
- 1.2
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<TacticalSymbol>
getTacticalSymbol
(int hashCode) Returns a tactical symbol based on its unique Id (hashCode).static Collection<TacticalSymbol>
Returns the internal storage wrapped in an unmodifiable list.static Collection<TacticalSymbol>
getTacticalSymbols
(TacticalSymbolTag... tags) A search mechanism using "AND" logic to retrieve allTacticalSymbol
s with all of the desiredTacticalSymbolTag
sstatic boolean
UsesTacticalSymbolResourceFactory
to initialise an internal list aof all available tactical symbols wrapped and prepared inTacticalSymbol
instancesstatic boolean
Simple check to see if the internal storage has been initialised.static void
reset()
Resets the cache back to a default state.
-
Field Details
-
LOGGER_NAME
We use java.util logging. This is the name of the logger we are using.- See Also:
-
-
Method Details
-
initialise
public static boolean initialise()Uses
TacticalSymbolResourceFactory
to initialise an internal list aof all available tactical symbols wrapped and prepared inTacticalSymbol
instances- Returns:
- if the initialisation was successfull or not.
- See Also:
-
reset
public static void reset()Resets the cache back to a default state. After calling clear, a subsequent call to
isInitialised()
will return false.- See Also:
-
isInitialised
public static boolean isInitialised()Simple check to see if the internal storage has been initialised.- Returns:
- if the symbols instances have been prepared.
-
getTacticalSymbols
A search mechanism using "AND" logic to retrieve all
TacticalSymbol
s with all of the desiredTacticalSymbolTag
s- Parameters:
tags
- TheTacticalSymbolTag
s to be used to search for the symbols- Returns:
- A collection of symbols matching all tags
- See Also:
-
getTacticalSymbol
Returns a tactical symbol based on its unique Id (hashCode).- Parameters:
hashCode
- The unique Id of the underlyingTacticalSymbolResource
- Returns:
- The symbol, if it was present.
-
getTacticalSymbols
Returns the internal storage wrapped in an unmodifiable list.- Returns:
- All of the loaded
TacticalSymbol
s - See Also:
-