Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.cond
Class NOfFunction  view NOfFunction download NOfFunction.java

java.lang.Object
  extended bycom.sun.xacml.cond.FunctionBase
      extended bycom.sun.xacml.cond.NOfFunction
All Implemented Interfaces:
Function

public class NOfFunction
extends FunctionBase

A class that implements the n-of function. It requires at least one argument. The first argument must be an integer and the rest of the arguments must be booleans. If the number of boolean arguments that evaluate to true is at least the value of the first argument, the function returns true. Otherwise, it returns false (or indeterminate, as described in the next paragraph.

This function evaluates the arguments one at a time, starting with the first one. As soon as the result of the function can be determined, evaluation stops and that result is returned. During this process, if any argument evaluates to indeterminate, an indeterminate result is returned.

Since:
1.0

Field Summary
static java.lang.String NAME_N_OF
          Standard identifier for the n-of function.
 
Fields inherited from class com.sun.xacml.cond.FunctionBase
FUNCTION_NS
 
Constructor Summary
NOfFunction(java.lang.String functionName)
          Creates a new NOfFunction object.
 
Method Summary
 void checkInputs(java.util.List inputs)
          Default handling of input checking.
 void checkInputsNoBag(java.util.List inputs)
          Default handling of input checking.
 EvaluationResult evaluate(java.util.List inputs, com.sun.xacml.EvaluationCtx context)
          Evaluate the function, using the specified parameters.
static java.util.Set getSupportedIdentifiers()
          Returns a Set containing all the function identifiers supported by this class.
 
Methods inherited from class com.sun.xacml.cond.FunctionBase
evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, makeProcessingError, returnsBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_N_OF

public static final java.lang.String NAME_N_OF
Standard identifier for the n-of function.

See Also:
Constant Field Values
Constructor Detail

NOfFunction

public NOfFunction(java.lang.String functionName)
Creates a new NOfFunction object.

Method Detail

getSupportedIdentifiers

public static java.util.Set getSupportedIdentifiers()
Returns a Set containing all the function identifiers supported by this class.


evaluate

public EvaluationResult evaluate(java.util.List inputs,
                                 com.sun.xacml.EvaluationCtx context)
Evaluate the function, using the specified parameters.


checkInputs

public void checkInputs(java.util.List inputs)
                 throws java.lang.IllegalArgumentException
Description copied from class: FunctionBase
Default handling of input checking. This does some simple checking based on the type of constructor used. If you need anything more complex, or if you used the simple constructor, then you must override this method.

Specified by:
checkInputs in interface Function
Overrides:
checkInputs in class FunctionBase

checkInputsNoBag

public void checkInputsNoBag(java.util.List inputs)
                      throws java.lang.IllegalArgumentException
Description copied from class: FunctionBase
Default handling of input checking. This does some simple checking based on the type of constructor used. If you need anything more complex, or if you used the simple constructor, then you must override this method.

Specified by:
checkInputsNoBag in interface Function
Overrides:
checkInputsNoBag in class FunctionBase