Class TextImpl

  • All Implemented Interfaces:
    Text, java.lang.Cloneable

    public class TextImpl
    extends java.lang.Object
    implements Text
    Representation of user configurable texts. A text consists of an id identifying the type of the text and the textual information itself.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextImpl()
      Creates a new object without initialization of the id and text information.
      TextImpl​(java.lang.String id, java.lang.String text)
      Creates a new object and sets the id and text information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String assureMaxLength​(java.lang.String text2verify)  
      void clear()
      Clears all the fields in the test object
      TextImpl clone()  
      boolean equals​(java.lang.Object o)
      Determines whether the given object is equal to this object
      java.lang.String getHandle()
      Reads the text handle
      java.lang.String getId()
      Reads the type of the text
      java.lang.String getText()
      Reads the text
      int hashCode()  
      boolean hasTextChanged()
      checks whether the text or the id has been changed since the last invocation of Text.resetTextChanged()
      void resetTextChanged()
      resets the text changed status to false
      void setHandle​(java.lang.String handle)
      Sets the handle (which is a temporary key to identify the object)
      void setId​(java.lang.String id)
      Sets the type of the text
      void setText​(java.lang.String text)
      Sets the text
      java.lang.String toString()
      Returns a string Representation
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TextImpl

        public TextImpl()
        Creates a new object without initialization of the id and text information. After calling this constructor both fields are initialized with empty Strings
      • TextImpl

        public TextImpl​(java.lang.String id,
                        java.lang.String text)
        Creates a new object and sets the id and text information.
        Parameters:
        id - Type of the text
        text - The text itself
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Text
        Reads the type of the text
        Specified by:
        getId in interface Text
        Returns:
        Type of text
      • setId

        public void setId​(java.lang.String id)
        Description copied from interface: Text
        Sets the type of the text
        Specified by:
        setId in interface Text
        Parameters:
        id - The type to be set
      • getText

        public final java.lang.String getText()
        Description copied from interface: Text
        Reads the text
        Specified by:
        getText in interface Text
        Returns:
        Text
      • setText

        public void setText​(java.lang.String text)
        Description copied from interface: Text
        Sets the text
        Specified by:
        setText in interface Text
        Parameters:
        text - Text to be set
      • assureMaxLength

        protected java.lang.String assureMaxLength​(java.lang.String text2verify)
      • toString

        public java.lang.String toString()
        Returns a string Representation
        Overrides:
        toString in class java.lang.Object
        Returns:
        String giving information about the object
      • equals

        public boolean equals​(java.lang.Object o)
        Determines whether the given object is equal to this object
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - Object to compare with
        Returns:
        true if the object is equal, false if not
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getHandle

        public java.lang.String getHandle()
        Description copied from interface: Text
        Reads the text handle
        Specified by:
        getHandle in interface Text
        Returns:
        handle representing this text
      • setHandle

        public void setHandle​(java.lang.String handle)
        Description copied from interface: Text
        Sets the handle (which is a temporary key to identify the object)
        Specified by:
        setHandle in interface Text
        Parameters:
        handle - representing this text
      • clear

        public void clear()
        Description copied from interface: Text
        Clears all the fields in the test object
        Specified by:
        clear in interface Text
      • clone

        public final TextImpl clone()
        Specified by:
        clone in interface Text
        Overrides:
        clone in class java.lang.Object
        Returns:
        clone
        See Also:
        Object.clone()
      • hasTextChanged

        public boolean hasTextChanged()
        Description copied from interface: Text
        checks whether the text or the id has been changed since the last invocation of Text.resetTextChanged()
        Specified by:
        hasTextChanged in interface Text
        Returns:
        true, only if the text has been changed
      • resetTextChanged

        public void resetTextChanged()
        Description copied from interface: Text
        resets the text changed status to false
        Specified by:
        resetTextChanged in interface Text