/*人の状態を表すクラス*/
final class ManState {
public final static ManState WORK = new ManState();
public final static ManState REST = new ManState();
public final static ManState READY = new ManState();
private ManState() {}
}
/*人を表すクラス*/
class Man {
/*人の状態を変える*/
public void setHisState(ManState state) {
...
}
}
|