Class TLcdLabelIdentifier

java.lang.Object
com.luciad.view.TLcdLabelIdentifier

public class TLcdLabelIdentifier extends Object
Class used to uniquely identify a label. A label is specified by its layer, domain object, its label index and sublabel index.

This class overrides the equals and hashCode implementations.

  • Constructor Summary

    Constructors
    Constructor
    Description
    TLcdLabelIdentifier(ILcdLayer aLayer, Object aDomainObject, int aLabelIndex, int aSubLabelIndex)
    Create a new LabelIdentifier using the labels domain object, a label index and a sublabel index.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This implementation of equals uses a label and sublabel index to compare label identifiers.
    Returns the domain object used to identify a label.
    int
    Returns the label index used to identify a label.
    Returns the layer used to identify a label.
    int
    Returns the sublabel index used to identify a label.
    int
    This implementation of hashCode uses the label and sublabel index to create a hash code for this label identifier.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TLcdLabelIdentifier

      public TLcdLabelIdentifier(ILcdLayer aLayer, Object aDomainObject, int aLabelIndex, int aSubLabelIndex)
      Create a new LabelIdentifier using the labels domain object, a label index and a sublabel index.
      Parameters:
      aLayer - the layer to which the domain object of the label belongs.
      aDomainObject - the domain object to which the label belongs.
      aLabelIndex - the label index.
      aSubLabelIndex - the sublabel index.
  • Method Details

    • getLayer

      public ILcdLayer getLayer()
      Returns the layer used to identify a label.
      Returns:
      the layer used to identify a label.
    • getDomainObject

      public Object getDomainObject()
      Returns the domain object used to identify a label.
      Returns:
      the domain object used to identify a label.
    • getLabelIndex

      public int getLabelIndex()
      Returns the label index used to identify a label.
      Returns:
      the label index used to identify a label.
    • getSubLabelIndex

      public int getSubLabelIndex()
      Returns the sublabel index used to identify a label.
      Returns:
      the sublabel index used to identify a label.
    • equals

      public boolean equals(Object o)
      This implementation of equals uses a label and sublabel index to compare label identifiers. It also checks if the domain object is exactly the same (==) as the domain object of the given LabelIdentifier.
      Overrides:
      equals in class Object
      Parameters:
      o - an other object.
      Returns:
      true if this label identifier equals the given object, and false otherwise.
    • hashCode

      public int hashCode()
      This implementation of hashCode uses the label and sublabel index to create a hash code for this label identifier. It also uses the identity hash code (System.identityHashCode) of the domain object and the layer.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for this LabelIdentifier.
    • toString

      public String toString()
      Overrides:
      toString in class Object