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)
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)
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.IllegalArgumentException
- if n <= 1
Copyright © 2005-2013 Javolution. All Rights Reserved.