Package org.eclipse.rdf4j.query
Class AbstractBindingSet
- java.lang.Object
-
- org.eclipse.rdf4j.query.AbstractBindingSet
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<Binding>,BindingSet
- Direct Known Subclasses:
ArrayBindingSet,ListBindingSet,MapBindingSet,QueryBindingSet,SPARQLQueryBindingSet,ValueMappingBindingSet
public abstract class AbstractBindingSet extends java.lang.Object implements BindingSet
Abstract base class forBindingSetimplementations, providing a.o. consistent implementations ofBindingSet.equals(Object)andBindingSet.hashCode().- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description AbstractBindingSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compares a BindingSet object to another object.inthashCode()The hash code of a binding is defined as the bit-wise XOR of the hash codes of its bindings:java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.query.BindingSet
getBinding, getBindingNames, getValue, hasBinding, isEmpty, iterator, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:BindingSetCompares a BindingSet object to another object.- Specified by:
equalsin interfaceBindingSet- Overrides:
equalsin classjava.lang.Object- 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 final 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 classjava.lang.Object- Returns:
- A hash code for the BindingSet.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-