Class ObjectValues


  • public final class ObjectValues
    extends java.lang.Object
    This class contains values and PromptSets of executable Objects. The object that contains an ObjectValues must implement the LifecycleSaveAware interface and call the values.cleanAfterSave().
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<PromptSetDefinition> activePromptSetIterator()
      Returns an iterator over PromptSetDefinition, Iterates over only non deleted entries.
      void addPromptSet​(PromptSetDefinition def)
      Adds a new PromptSet to this object.
      void addValue​(java.lang.String validityKeyword, java.lang.String value, boolean replace)
      Adds a new key and value to this object.
      void addValue​(java.lang.String validityKeyword, java.lang.String value, java.lang.String ertUsage, boolean replace)
      Adds a new key,value and ErtUsage to this object.
      void cleanAfterSave()
      Clear the internal state after a save was performed on the object.
      ErtUsage getErtUsage​(java.lang.String validityKeyword)
      Returns the ertUsage for a given validity keyword The method returns ErtUsage.NONE if the validity keyword does not exist.
      int getInheritFromParent()
      Returns an integer which describes how variable values are inherited from its parent.
      java.lang.String getValue​(java.lang.String validityKeyword)
      Returns the value for a given validity keyword The method returns null if the validity keyword does not exist.
      java.util.Iterator<PromptSetDefinition> promptSetIterator()
      Returns an iterator over PromptSetDefinition.
      int promptSetSize()  
      void rearrange​(java.util.List<PromptSetDefinition> orderedPromptSets)
      This method can be used to rearrange the prompt sets.
      void removeAll()
      Removes all entries (Values and PromptSets).
      void removeAllVariablevalues()
      Removes all the variables stored
      void removePromptSets()
      Removes all PromptSets.
      boolean removeValue​(java.lang.String validityKeyword)
      Removes a variable entry The method returns false if the validity keyword was not found.
      void setInheritFromParent​(int mode)
      Sets the inherit mode for this VariableValues instance.
      void updateDefinition​(PromptSet set)
      This method can be used to update the number of prompt elements based on a PromptSet object.
      java.util.Iterator<java.lang.String> valueKeyIterator()
      Returns an iterator over validity keywords.
      int valueSize()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • valueKeyIterator

        public java.util.Iterator<java.lang.String> valueKeyIterator()
        Returns an iterator over validity keywords. All validity keywords have the type java.lang.String
        Returns:
        Iterator
      • promptSetIterator

        public java.util.Iterator<PromptSetDefinition> promptSetIterator()
        Returns an iterator over PromptSetDefinition.
        Returns:
        Iterator
      • activePromptSetIterator

        public java.util.Iterator<PromptSetDefinition> activePromptSetIterator()
        Returns an iterator over PromptSetDefinition, Iterates over only non deleted entries.
        Returns:
        Iterator
      • addPromptSet

        public void addPromptSet​(PromptSetDefinition def)
        Adds a new PromptSet to this object. Throws IllegalArgumentException if Object already exists
        Parameters:
        def - PromptSetDefinition
      • addValue

        public void addValue​(java.lang.String validityKeyword,
                             java.lang.String value,
                             boolean replace)
        Adds a new key and value to this object. The parameter replace can be used to define if the value should be replaced in case of an already existing validity keyword.
        Parameters:
        validityKeyword - Key
        value - Value
        replace - If true the value will be replaced if a key with this name does already exist
      • addValue

        public void addValue​(java.lang.String validityKeyword,
                             java.lang.String value,
                             java.lang.String ertUsage,
                             boolean replace)
        Adds a new key,value and ErtUsage to this object. The parameter replace can be used to define if the value should be replaced in case of an already existing validity keyword. Created after addition of new column ErtUsage in v11 of AE.
        Parameters:
        validityKeyword - Key
        value - Value
        ertUsage - Acceptable Ert usage Values are 0 to 5, otherwise ertUsage value will be set to 0 i.e its Default Value
        replace - If true the value will be replaced if a key with this name does already exist
      • getValue

        public java.lang.String getValue​(java.lang.String validityKeyword)
        Returns the value for a given validity keyword The method returns null if the validity keyword does not exist.
        Parameters:
        validityKeyword - Key
        Returns:
        Value or null if the key does not exist
      • getErtUsage

        public ErtUsage getErtUsage​(java.lang.String validityKeyword)
        Returns the ertUsage for a given validity keyword The method returns ErtUsage.NONE if the validity keyword does not exist. ErtUsage.NONE is default value of ERT Usage Value.
        Parameters:
        validityKeyword - Key
        Returns:
        ErtUsage or ErtUsage.NONE if the key does not exist.
      • removeValue

        public boolean removeValue​(java.lang.String validityKeyword)
        Removes a variable entry The method returns false if the validity keyword was not found.
        Parameters:
        validityKeyword - Key
        Returns:
        True if the values was removed
      • removeAllVariablevalues

        public void removeAllVariablevalues()
        Removes all the variables stored
      • valueSize

        public int valueSize()
        Returns:
        Number of entries in the Variable.
      • promptSetSize

        public int promptSetSize()
        Returns:
        Number of PromptSet entries
      • removeAll

        public void removeAll()
        Removes all entries (Values and PromptSets).
      • removePromptSets

        public void removePromptSets()
        Removes all PromptSets.
      • cleanAfterSave

        public void cleanAfterSave()
        Clear the internal state after a save was performed on the object.
      • setInheritFromParent

        public void setInheritFromParent​(int mode)
        Sets the inherit mode for this VariableValues instance. Throws IllegalArgumentException if the parameter value is not 0,1 or 2
        • 0 ... All values
        • 1 ... Defined values only
        • 2 ... None
        Parameters:
        mode - Inherit mode
      • getInheritFromParent

        public int getInheritFromParent()
        Returns an integer which describes how variable values are inherited from its parent.
        • 0 ... All values
        • 1 ... Defined values only
        • 2 ... None
        Returns:
        Inherit mode
      • updateDefinition

        public void updateDefinition​(PromptSet set)
        This method can be used to update the number of prompt elements based on a PromptSet object.
        Parameters:
        set - PromptSet
      • rearrange

        public void rearrange​(java.util.List<PromptSetDefinition> orderedPromptSets)
        This method can be used to rearrange the prompt sets. Throws IllegalArgumentException if the element of the list is not contained in the valid prompt set list.
        Parameters:
        orderedPromptSets - prompt set List in desired order