| Constructor and Description |
|---|
MultiMerger() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Merger merger)
Adds a new algorithm to this merger.
|
boolean |
canMerge(StationDropOperation operation,
DockStation parent,
DockStation child)
Checks whether
Merger.merge(StationDropOperation, DockStation, DockStation) will succeed or not. |
Merger |
get(int index)
Gets the
index'th merger in this list of mergers. |
void |
merge(StationDropOperation operation,
DockStation parent,
DockStation child)
Moves all children of
child to parent, leaving child
empty. |
void |
remove(Merger merger)
Removes
merger from this MultiMerger. |
int |
size()
Gets the total number of mergers in this set of mergers.
|
public void add(Merger merger)
merger - the new algorithm, not nullpublic void remove(Merger merger)
merger from this MultiMerger.merger - the item to removepublic int size()
public Merger get(int index)
index'th merger in this list of mergers.index - the locationnullpublic boolean canMerge(StationDropOperation operation, DockStation parent, DockStation child)
MergerMerger.merge(StationDropOperation, DockStation, DockStation) will succeed or not. This
method will only be called if parent would accept all children
of child. This method may be called during "drop" and during "move" operations.canMerge in interface Mergeroperation - the operation that would be executed, can be nullparent - an existing stationchild - a station that is dragged around and may be dropped onto parentMerger.merge(StationDropOperation, DockStation, DockStation) will succeedpublic void merge(StationDropOperation operation, DockStation parent, DockStation child)
Mergerchild to parent, leaving child
empty. This method is only called if canMerge
returned true and if the accept-methods allow the operation.child is not parent, then child will be removed
from its parent. Otherwise the child remains, allowing this Merger to reuse it.Copyright © 2017 Docking Frames. All rights reserved.