Last active
December 11, 2015 22:18
-
-
Save HDBandit/1e3a7d7d6dacdea329b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CarFlyWeight implements Car { | |
private long frameNumber; | |
private LightCar lightCar; | |
public CarFlyWeight(long frameNumber, LightCar lightCar) { | |
this.frameNumber = frameNumber; | |
this.lightCar = lightCar; | |
} | |
@Override | |
public String getEngine() { | |
return lightCar.getEngine(); | |
} | |
@Override | |
public String getColor() { | |
return lightCar.getColor(); | |
} | |
@Override | |
public long getFrameNumber() { | |
return frameNumber; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment