Class StandardListProcessor

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Sort sortFun  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareResult​(java.lang.Object val)
      Converts results from Jep evaluation to an integer -1, 0 or 1 used in comparison.
      java.lang.Iterable<java.lang.Object> fromArgs​(java.lang.Object arg)
      Returns an iterator view of the input arguments.
      java.lang.Object fromCollection​(java.util.Collection<java.lang.Object> tree)
      Convert a general collection into a type used the the Jep environment.
      java.lang.Object fromList​(java.util.List<java.lang.Object> list)
      Convert a list produced by ListProcessor.getList() to the type used by Jep environment.
      JepComponent getLightWeightInstance()
      Gets a light-weight instance suitable for using in multiple threads.
      java.util.List<java.lang.Object> getList()
      Get an empty list which elements can be added.
      void init​(Jep jep)
      Initialize the component.
      • Methods inherited from class java.lang.Object

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

      • sortFun

        protected Sort sortFun
    • Constructor Detail

      • StandardListProcessor

        public StandardListProcessor()
    • Method Detail

      • init

        public void init​(Jep jep)
        Description copied from interface: JepComponent
        Initialize the component. This methods is called whenever a component is added to Jep. Hence it allows components to keep track of the other components they may rely on.
        Specified by:
        init in interface JepComponent
        Parameters:
        jep - the current Jep instance
      • getLightWeightInstance

        public JepComponent getLightWeightInstance()
        Description copied from interface: JepComponent
        Gets a light-weight instance suitable for using in multiple threads.
        Specified by:
        getLightWeightInstance in interface JepComponent
        Returns:
        either an new instance, null or 'this'.
      • fromArgs

        public java.lang.Iterable<java.lang.Object> fromArgs​(java.lang.Object arg)
                                                      throws EvaluationException
        Description copied from interface: ListProcessor
        Returns an iterator view of the input arguments.
        Specified by:
        fromArgs in interface ListProcessor
        Parameters:
        arg - an input to the function
        Returns:
        an Iterable view of the argument
        Throws:
        EvaluationException - on error
      • getList

        public java.util.List<java.lang.Object> getList()
        Description copied from interface: ListProcessor
        Get an empty list which elements can be added.
        Specified by:
        getList in interface ListProcessor
        Returns:
        an empty list
      • fromCollection

        public java.lang.Object fromCollection​(java.util.Collection<java.lang.Object> tree)
                                        throws EvaluationException
        Description copied from interface: ListProcessor
        Convert a general collection into a type used the the Jep environment.
        Specified by:
        fromCollection in interface ListProcessor
        Parameters:
        tree - input collection
        Returns:
        a type suitable for use by Jep
        Throws:
        EvaluationException - on error
      • compareResult

        public int compareResult​(java.lang.Object val)
                          throws EvaluationException
        Converts results from Jep evaluation to an integer -1, 0 or 1 used in comparison.
        Specified by:
        compareResult in interface ListProcessor
        Parameters:
        val - input value from Jep environment, expected to be a type which can be converted to an Number.
        Returns:
        -1, 0 or 1
        Throws:
        EvaluationException - on error
        See Also:
        Comparator.compare(Object, Object)