Class AbstractBindingSet
java.lang.Object
org.eclipse.rdf4j.query.AbstractBindingSet
- All Implemented Interfaces:
Serializable, Iterable<Binding>, BindingSet
- Direct Known Subclasses:
ArrayBindingSet, ListBindingSet, MapBindingSet, QueryBindingSet, SPARQLQueryBindingSet
Abstract base class for
BindingSet implementations, providing a.o. consistent implementations of
BindingSet.equals(Object) and BindingSet.hashCode().- Author:
- Jeen Broekstra
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from interface BindingSet
getBinding, getBindingNames, getValue, hasBinding, isCompatible, isEmpty, iterator, sizeModifier and TypeMethodDescriptiongetBinding(String bindingName) Gets the binding with the specified name from this BindingSet.Gets the names of the bindings in this BindingSet.Gets the value of the binding with the specified name from this BindingSet.booleanhasBinding(String bindingName) Checks whether this BindingSet has a binding with the specified name.default booleanisCompatible(BindingSet other) Check whether this BindingSet is compatible with another.default booleanisEmpty()iterator()Creates an iterator over the bindings in this BindingSet.intsize()Returns the number of bindings in this BindingSet.Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AbstractBindingSet
public AbstractBindingSet()
-
-
Method Details
-
equals
Description copied from interface:BindingSetCompares a BindingSet object to another object.- Specified by:
equalsin interfaceBindingSet- Overrides:
equalsin classObject- Parameters:
other- The object to compare this binding to.- Returns:
- true if the other object is an instance of
BindingSetand it contains the same set of bindings (disregarding order), false otherwise.
-
hashCode
public int hashCode()Description copied from interface:BindingSetThe hash code of a binding is defined as the bit-wise XOR of the hash codes of its bindings:int hashCode = 0; for (Binding binding : this) { hashCode ˆ= binding.getName().hashCode() ˆ binding.getValue().hashCode(); }Note: the calculated hash code intentionally does not depend on the order in which the bindings are iterated over.
- Specified by:
hashCodein interfaceBindingSet- Overrides:
hashCodein classObject- Returns:
- A hash code for the BindingSet.
-
toString
-