Interface CalcResult

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static CalcResult NULL_RESULT
      The result obtained when a FeatureCalc found no features to visit.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object getValue()
      Actual answer
      boolean isCompatible​(CalcResult targetResults)
      Returns true if the target results is a compatible type with the current results, with compatible meaning that the two results may be merged.
      CalcResult merge​(CalcResult resultsToAdd)
      Returns the merged results of two CalcResult.
      Object[] toArray()
      Access getValue as an array
      double toDouble()
      Access getValue as a double
      Envelope toEnvelope()
      Access getValue as an envelope
      float toFloat()
      Access getValue as a float
      Geometry toGeometry()
      Access getValue as a geometry
      int toInt()
      Access getValue as an int
      List toList()
      Access getValue as a list
      long toLong()
      Access getValue as a long
      Map toMap()
      Access getValue as a map
      Point toPoint()
      Access getValue as a point
      Set toSet()
      Access getValue as a set
      String toString()
      Access getValue as a string
    • Field Detail

      • NULL_RESULT

        static final CalcResult NULL_RESULT
        The result obtained when a FeatureCalc found no features to visit. It lets itself merge with any other result by just returning the other result as the output of the merge
    • Method Detail

      • isCompatible

        boolean isCompatible​(CalcResult targetResults)
        Returns true if the target results is a compatible type with the current results, with compatible meaning that the two results may be merged.
        Parameters:
        targetResults - the second CalcResult Object
        Returns:
        true if the targetResults can be merged with the current results
      • merge

        CalcResult merge​(CalcResult resultsToAdd)
        Returns the merged results of two CalcResult. The way in which the results are merged is dependent on the type of the results added. A new instance is created containing the merged results.

        For example: merging two min functions would return the smaller of the two values; merging a count and a sum would return an average.

        Returns:
        the merged results
      • getValue

        Object getValue()
        Actual answer
        Returns:
        the calculation result as a generic object
      • toInt

        int toInt()
        Access getValue as an int
        Returns:
        the calculation result as a int (or 0 if not applicable)
      • toDouble

        double toDouble()
        Access getValue as a double
        Returns:
        the calculation result as a double (or 0 if not applicable)
      • toString

        String toString()
        Access getValue as a string
        Overrides:
        toString in class Object
        Returns:
        the calculation result as a string (or "" if not applicable)
      • toLong

        long toLong()
        Access getValue as a long
        Returns:
        the calculation result as a long (or 0 if not applicable)
      • toFloat

        float toFloat()
        Access getValue as a float
        Returns:
        the calculation result as a float (or 0 if not applicable)
      • toGeometry

        Geometry toGeometry()
        Access getValue as a geometry
        Returns:
        the calculation result as a geometry (or null if not applicable)
      • toEnvelope

        Envelope toEnvelope()
        Access getValue as an envelope
        Returns:
        the calculation result as an envelope (or null if not applicable)
      • toPoint

        Point toPoint()
        Access getValue as a point
        Returns:
        the calculation result as a point (or null if not applicable)
      • toSet

        Set toSet()
        Access getValue as a set
        Returns:
        the calculation result as a set (or null if not applicable)
      • toList

        List toList()
        Access getValue as a list
        Returns:
        the calculation result as a list (or null if not applicable)
      • toArray

        Object[] toArray()
        Access getValue as an array
        Returns:
        the calculation result as an array (or null if not applicable)
      • toMap

        Map toMap()
        Access getValue as a map
        Returns:
        the calculation result as a map (or null if not applicable)