com.bigdata.bop
Class ContextBindingSet

java.lang.Object
  extended by com.bigdata.bop.ContextBindingSet
All Implemented Interfaces:
IBindingSet, Serializable, Cloneable

public class ContextBindingSet
extends Object
implements IBindingSet

Wraps an IBindingSet to provide access to the BOpContext. The BOpContext information is transient and will not cross the wire.

Author:
Bryan Thompson
See Also:
Expose the LexiconConfiguration to function BOPs , Serialized Form

Constructor Summary
ContextBindingSet(BOpContext<?> context, IBindingSet delegate)
           
 
Method Summary
 void clear(IVariable var)
          Clear any binding for the variable.
 void clearAll()
          Clear all bindings.
 IBindingSet clone()
          Return a shallow copy of the binding set.
 IBindingSet copy(IVariable[] variablesToKeep)
          Return a shallow copy of the binding set, eliminating unnecessary variables.
 boolean equals(Object o)
          True iff the variables and their bound values are the same for the two binding sets.
 IConstant get(IVariable var)
          Return the binding for the variable.
 BOpContext getBOpContext()
           
 int hashCode()
          The hash code of a binding is defined as the bit-wise XOR of the hash codes of the IConstants for its bound variables.
 boolean isBound(IVariable var)
          Return true iff the variable is bound.
 boolean isEmpty()
          true iff there are no variable bindings in the binding set.
 Iterator<Map.Entry<IVariable,IConstant>> iterator()
          Visits the bindings.
 void set(IVariable var, IConstant val)
          Bind the variable to the value.
 int size()
          The #of bound variables.
 String toString()
           
 Iterator<IVariable> vars()
          Visits the bound variables.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextBindingSet

public ContextBindingSet(BOpContext<?> context,
                         IBindingSet delegate)
Method Detail

getBOpContext

public BOpContext getBOpContext()

isBound

public boolean isBound(IVariable var)
Description copied from interface: IBindingSet
Return true iff the variable is bound.

Specified by:
isBound in interface IBindingSet
Parameters:
var - The variable.
Returns:
true if the variable is bound.

set

public void set(IVariable var,
                IConstant val)
Description copied from interface: IBindingSet
Bind the variable to the value.

Specified by:
set in interface IBindingSet
Parameters:
var - The variable.
val - The value (MAY NOT be null).

get

public IConstant get(IVariable var)
Description copied from interface: IBindingSet
Return the binding for the variable.

Specified by:
get in interface IBindingSet
Parameters:
var - The variable.
Returns:
the binding for the variable -or- null iff the variable is not bound.

clear

public void clear(IVariable var)
Description copied from interface: IBindingSet
Clear any binding for the variable.

Specified by:
clear in interface IBindingSet
Parameters:
var - The variable.

clearAll

public void clearAll()
Description copied from interface: IBindingSet
Clear all bindings.

Specified by:
clearAll in interface IBindingSet

isEmpty

public boolean isEmpty()
Description copied from interface: IBindingSet
true iff there are no variable bindings in the binding set.

Specified by:
isEmpty in interface IBindingSet

size

public int size()
Description copied from interface: IBindingSet
The #of bound variables.

Specified by:
size in interface IBindingSet

iterator

public Iterator<Map.Entry<IVariable,IConstant>> iterator()
Description copied from interface: IBindingSet
Visits the bindings.

Specified by:
iterator in interface IBindingSet

vars

public Iterator<IVariable> vars()
Description copied from interface: IBindingSet
Visits the bound variables.

Specified by:
vars in interface IBindingSet

clone

public IBindingSet clone()
Description copied from interface: IBindingSet
Return a shallow copy of the binding set.

Specified by:
clone in interface IBindingSet
Overrides:
clone in class Object

copy

public IBindingSet copy(IVariable[] variablesToKeep)
Description copied from interface: IBindingSet
Return a shallow copy of the binding set, eliminating unnecessary variables.

Specified by:
copy in interface IBindingSet
Parameters:
variablesToKeep - When non-null, only the listed variables are retained.

equals

public boolean equals(Object o)
Description copied from interface: IBindingSet
True iff the variables and their bound values are the same for the two binding sets.

Specified by:
equals in interface IBindingSet
Overrides:
equals in class Object
Parameters:
o - Another binding set.

hashCode

public int hashCode()
Description copied from interface: IBindingSet
The hash code of a binding is defined as the bit-wise XOR of the hash codes of the IConstants for its bound variables. Unbound variables are ignored when computing the hash code. Binding sets are unordered collections, therefore the calculated hash code intentionally does not depend on the order in which the bindings are visited. The hash code reflects the current state of the bindings and must be recomputed if the bindings are changed.

Specified by:
hashCode in interface IBindingSet
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


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