org.aselect.agent.authorization.parsing
Class EvaluationTree

java.lang.Object
  extended by org.aselect.agent.authorization.parsing.EvaluationTree

public class EvaluationTree
extends java.lang.Object

A binary tree that is constructed during evaluating rule parsing.

Description:
Represents a recursive tree data structure in which each node has at most two children. The node contains data as an Object and can have children left and right.

This binary tree is created by the AuthorizationRuleParser and used by the AuthorizationRuleEvaluator to evaluate authorization rules.

Note: To improve performance the node and the child trees variables can be accessed directly.

Concurrency issues:
Use one EvaluationTree per authorization rule.

Author:
Alfa & Ariss

Field Summary
 java.lang.Object _oNode
          The tree node its value (data).
 EvaluationTree _tLeft
          The tree node its left children.
 EvaluationTree _tRight
          The tree node its right children.
 
Constructor Summary
EvaluationTree(EvaluationTree tLeft, EvaluationTree tRight, java.lang.Object oNode)
          Creates a simple recursive binary tree.
 
Method Summary
 boolean isEmpty()
          Determine if this tree node is empty.
 boolean isLeaf()
          Determine if this tree node is a leaf.
 java.lang.String toString()
          Retrieve a String representation of this EvaluationTree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_tLeft

public EvaluationTree _tLeft
The tree node its left children.


_tRight

public EvaluationTree _tRight
The tree node its right children.


_oNode

public java.lang.Object _oNode
The tree node its value (data).

Constructor Detail

EvaluationTree

public EvaluationTree(EvaluationTree tLeft,
                      EvaluationTree tRight,
                      java.lang.Object oNode)
Creates a simple recursive binary tree.

Description:
Create a tree with the given data and children.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
tLeft - The left children of this tree.
tRight - The right children of this tree.
oNode - The node its value (data).
Method Detail

isEmpty

public boolean isEmpty()
Determine if this tree node is empty.

Description:
Check if this tree node contains a value.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
true if this node has no value (data), otherwise false.

isLeaf

public boolean isLeaf()
Determine if this tree node is a leaf.

Description:
A node that has no children is called a leaf.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Returns:
true if this node of the tree is a leaf, otherwise false.

toString

public java.lang.String toString()
Retrieve a String representation of this EvaluationTree.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2008 SURFnet BV. All Rights Reserved.