package rebelsky.linear; /** * A stub implementation of linear structures. * * @author Samuel A. Rebelsky * @version 1.0 of October 2004. */ public class StubLinear implements Linear { // +--------+-------------------------------------------------- // | Fields | // +--------+ int size; // +--------------+-------------------------------------------- // | Constructors | // +--------------+ public StubLinear() { this.size = 0; } // +---------+------------------------------------------------- // | Methods | // +---------+ // public void put(Object addMe) { ++this.size; } // put(Object) public Object get() { --this.size; return "STUB"; } // get() public Object peek() { return "STUB"; } // peek() public boolean isEmpty() { return this.size == 0; } // isEmpty() } // StubLinear()