Class TacticalSymbolResource

java.lang.Object
de.turnertech.tz.symbol.TacticalSymbolResource

public class TacticalSymbolResource extends Object

A representation of the Tactical Symbol. It is intended to be a lightweight class which can be cheaply, and diversly used to programatically access the image library.

It is recomended to grab one of the other modules (like taktische-zeichen-swing) instead. This class is inteded as a basic backbone for the raw ersource

  • Method Details

    • getResourceURL

      public URL getResourceURL()

      Returns the resource URL which points to the image this instance represents. The is trustworthy and has already been verified as existing.

      This can be used (for example) directly in swing ImageIcon

      Returns:
      The URL pointing to the resource.
    • getTags

      public Collection<TacticalSymbolTag> getTags()
      Returns the collection of tags associated with this symbol
      Returns:
      an unmodifiable collection.
    • hasTag

      public boolean hasTag(TacticalSymbolTag tag)
      Simple check to see if a tag is present.
      Parameters:
      tag - Tag to check is present.
      Returns:
      If the tag was present.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      As the hashCode is the hash of the image file, and the tags are immutable, equals only needs to check the hash code.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      We are hard coding the hashcode in the constructor. It is ecpected to be the hash of the origional file path
      Overrides:
      hashCode in class Object