public interface Splittable<T>
| Modifier and Type | Method and Description |
|---|---|
void |
perform(Consumer<T> action,
T part)
Executes a read-only action on the specified part of this object.
|
T[] |
split(int n,
boolean threadsafe)
Returns
n distinct parts of this object. |
void |
update(Consumer<T> action,
T part)
Executes an update action on the specified part of this object.
|
void perform(Consumer<T> action, T part)
action - the read-only action.part - this object or a part of it.UnsupportedOperationException - if the action tries to update the
specified part.T[] split(int n, boolean threadsafe)
n distinct parts of this object.
This method may return an array of size less than n
(e.g. an array of size one if this object cannot split).n - the number of parts.threadsafe - true if the returned parts can be updated
concurrently; false otherwise.IllegalArgumentException - if n < 1Copyright © 2017. All rights reserved.