Class KappaSum

  • All Implemented Interfaces:
    KappaTerm

    public class KappaSum
    extends java.lang.Object
    implements KappaTerm
    This constructs represents a sum of kappa values (or terms). If it is empty its evaluated to zero.
    Author:
    Tim Janus
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List<KappaTerm> elements
      the elements that form the sum
      (package private) int value
      the value of the kappa-sum, it is -1 as long as the sum cannot be evaluated
    • Constructor Summary

      Constructors 
      Constructor Description
      KappaSum()  
    • Method Summary

      Modifier and Type Method Description
      boolean evaluate()
      Tries to evaluate the kappa term, if the evaluation is successful then the next call of value returns the evaluated value.
      java.util.Set<KappaTerm> getSubTerms()
      Processes all the sub-terms
      int greaterEqualThan()  
      java.lang.String toString()  
      int value()
      The neutral element is zero, that means if the sum contains no elements this method returns zero
      • Methods inherited from class java.lang.Object

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

      • value

        int value
        the value of the kappa-sum, it is -1 as long as the sum cannot be evaluated
      • elements

        java.util.List<KappaTerm> elements
        the elements that form the sum
    • Constructor Detail

      • KappaSum

        public KappaSum()
    • Method Detail

      • evaluate

        public boolean evaluate()
        Description copied from interface: KappaTerm
        Tries to evaluate the kappa term, if the evaluation is successful then the next call of value returns the evaluated value.
        Specified by:
        evaluate in interface KappaTerm
        Returns:
        True if the evaluation is sucessful, false otherwise
      • value

        public int value()
        The neutral element is zero, that means if the sum contains no elements this method returns zero
        Specified by:
        value in interface KappaTerm
        Returns:
        The value of this kappa term or -1 if the kappa-term's evaluate() method returns false.
      • greaterEqualThan

        public int greaterEqualThan()
        Specified by:
        greaterEqualThan in interface KappaTerm
        Returns:
        The minimum value of this kappa term, such that the caller knows the kappa term is greater or equal the returned value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSubTerms

        public java.util.Set<KappaTerm> getSubTerms()
        Description copied from interface: KappaTerm
        Processes all the sub-terms
        Specified by:
        getSubTerms in interface KappaTerm
        Returns:
        A set containing all the sub-terms of the kappa term