author | Jaroslav Tulach <jtulach@netbeans.org> |
Sat, 14 Jun 2008 09:54:19 +0200 | |
changeset 99 | 4bf599099de7 |
child 100 | 849777d451a5 |
permissions | -rw-r--r-- |
jtulach@99 | 1 |
package org.apidesign.sidemeanings; |
jtulach@99 | 2 |
|
jtulach@99 | 3 |
public final class Mixed { |
jtulach@99 | 4 |
private Mixed() {} |
jtulach@99 | 5 |
|
jtulach@99 | 6 |
|
jtulach@99 | 7 |
// BEGIN: sidemeanings.Mixed.Dirty |
jtulach@99 | 8 |
public static abstract class MixedClass { |
jtulach@99 | 9 |
protected MixedClass() { } |
jtulach@99 | 10 |
|
jtulach@99 | 11 |
public final void apiForClients() { /*...*/ } |
jtulach@99 | 12 |
protected abstract void toBeImplementedBySubclass(); |
jtulach@99 | 13 |
protected final void toBeCalledBySubclass() { /* ... */ } |
jtulach@99 | 14 |
} |
jtulach@99 | 15 |
// END: sidemeanings.Mixed.Dirty |
jtulach@99 | 16 |
|
jtulach@99 | 17 |
// BEGIN: sidemeanings.Mixed.Clean |
jtulach@99 | 18 |
public static final class NonMixed { |
jtulach@99 | 19 |
private NonMixed() {} |
jtulach@99 | 20 |
public static NonMixed create(NonMixedImpl impl) { |
jtulach@99 | 21 |
NonMixed api = new NonMixed(); |
jtulach@99 | 22 |
Callback callback = new Callback(api); |
jtulach@99 | 23 |
impl.initialize(callback); |
jtulach@99 | 24 |
return api; |
jtulach@99 | 25 |
} |
jtulach@99 | 26 |
|
jtulach@99 | 27 |
public final void apiForClients() { /*...*/ } |
jtulach@99 | 28 |
} |
jtulach@99 | 29 |
|
jtulach@99 | 30 |
public static interface NonMixedImpl { |
jtulach@99 | 31 |
public void initialize(Callback c); |
jtulach@99 | 32 |
public void toBeImplementedBySubclass(); |
jtulach@99 | 33 |
} |
jtulach@99 | 34 |
|
jtulach@99 | 35 |
public static final class Callback { |
jtulach@99 | 36 |
Callback(NonMixed nomMixed) { |
jtulach@99 | 37 |
} |
jtulach@99 | 38 |
public final void toBeCalledBySubclass() { |
jtulach@99 | 39 |
/*...*/ |
jtulach@99 | 40 |
} |
jtulach@99 | 41 |
} |
jtulach@99 | 42 |
// BEGIN: sidemeanings.Mixed.Clean |
jtulach@99 | 43 |
|
jtulach@99 | 44 |
|
jtulach@99 | 45 |
} |
jtulach@99 | 46 |
|
jtulach@99 | 47 |