// Flier.pj personality Flier { // upstream interface. Must implement here. public void Fly(int x, int y, int altitude) { resetMetersFlown(); Takeoff(); for (int a=0; a < altitude; a++) Ascend(); while( !ThereYet(x, y) ) FlapTowards(x, y); for(int a = altitude; a > 0; a--) Descend(); Land(); } // downstream interface. Don't impl here. di void Takeoff(); di void Ascend(); di boolean ThereYet(int x, int y); di void FlapTowards(int x, int y); di void Descend(); di void Land(); // private functions. Must implement here. private void resetMetersFlown() { meters_flown = 0; } // attributes (specific to the role) private float meters_flown; // constructor (optional) Flier() { resetMetersFlown(); } }