public interface PatternListValue extends ListValue<PatternLayer>
ListValue
handling PatternLayer
s.
Virtually, this is the same as a ListValue
; however, the core
difference is the ability to add a BannerPatternShape
and
DyeColor
to create a new PatternLayer
.Modifier and Type | Method and Description |
---|---|
PatternListValue |
add(BannerPatternShape patternShape,
DyeColor color)
|
PatternListValue |
add(int index,
BannerPatternShape patternShape,
DyeColor color)
Creates and adds a
PatternLayer based on the
BannerPatternShape and DyeColor at the desired index
such that the element at the provided index is shifted to the left. |
PatternListValue |
add(int index,
Iterable<PatternLayer> values)
Adds the specified elements in the order that they are iterated
to the list at the specified index.
|
PatternListValue |
add(int index,
PatternLayer value)
Adds the specified element at the specified position in the list.
|
PatternListValue |
add(PatternLayer element)
Adds the given
element to this CollectionValue . |
PatternListValue |
addAll(Iterable<PatternLayer> elements)
|
ImmutablePatternListValue |
asImmutable()
Gets the
ImmutableValue version of this Value such that
all data is duplicated across to the new ImmutableValue . |
PatternListValue |
filter(Predicate<? super PatternLayer> predicate)
Applies a
Predicate to filter the underlying elements in the
backed Collection to create a new CollectionValue
separate from this CollectionValue . |
PatternListValue |
remove(int index)
Removes the element at the specified position in this list (optional
operation).
|
PatternListValue |
remove(PatternLayer element)
Removes the given
element from the backed Collection . |
PatternListValue |
removeAll(Iterable<PatternLayer> elements)
Removes all elements from the
Iterable from the backed
Collection . |
PatternListValue |
removeAll(Predicate<PatternLayer> predicate)
Iterates over all existing elements and removes any elements that
Predicate.test(Object) returns true . |
PatternListValue |
set(int index,
PatternLayer element)
Replaces the element at the specified index in this list with the
specified element.
|
PatternListValue |
set(List<PatternLayer> value)
Sets the underlying value to the provided
value . |
PatternListValue |
transform(Function<List<PatternLayer>,List<PatternLayer>> function)
Attempts to transform the underlying value based on the provided
Function such that the result of Function.apply(Object)
will replace the underlying value. |
contains, containsAll, copy, getAll, isEmpty, size
exists, get, getDefault, getDirect, getKey
forEach, iterator, spliterator
PatternListValue add(PatternLayer element)
CollectionValue
element
to this CollectionValue
.add
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
element
- The element to addPatternListValue add(BannerPatternShape patternShape, DyeColor color)
patternShape
- The pattern shapecolor
- The colorPatternListValue add(int index, PatternLayer value)
ListValue
add
in interface ListValue<PatternLayer>
index
- The index to add the provided element atvalue
- The element to addPatternListValue add(int index, BannerPatternShape patternShape, DyeColor color)
PatternLayer
based on the
BannerPatternShape
and DyeColor
at the desired index
such that the element at the provided index is shifted to the left.index
- The index to add the element atpatternShape
- The pattern shapecolor
- The color of the patternPatternListValue add(int index, Iterable<PatternLayer> values)
ListValue
add
in interface ListValue<PatternLayer>
index
- The index to add the elements atvalues
- The elements to addPatternListValue set(int index, PatternLayer element)
ListValue
set
in interface ListValue<PatternLayer>
index
- The index to replace the element withelement
- The element to setPatternListValue set(List<PatternLayer> value)
Value
value
.set
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
set
in interface Value<List<PatternLayer>>
value
- The value to setValueContainer
PatternListValue transform(Function<List<PatternLayer>,List<PatternLayer>> function)
Value
Function
such that the result of Function.apply(Object)
will replace the underlying value.transform
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
transform
in interface Value<List<PatternLayer>>
function
- The function to apply on the existing valueValueContainer
PatternListValue addAll(Iterable<PatternLayer> elements)
CollectionValue
addAll
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
elements
- The elements to addCollection.addAll(Collection)
PatternListValue remove(int index)
ListValue
remove
in interface ListValue<PatternLayer>
index
- The index of the element to removePatternListValue remove(PatternLayer element)
CollectionValue
element
from the backed Collection
.remove
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
element
- The element to removePatternListValue removeAll(Iterable<PatternLayer> elements)
CollectionValue
Iterable
from the backed
Collection
.removeAll
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
elements
- The elements to removePatternListValue removeAll(Predicate<PatternLayer> predicate)
CollectionValue
Predicate.test(Object)
returns true
.removeAll
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
predicate
- The predicate to remove elementsPatternListValue filter(Predicate<? super PatternLayer> predicate)
CollectionValue
Predicate
to filter the underlying elements in the
backed Collection
to create a new CollectionValue
separate from this CollectionValue
. This value is not modified,
nor is the underlying Collection
. Elements that return
true
from Predicate.test(Object)
are kept, and
those that return false
are excluded.filter
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
predicate
- The predicate to filterImmutablePatternListValue asImmutable()
Value
ImmutableValue
version of this Value
such that
all data is duplicated across to the new ImmutableValue
. Note
that once created, the ImmutableValue
is not going to change.asImmutable
in interface CollectionValue<PatternLayer,List<PatternLayer>,ListValue<PatternLayer>,ImmutableListValue<PatternLayer>>
asImmutable
in interface Value<List<PatternLayer>>
ImmutableValue
instance