public class MultiDockAcceptance extends java.lang.Object implements DockAcceptance
DockAcceptance
which consists of other acceptances, and returns
only true
if all children of this acceptance return true
.Constructor and Description |
---|
MultiDockAcceptance() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(DockStation parent,
Dockable child)
Tells whether or not
child is allowed to become a
real child of parent . |
boolean |
accept(DockStation parent,
Dockable child,
Dockable next)
Tells whether
child , which may be already a child of
parent , and next are allowed to be combined. |
void |
add(DockAcceptance acceptance)
Adds a
DockAcceptance to the list of acceptances, which must be
asked, before an accept -method returns true . |
void |
remove(DockAcceptance acceptance)
|
public void add(DockAcceptance acceptance)
DockAcceptance
to the list of acceptances, which must be
asked, before an accept
-method returns true
.acceptance
- the acceptance to askpublic void remove(DockAcceptance acceptance)
acceptance
- the acceptance to removepublic boolean accept(DockStation parent, Dockable child)
DockAcceptance
child
is allowed to become a
real child of parent
.accept
in interface DockAcceptance
parent
- the future parentchild
- the future childchild
and parent
are allowed to be combinedpublic boolean accept(DockStation parent, Dockable child, Dockable next)
DockAcceptance
child
, which may be already a child of
parent
, and next
are allowed to be combined.
The result of this combination would replace child
on parent
.accept
in interface DockAcceptance
parent
- the future parent of the combinationchild
- a Dockable which may be a child of parentnext
- a new Dockable