added flyweight example
This commit is contained in:
15
src/learn/simple_flyweight/UnsharedConcreteFlyweight.java
Normal file
15
src/learn/simple_flyweight/UnsharedConcreteFlyweight.java
Normal file
@ -0,0 +1,15 @@
|
||||
package learn.simple_flyweight;
|
||||
|
||||
public class UnsharedConcreteFlyweight extends Flyweight {
|
||||
private long allState;
|
||||
|
||||
public UnsharedConcreteFlyweight(long allState) {
|
||||
super();
|
||||
this.allState = allState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operation(long extrinsicState) {
|
||||
System.out.println("Unshared Flyweight " + allState + " calling operation with extrinsic state " + extrinsicState);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user