com.bigdata.relation.rule.eval
Class Solution<E>

java.lang.Object
  extended by com.bigdata.relation.rule.eval.Solution<E>
All Implemented Interfaces:
ISolution<E>, Serializable

public class Solution<E>
extends Object
implements ISolution<E>, Serializable

Flyweight implementation.

Version:
$Id: Solution.java 5672 2011-11-17 17:41:53Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
Solution(IJoinNexus joinNexus, IRule<E> rule, IBindingSet bindingSet)
          Constructs the element iff requested, saves the rule reference iff requested, and clones and saves the bindingSet iff requested.
 
Method Summary
 E get()
          Return the element materialized from the head of the rule given a set of bindings for that rule (optional operation).
 IBindingSet getBindingSet()
          Return the IBindingSet for this solution (optional operation).
 IRule<E> getRule()
          Return the IRule that generated this solution (optional operation).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Solution

public Solution(IJoinNexus joinNexus,
                IRule<E> rule,
                IBindingSet bindingSet)
Constructs the element iff requested, saves the rule reference iff requested, and clones and saves the bindingSet iff requested. The requested behavior depends on IJoinNexus.solutionFlags(). When requested, the element is created using IRelation#newElement(IPredicate, IBindingSet) for the IRelation that is named by the head of the rule.

Parameters:
e - The element.
rule - The rule.
bindingSet - The binding set for this solution. If IJoinNexus.BINDINGS was specified, then the binding set will be cloned by this ctor.
Throws:
IllegalArgumentException - if any parameter is null.
Method Detail

get

public E get()
Description copied from interface: ISolution
Return the element materialized from the head of the rule given a set of bindings for that rule (optional operation).

Specified by:
get in interface ISolution<E>
Returns:
The element -or- null if the element was not requested.

getRule

public IRule<E> getRule()
Description copied from interface: ISolution
Return the IRule that generated this solution (optional operation).

Specified by:
getRule in interface ISolution<E>
Returns:
The IRule -or- null if the rule was not requested.

getBindingSet

public IBindingSet getBindingSet()
Description copied from interface: ISolution
Return the IBindingSet for this solution (optional operation).

Specified by:
getBindingSet in interface ISolution<E>
Returns:
The IBindingSet.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.