org.openpermis.policy.predicate
Class SubstringOf

java.lang.Object
  extended by org.openpermis.policy.predicate.AbstractPredicate<Value<?>>
      extended by org.openpermis.policy.predicate.SubstringOf
All Implemented Interfaces:
Serializable, Part, Predicate

public class SubstringOf
extends AbstractPredicate<Value<?>>

Substring of operation.

See Also:
Serialized Form
Since:
0.1.0

Field Summary
 
Fields inherited from interface org.openpermis.policy.Predicate
FALSE, TRUE
 
Constructor Summary
SubstringOf(Value<?> first, Value<?> second)
          Creates a substring of operation.
 
Method Summary
 boolean comparablePredicate(Predicate predicate)
          Compares the type of predicate with this.
 boolean isMatchable(Map<String,Class<?>> arguments)
          Try to match the predicate with arguments, without evaluating the predicates but to check that no runtime exception is thrown at runtime.
 boolean isValid()
          Validates this predicate.
 boolean matches(TimeStamp timeStamp, Map<String,?> arguments)
          Try to match the predicate according to time and arguments.
protected  int partHashCode()
          Returns the hash code of this part.
 
Methods inherited from class org.openpermis.policy.predicate.AbstractPredicate
equals, getOperand, getOperandCount, getOperands, hashCode, isValid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openpermis.policy.Part
toString
 

Constructor Detail

SubstringOf

public SubstringOf(Value<?> first,
                   Value<?> second)
Creates a substring of operation.

Parameters:
first - the first value.
second - the second value.
Since:
0.1.0
Method Detail

isValid

public boolean isValid()
Description copied from interface: Predicate
Validates this predicate.

Returns:
true if this predicate is valid.
Since:
0.1.0

matches

public boolean matches(TimeStamp timeStamp,
                       Map<String,?> arguments)
Description copied from interface: Predicate
Try to match the predicate according to time and arguments.

Parameters:
timeStamp - the current TimeStamp.
arguments - a Map of arguments.
Returns:
the result of this predicate.
Since:
0.1.0

isMatchable

public boolean isMatchable(Map<String,Class<?>> arguments)
Description copied from interface: Predicate
Try to match the predicate with arguments, without evaluating the predicates but to check that no runtime exception is thrown at runtime.

Parameters:
arguments - a Map of arguments.
Returns:
true if this predicate is matchable and won't throw an exception at runtime.
Since:
0.3.0

comparablePredicate

public boolean comparablePredicate(Predicate predicate)
Description copied from class: AbstractPredicate
Compares the type of predicate with this.

Specified by:
comparablePredicate in class AbstractPredicate<Value<?>>
Parameters:
predicate - a Predicate.
Returns:
true if this is comparable to predicate.
Since:
0.1.0

partHashCode

protected int partHashCode()
Description copied from class: AbstractPredicate
Returns the hash code of this part.

Specified by:
partHashCode in class AbstractPredicate<Value<?>>
Returns:
hash code of this part.
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:49
Copyright (c) 2002-2007 Ergon Informatik AG