Class Bindings<V,B extends Binding<V,B>>
- Type Parameters:
V
- the type of aBinding
's attribute valuesB
- The concrete subtype of this class
- Direct Known Subclasses:
Qualifiers
- Author:
- Laird Nelson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
containsUnique
(String name) Returnstrue
if and only if there is exactly oneBinding
contained by thisBindings
whose name is equal to the suppliedname
.final Optional<? extends ConstantDesc>
Returns anOptional
housing aConstantDesc
describing thisBindings
, if thisBindings
is capable of being represented as a dynamic constant, or an emptyOptional
if not.protected MethodHandleDesc
Returns aMethodHandleDesc
describing the constructor orstatic
method that will be used to create a dynamic constant representing thisBindings
.final boolean
final int
hashCode()
Returns a hashcode for thisBindings
.final int
intersectionSize
(Iterable<?> other) final boolean
isEmpty()
Returnstrue
if thisBindings
is logically empty.iterator()
final int
size()
Returns0
or a positive integer describing the number of entries contained by thisBindings
.final Spliterator<B>
stream()
final int
symmetricDifferenceSize
(Iterable<?> other) toString()
final B
Returns the soleBinding
instance whose name is equal to the suppliedname
, ornull
if either there is no suchBinding
or there are severalBinding
s with the suppliedname
.final V
uniqueValue
(String name)
-
Constructor Details
-
Method Details
-
isEmpty
Returnstrue
if thisBindings
is logically empty. -
size
Returns0
or a positive integer describing the number of entries contained by thisBindings
.- Returns:
- the size of this
Bindings
- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
uniqueValue
Returns the soleBinding
value whose name is equal to the suppliedname
, ornull
if either there is no suchBinding
or there are severalBinding
s with the suppliedname
.- Parameters:
name
- the name; may benull
in which casefalse
will be returned- Returns:
- the sole
Binding
value whose name is equal to the suppliedname
, ornull
if either there is no suchBinding
or there are severalBinding
s with the suppliedname
. - See Also:
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method may return
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
unique
Returns the soleBinding
instance whose name is equal to the suppliedname
, ornull
if either there is no suchBinding
or there are severalBinding
s with the suppliedname
.- Parameters:
name
- the name; may benull
in which casefalse
will be returned- Returns:
- the sole
Binding
instance whose name is equal to the suppliedname
, ornull
if either there is no suchBinding
or there are severalBinding
s with the suppliedname
. - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method may return
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
contains
Returnstrue
if and only if the suppliedObject
is contained by thisBindings
.If the
Object
is aBinding
, the containment check is performed via an equality check. If theObject
is aString
, then this method will returntrue
if there is aBinding
contained by thisBindings
whose name is equal to the suppliedString
.There may be many
Binding
instances contained by thisBindings
whose names are equal.- Parameters:
o
- theObject
to test;true
return values are possible only when thisObject
is either aBinding
or aString
- Returns:
true
if and only if the suppliedObject
is contained by thisBindings
- See Also:
- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
containsUnique
Returnstrue
if and only if there is exactly oneBinding
contained by thisBindings
whose name is equal to the suppliedname
.- Parameters:
name
- the name to test; may benull
in which casefalse
will be returned- Returns:
true
if and only if there is exactly oneBinding
contained by thisBindings
whose name is equal to the suppliedname
- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
stream
-
iterator
- Specified by:
iterator
in interfaceIterable<V>
- Returns:
- a non-
null
, immutableIterator
ofBinding
instances contained by thisBindings
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
spliterator
- Specified by:
spliterator
in interfaceIterable<V>
- Returns:
- a non-
null
, immutableSpliterator
ofBinding
instances contained by thisBindings
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
intersectionSize
-
symmetricDifferenceSize
Returns the size of the symmetric difference between thisBindings
and the suppliedIterable
.The number returned is always
0
or greater.The size of the symmetric difference between this
Bindings
instance and the suppliedIterable
is the number of entries that are in one of these two objects but not in the other.- Parameters:
other
- anIterable
; may benull
in which case the result of an invocation of thisBindings
'size()
method will be returned- Returns:
- the size of the symmetric difference between
this
Bindings
and the suppliedIterable
; always0
or greater - Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
describeConstable
Returns anOptional
housing aConstantDesc
describing thisBindings
, if thisBindings
is capable of being represented as a dynamic constant, or an emptyOptional
if not.- Specified by:
describeConstable
in interfaceConstable
- Returns:
- an
Optional
housing aConstantDesc
describing thisBinding
, if thisBindings
is capable of being represented as a dynamic constant, or an emptyOptional
if not - See Also:
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
describeConstructor
Returns aMethodHandleDesc
describing the constructor orstatic
method that will be used to create a dynamic constant representing thisBindings
.- Returns:
- a
MethodHandleDesc
describing the constructor orstatic
method that will be used to create a dynamic constant representing thisBindings
- Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Nullability:
- This method does not, and its overrides must not,
return
null
. - Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-
hashCode
Returns a hashcode for thisBindings
. -
equals
Returnstrue
if and only if thisBindings
is equal to the suppliedObject
.The supplied
Object
is considered to be equal to thisBindings
if and only if:- Overrides:
equals
in classObject
- Parameters:
other
- theObject
to test; may benull
in which casefalse
will be returned- Returns:
true
if the suppliedObject
is equal to thisBinding
- See Also:
- Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-
toString
Returns aString
representation of thisBindings
.The format of the returned
String
is deliberately undefined and may change between versions of this class without prior notice.- Overrides:
toString
in classObject
- Returns:
- a
String
representation of thisBindings
- Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Nullability:
- This method does not, and its overrides must not,
return
null
. - Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-