/** * Main program. * * @param array $args Command-line arguments. * @return integer Zero on succes; non-zero on failure. */ public static function main($args) { printf("Demonstration program number 2.\n"); $status = 0; StackAsArray::main($args); StackAsLinkedList::main($args); QueueAsArray::main($args); QueueAsLinkedList::main($args); DequeAsArray::main($args); DequeAsLinkedList::main($args); return $status; }
* This object and the given object are instances of the same class. * * @param object IComparable $obj The given object. * @return integer A number less than zero * if this object is less than the given object, * zero if this object equals the given object, and * a number greater than zero * if this object is greater than the given object. */ public function compareTo(IComparable $obj) { throw new MethodNotImplementedException(); } /** * Main program. * * @param array $args Command-line arguments. * @return integer Zero on success; non-zero on failure. */ public static function main($args) { printf("StackAsArray main program.\n"); $status = 0; $stack = new StackAsArray(5); AbstractStack::test($stack); return $status; } } if (realpath($argv[0]) == realpath(__FILE__)) { exit(StackAsArray::main(array_slice($argv, 1))); }