Package geomss.geom

Class AbstractGeomElement<T extends AbstractGeomElement>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.ResourceBundle RESOURCES
      The resource bundle for this package.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(javax.swing.event.ChangeListener listener)
      Add a listener that is notified of changes to the state of this element.
      java.lang.Object clone()
      Returns a copy of this GeomElement instance allocated by the calling thread (possibly on the stack).
      int compareTo​(java.lang.Object otherElement)
      Compares this geometry element with the specified element for order (where order is determined by the element's name).
      boolean equals​(java.lang.Object obj)
      Compares the specified object with this object for equality.
      java.util.Map<java.lang.Object,​java.lang.Object> getAllUserData()
      Returns a new Map containing all the user objects associated with this geometry element.
      long getID()
      Return the unique ID number of this geometry element.
      java.lang.String getName()
      Return the name of this geometry element.
      java.lang.Object getUserData​(java.lang.Object key)
      Return any user defined object associated with this geometry element and the specified key.
      int hashCode()
      Returns the hash code for this AbstractGeomElement.
      void putAllUserData​(java.util.Map data)
      Add all the user defined data in the supplied Map to this objects map of user defined data.
      void putUserData​(java.lang.Object key, java.lang.Object value)
      Set the user defined object associated with this geometry element and the specified key.
      void removeChangeListener​(javax.swing.event.ChangeListener listener)
      Remove a listener from receiving notifications of changes to the state of this element.
      void removeUserData​(java.lang.Object key)
      Removes the entry for the specified user object key if present.
      void reset()
      Resets the internal state of this object to its default values.
      void setName​(java.lang.String name)
      Change the name of this geometry element to the specified name (may be null to clear the name and make it undefined).
      java.lang.String toString()
      Returns a string representation of this geometry element.
      javolution.text.Text toText()
      Returns the text representation of this geometry element.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • RESOURCES

        public static final java.util.ResourceBundle RESOURCES
        The resource bundle for this package.
    • Method Detail

      • getID

        public long getID()
        Return the unique ID number of this geometry element.
        Specified by:
        getID in interface GeomElement<T extends AbstractGeomElement>
        Returns:
        The unique ID of this geometry element.
      • getName

        public java.lang.String getName()
        Return the name of this geometry element. If the name is not defined, then null is returned.
        Specified by:
        getName in interface GeomElement<T extends AbstractGeomElement>
        Returns:
        The name of this geometry element.
      • setName

        public void setName​(java.lang.String name)
        Change the name of this geometry element to the specified name (may be null to clear the name and make it undefined).
        Specified by:
        setName in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        name - The name of this geometry element.
      • addChangeListener

        public void addChangeListener​(javax.swing.event.ChangeListener listener)
        Add a listener that is notified of changes to the state of this element.
        Specified by:
        addChangeListener in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        listener - The listener to be notified of changes to the state of this element.
      • removeChangeListener

        public void removeChangeListener​(javax.swing.event.ChangeListener listener)
        Remove a listener from receiving notifications of changes to the state of this element.
        Specified by:
        removeChangeListener in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        listener - The listener to be removed from those being notified of changes to the state of this element.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a copy of this GeomElement instance allocated by the calling thread (possibly on the stack).
        Returns:
        an identical and independent copy of this geometry element.
        Throws:
        java.lang.CloneNotSupportedException - Never thrown.
        See Also:
        GeomElement.copy()
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares the specified object with this object for equality. Returns true if and only if both AbstractGeomElement objects have the same name.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this object is identical to that object; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code for this AbstractGeomElement.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value.
      • toText

        public javolution.text.Text toText()
        Returns the text representation of this geometry element.
        Specified by:
        toText in interface GeomElement<T extends AbstractGeomElement>
        Returns:
        The text representation of this geometry element.
      • toString

        public java.lang.String toString()
        Returns a string representation of this geometry element.
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object otherElement)
        Compares this geometry element with the specified element for order (where order is determined by the element's name). Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. This method delegates to the String.compareTo() method using the string representation of this element.
        Specified by:
        compareTo in interface java.lang.Comparable<T extends AbstractGeomElement>
        Parameters:
        otherElement - The geometry element this one is being compared to.
      • getUserData

        public java.lang.Object getUserData​(java.lang.Object key)
        Return any user defined object associated with this geometry element and the specified key. If there is no user data with the specified key, then null is returned.
        Specified by:
        getUserData in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        key - the key whose associated value is to be returned. May not be null.
        Returns:
        The user data associated with "key" or null if the specified key could not be found.
      • getAllUserData

        public java.util.Map<java.lang.Object,​java.lang.Object> getAllUserData()
        Returns a new Map containing all the user objects associated with this geometry element.
        Specified by:
        getAllUserData in interface GeomElement<T extends AbstractGeomElement>
        Returns:
        A new Map containing all the user objects associated with this geometry element.
      • putUserData

        public void putUserData​(java.lang.Object key,
                                java.lang.Object value)
        Set the user defined object associated with this geometry element and the specified key. This can be used to store any type of information with a geometry element that could be useful.
        Specified by:
        putUserData in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        key - the key with which the specified value is to be associated. May not be null.
        value - the value to be associated with the specified key. May not be null.
      • putAllUserData

        public void putAllUserData​(java.util.Map data)
        Add all the user defined data in the supplied Map to this objects map of user defined data.
        Specified by:
        putAllUserData in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        data - The Map of user defined data to be added to this object's map of user defined data.
      • removeUserData

        public void removeUserData​(java.lang.Object key)
        Removes the entry for the specified user object key if present.
        Specified by:
        removeUserData in interface GeomElement<T extends AbstractGeomElement>
        Parameters:
        key - the key whose mapping is to be removed from the map. May not be null.
      • reset

        public void reset()
        Resets the internal state of this object to its default values. Subclasses that override this method must call super.reset(); to ensure that the state is reset properly.
        Specified by:
        reset in interface javolution.lang.Reusable