com.bigdata.relation.rule
Class HashBindingSet

java.lang.Object
  extended by com.bigdata.relation.rule.HashBindingSet
All Implemented Interfaces:
IBindingSet, Serializable, Cloneable

public class HashBindingSet
extends Object
implements IBindingSet

IBindingSet backed by a HashMap.

Version:
$Id: HashBindingSet.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
  HashBindingSet()
          New empty binding set.
protected HashBindingSet(HashBindingSet src)
          Copy constructor.
 
Method Summary
 void clear(IVariable var)
          Clear any binding for the variable.
 void clearAll()
          Clear all bindings.
 HashBindingSet clone()
          Return a shallow copy of the binding set.
 boolean equals(IBindingSet 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.
 boolean isBound(IVariable var)
          Return true iff the variable is bound.
 Iterator<Map.Entry<IVariable,IConstant>> iterator()
          Iterator does not support removal, set, or concurrent modification.
 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HashBindingSet

public HashBindingSet()
New empty binding set.


HashBindingSet

protected HashBindingSet(HashBindingSet src)
Copy constructor.

Parameters:
src -
Method Detail

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.

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.

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).

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

toString

public String toString()
Overrides:
toString in class Object

iterator

public Iterator<Map.Entry<IVariable,IConstant>> iterator()
Iterator does not support removal, set, or concurrent modification.

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

size

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

Specified by:
size in interface IBindingSet

clone

public HashBindingSet 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

equals

public boolean equals(IBindingSet 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
Parameters:
o - Another binding set.


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