public abstract class AbstractBindingSet extends Object implements BindingSet
BindingSet
implementations, providing a.o. consistent implementations of
BindingSet.equals(Object)
and BindingSet.hashCode()
.Constructor and Description |
---|
AbstractBindingSet() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Compares a BindingSet object to another object.
|
int |
hashCode()
The hash code of a binding is defined as the bit-wise XOR of the hash codes of its bindings:
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBinding, getBindingNames, getValue, hasBinding, iterator, size
forEach, spliterator
public boolean equals(Object other)
BindingSet
equals
in interface BindingSet
equals
in class Object
other
- The object to compare this binding to.BindingSet
and it contains the same set of
bindings (disregarding order), false otherwise.public final int hashCode()
BindingSet
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.
hashCode
in interface BindingSet
hashCode
in class Object
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.