/** an DeptDirectory is either: * (i) the empty directory new Empty(), or * (ii) the non-empty directory new Cons(Entry,DeptDirectory) */ abstract class DeptDirectory {} class Empty extends DeptDirectory {} class Cons extends DeptDirectory { Entry first; DeptDirectory rest; /* constructor */ Cons(Entry f, DeptDirectory r) { this.first = f; this.rest = r; } /* accessors */ Entry getFirst() { return this.first; } DeptDirectory getRest() { return this.rest; } }