org.cfpm.caves.za
Class ElementWithHighestOccurrence

java.lang.Object
  extended by org.cfpm.caves.za.ElementWithHighestOccurrence
All Implemented Interfaces:
jess.Userfunction

public class ElementWithHighestOccurrence
extends java.lang.Object
implements jess.Userfunction

This userfunction returns the element with the highest number of occurrences in a list.

Author:
Ruth

Constructor Summary
ElementWithHighestOccurrence()
           
 
Method Summary
 jess.Value call(jess.ValueVector vv, jess.Context c)
          calls the function with the given parameter and context from Jess.
 java.lang.String getName()
          returns the name of the function in Jess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementWithHighestOccurrence

public ElementWithHighestOccurrence()
Method Detail

getName

public java.lang.String getName()
returns the name of the function in Jess

Specified by:
getName in interface jess.Userfunction

call

public jess.Value call(jess.ValueVector vv,
                       jess.Context c)
                throws jess.JessException
calls the function with the given parameter and context from Jess. This function has one parameter (a list of symbols) and returns the symbol with the highest number of occurrences

Specified by:
call in interface jess.Userfunction
Parameters:
vv - the list of parameters
c - the Jess context
Returns:
the symbol with highest number of occurrences
Throws:
jess.JessException