Algorithms and Data Structures in an Object-Oriented Framework (“ADSOOF”)
Code for “Implementing Objects” section
DrinksMachine
object, and how the methods that may be called on it work.
Can
object, and how the methods that may be called on it work.
Can.java
as code in
this class uses it, but no direct reference is made to it in this section.
DrinksMachine.java
which throws
an EmptyMachineException
exception rather than
return null
when a drink cannot be given.
DrinksMachine.java
which throws
a NotEnoughMoneyException
exception when a drink cannot be given
because not enough money has been inserted, and throws an
EmptyMachineException
exception when a drink cannot be given because
the machine has run out of that drink.
DrinksMachineB
object, and also the exception type thrown by
a DrinksMachineA
object..
DrinksMachineB
object.
set
and get
methods replacing the array notation.
set
and
get
methods, but also add
methods which change
its size. Implemented with an array which is replaced when the size
changes.
MyArrayList2.java
, but also has methods to
remove items and to find the position of items.
MyArrayList3.java
, but the data structure
which implements them is an array-and-count, not an array.
MyArrayList1
objects.
MyArrayList2
object.
MyArrayList3
object.
MyArrayList4
object,
and which appears to behave exactly the same as UseMyArrayLists3.java
.
Dictionary
class.
Dictionary
class with random generation of entries and a simple user interface to manipulate it.
Last modified: 16 July 2019