psdi.app.recontask.engine

Class ReconValue

  • java.lang.Object
    • psdi.app.recontask.engine.ReconValue


  • public class ReconValue
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected java.lang.Object[] attributeUnits
      optionally used internal storage for the attribute measurement units
      protected java.lang.Object[] attributeValues
      internal storage for the attribute values
      protected ReconValue parentValue 
      protected ReconExpression rule
      a successful rule reference piggybacked on the ReconValue object (no need for yet another cache, a successful match will always correspond to one rule)
      protected ReconValueSet valueSet 
    • Constructor Summary

      Constructors 
      Constructor and Description
      ReconValue(ReconValueSet valueSet, java.lang.Object[] values)
      Copies all values contained in the parameter to an internal storage
      ReconValue(ReconValueSet valueSet, java.lang.Object[] values, java.lang.Object[] units)
      Copies all values and their units contained in the parameters to an internal storage
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(ReconValue anotherReconValue)
      Compares two ReconValue objects.
      java.lang.Object[] getAllUnits()
      Returns a reference to the measurement units
      java.lang.Object[] getAllValues()
      Returns a reference to the internal storage
      java.lang.String getObjectName() 
      ReconValue getParentValue() 
      ReconExpression getRule() 
      protected int getUniqueId()
      Assuming the object's unique ID is an integer value, return it
      java.lang.Object getUnit(int index) 
      java.lang.Object getValue(int index) 
      java.lang.Object getValue(java.lang.String attributeName) 
      boolean hasUnit(int index)
      Assumes that the object saved as units are String, or will throw bad cast exception
      boolean isDataSet1() 
      protected void setAllUnits(java.lang.Object[] units)
      Copies all unit valueds contained in the parameter to an internal storage
      protected void setAllValues(java.lang.Object[] values)
      Copies all values contained in the parameter to an internal storage
      void setParentValue(ReconValue parentValue) 
      void setRule(ReconExpression rule) 
      void setUnit(java.lang.String unit, int index) 
      void setValue(java.lang.Object val, int index) 
      • Methods inherited from class java.lang.Object

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

      • attributeValues

        protected java.lang.Object[] attributeValues
        internal storage for the attribute values
      • attributeUnits

        protected java.lang.Object[] attributeUnits
        optionally used internal storage for the attribute measurement units
      • rule

        protected ReconExpression rule
        a successful rule reference piggybacked on the ReconValue object (no need for yet another cache, a successful match will always correspond to one rule)
    • Constructor Detail

      • ReconValue

        public ReconValue(ReconValueSet valueSet,
                          java.lang.Object[] values)
        Copies all values contained in the parameter to an internal storage
        Parameters:
        valueSet -
        values -
      • ReconValue

        public ReconValue(ReconValueSet valueSet,
                          java.lang.Object[] values,
                          java.lang.Object[] units)
        Copies all values and their units contained in the parameters to an internal storage
        Parameters:
        isDataSet1 -
        values -
        units -
    • Method Detail

      • getValue

        public java.lang.Object getValue(int index)
        Parameters:
        index -
        Returns:
        a value
      • getValue

        public java.lang.Object getValue(java.lang.String attributeName)
      • getUnit

        public java.lang.Object getUnit(int index)
        Parameters:
        index -
        Returns:
        the unit of the indexed value
      • hasUnit

        public boolean hasUnit(int index)
        Assumes that the object saved as units are String, or will throw bad cast exception
        Parameters:
        index -
        Returns:
        true if the indexed value has a non-empty unit
      • getAllValues

        public java.lang.Object[] getAllValues()
        Returns a reference to the internal storage
      • getAllUnits

        public java.lang.Object[] getAllUnits()
        Returns a reference to the measurement units
      • setAllValues

        protected void setAllValues(java.lang.Object[] values)
        Copies all values contained in the parameter to an internal storage
        Parameters:
        values -
      • setAllUnits

        protected void setAllUnits(java.lang.Object[] units)
        Copies all unit valueds contained in the parameter to an internal storage

        This is really a patch on top of the ReconValue objct to allow storage and retrieval of units associated with values

        Parameters:
        units -
      • setValue

        public void setValue(java.lang.Object val,
                             int index)
      • setUnit

        public void setUnit(java.lang.String unit,
                            int index)
      • isDataSet1

        public boolean isDataSet1()
        Returns:
        true if the object is for data set1, false if it is for data set2
      • compareTo

        public int compareTo(ReconValue anotherReconValue)
        Compares two ReconValue objects.
        Parameters:
        anotherReconValue - the ReconValue to be compared.
        Returns:
        the value 0 if the argument ReconValue is equal to this ReconValue; a value less than 0 if this ReconValue is less than the ReconValue argument; and a value greater than 0 if this ReconValue is greater than the ReconValue argument.
      • getUniqueId

        protected int getUniqueId()
        Assuming the object's unique ID is an integer value, return it
        Returns:
        the value of the unique ID of the object
      • setRule

        public void setRule(ReconExpression rule)
        Parameters:
        rule - The rule to set.
      • getObjectName

        public java.lang.String getObjectName()
        Returns:
        Returns the objectName.
      • getParentValue

        public ReconValue getParentValue()
      • setParentValue

        public void setParentValue(ReconValue parentValue)
        Parameters:
        rule - The rule to set.