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

Quick Search    Search Deep

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

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

public class HigherOrderFunction
extends java.lang.Object
implements Function

Represents all of the higher order bag functions, except map, which has its own class due to the issues with its return type. Unlike the other functions that are designed to work over any types (the type-* functions) these functions don't use specific names to describe what type they operate over, so you don't need to install new instances for any new datatypes you define.

Since:
1.0

Field Summary
private static java.lang.RuntimeException earlyException
           
private  int functionId
           
private static int ID_ALL_OF
           
private static int ID_ALL_OF_ALL
           
private static int ID_ALL_OF_ANY
           
private static int ID_ANY_OF
           
private static int ID_ANY_OF_ALL
           
private static int ID_ANY_OF_ANY
           
private  java.net.URI identifier
           
private static java.util.HashMap idMap
           
static java.lang.String NAME_ALL_OF
          Standard identifier for the all-of function.
static java.lang.String NAME_ALL_OF_ALL
          Standard identifier for the all-of-all function.
static java.lang.String NAME_ALL_OF_ANY
          Standard identifier for the all-of-any function.
static java.lang.String NAME_ANY_OF
          Standard identifier for the any-of function.
static java.lang.String NAME_ANY_OF_ALL
          Standard identifier for the any-of-all function.
static java.lang.String NAME_ANY_OF_ANY
          Standard identifier for the any-of-any function.
private static java.net.URI returnTypeURI
           
private  boolean secondIsBag
           
 
Constructor Summary
HigherOrderFunction(java.lang.String functionName)
          Creates a new instance of the given function.
 
Method Summary
private  EvaluationResult all(com.sun.xacml.attr.AttributeValue value, com.sun.xacml.attr.BagAttribute bag, Function function, com.sun.xacml.EvaluationCtx context)
          Private helper function that performs the all function
private  EvaluationResult allAnyHelper(com.sun.xacml.attr.BagAttribute anyBag, com.sun.xacml.attr.BagAttribute allBag, Function function, com.sun.xacml.EvaluationCtx context, boolean argumentsAreSwapped)
          Private helper for the all-of-any and any-of-all functions
private  EvaluationResult allOfAny(com.sun.xacml.attr.BagAttribute anyBag, com.sun.xacml.attr.BagAttribute allBag, Function function, com.sun.xacml.EvaluationCtx context)
          all-of-any
private  EvaluationResult any(com.sun.xacml.attr.AttributeValue value, com.sun.xacml.attr.BagAttribute bag, Function function, com.sun.xacml.EvaluationCtx context, boolean argumentsAreSwapped)
          Private helper function that performs the any function, but lets you swap the argument order (so it can be used by any-of-all)
private  EvaluationResult anyAndAllHelper(com.sun.xacml.attr.AttributeValue value, com.sun.xacml.attr.BagAttribute bag, Function function, com.sun.xacml.EvaluationCtx context, boolean allFunction, boolean argumentsAreSwapped)
          Private helper for any & all functions
private  EvaluationResult anyOfAll(com.sun.xacml.attr.BagAttribute anyBag, com.sun.xacml.attr.BagAttribute allBag, Function function, com.sun.xacml.EvaluationCtx context)
          any-of-all
 void checkInputs(java.util.List inputs)
          Checks that the given inputs are valid for this function.
 void checkInputsNoBag(java.util.List inputs)
          Checks that the given inputs are valid for this function if all inputs are considered to not be bags.
 EvaluationResult evaluate(java.util.List inputs, com.sun.xacml.EvaluationCtx context)
          Evaluates the function, using the specified parameters.
 java.net.URI getIdentifier()
          Returns the full identifier of this function, as known by the factories.
 java.net.URI getReturnType()
          Returns the type of attribute value that will be returned by this function.
static java.util.Set getSupportedIdentifiers()
          Returns a Set containing all the function identifiers supported by this class.
 boolean returnsBag()
          Returns whether or not this function will actually return a bag of values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_ANY_OF

public static final java.lang.String NAME_ANY_OF
Standard identifier for the any-of function.

See Also:
Constant Field Values

NAME_ALL_OF

public static final java.lang.String NAME_ALL_OF
Standard identifier for the all-of function.

See Also:
Constant Field Values

NAME_ANY_OF_ANY

public static final java.lang.String NAME_ANY_OF_ANY
Standard identifier for the any-of-any function.

See Also:
Constant Field Values

NAME_ALL_OF_ANY

public static final java.lang.String NAME_ALL_OF_ANY
Standard identifier for the all-of-any function.

See Also:
Constant Field Values

NAME_ANY_OF_ALL

public static final java.lang.String NAME_ANY_OF_ALL
Standard identifier for the any-of-all function.

See Also:
Constant Field Values

NAME_ALL_OF_ALL

public static final java.lang.String NAME_ALL_OF_ALL
Standard identifier for the all-of-all function.

See Also:
Constant Field Values

ID_ANY_OF

private static final int ID_ANY_OF
See Also:
Constant Field Values

ID_ALL_OF

private static final int ID_ALL_OF
See Also:
Constant Field Values

ID_ANY_OF_ANY

private static final int ID_ANY_OF_ANY
See Also:
Constant Field Values

ID_ALL_OF_ANY

private static final int ID_ALL_OF_ANY
See Also:
Constant Field Values

ID_ANY_OF_ALL

private static final int ID_ANY_OF_ALL
See Also:
Constant Field Values

ID_ALL_OF_ALL

private static final int ID_ALL_OF_ALL
See Also:
Constant Field Values

idMap

private static java.util.HashMap idMap

functionId

private int functionId

identifier

private java.net.URI identifier

secondIsBag

private boolean secondIsBag

returnTypeURI

private static java.net.URI returnTypeURI

earlyException

private static java.lang.RuntimeException earlyException
Constructor Detail

HigherOrderFunction

public HigherOrderFunction(java.lang.String functionName)
Creates a new instance of the given function.

Method Detail

getSupportedIdentifiers

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


getIdentifier

public java.net.URI getIdentifier()
Returns the full identifier of this function, as known by the factories.

Specified by:
getIdentifier in interface Function

getReturnType

public java.net.URI getReturnType()
Returns the type of attribute value that will be returned by this function.

Specified by:
getReturnType in interface Function

returnsBag

public boolean returnsBag()
Returns whether or not this function will actually return a bag of values.

Specified by:
returnsBag in interface Function

evaluate

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

Specified by:
evaluate in interface Function

checkInputs

public void checkInputs(java.util.List inputs)
                 throws java.lang.IllegalArgumentException
Checks that the given inputs are valid for this function.

Specified by:
checkInputs in interface Function

checkInputsNoBag

public void checkInputsNoBag(java.util.List inputs)
                      throws java.lang.IllegalArgumentException
Checks that the given inputs are valid for this function if all inputs are considered to not be bags. This always throws an exception, since this function by definition must work on bags.

Specified by:
checkInputsNoBag in interface Function

any

private EvaluationResult any(com.sun.xacml.attr.AttributeValue value,
                             com.sun.xacml.attr.BagAttribute bag,
                             Function function,
                             com.sun.xacml.EvaluationCtx context,
                             boolean argumentsAreSwapped)
Private helper function that performs the any function, but lets you swap the argument order (so it can be used by any-of-all)


all

private EvaluationResult all(com.sun.xacml.attr.AttributeValue value,
                             com.sun.xacml.attr.BagAttribute bag,
                             Function function,
                             com.sun.xacml.EvaluationCtx context)
Private helper function that performs the all function


anyAndAllHelper

private EvaluationResult anyAndAllHelper(com.sun.xacml.attr.AttributeValue value,
                                         com.sun.xacml.attr.BagAttribute bag,
                                         Function function,
                                         com.sun.xacml.EvaluationCtx context,
                                         boolean allFunction,
                                         boolean argumentsAreSwapped)
Private helper for any & all functions


anyOfAll

private EvaluationResult anyOfAll(com.sun.xacml.attr.BagAttribute anyBag,
                                  com.sun.xacml.attr.BagAttribute allBag,
                                  Function function,
                                  com.sun.xacml.EvaluationCtx context)
any-of-all


allOfAny

private EvaluationResult allOfAny(com.sun.xacml.attr.BagAttribute anyBag,
                                  com.sun.xacml.attr.BagAttribute allBag,
                                  Function function,
                                  com.sun.xacml.EvaluationCtx context)
all-of-any


allAnyHelper

private EvaluationResult allAnyHelper(com.sun.xacml.attr.BagAttribute anyBag,
                                      com.sun.xacml.attr.BagAttribute allBag,
                                      Function function,
                                      com.sun.xacml.EvaluationCtx context,
                                      boolean argumentsAreSwapped)
Private helper for the all-of-any and any-of-all functions