Java Reference
In-Depth Information
*
* @throws IOException Thrown if an <code>IOException</code> is
* encountered in the <code>db</code> class.
* <br>
* For more information, see {@link DVDDatabase}.
* @throws InterruptedIOException Thrown if an
* <code>interrupted Threading exception</code> is
* encountered in the <code>db</code> class.
* <br>
* For more information, see {@link DVDDatabase}.
*/
public boolean rent(String upc) throws IOException {
DVD dvd = new DVD();
dvd.setUPC(upc);
DvdCommand cmdObj = new DvdCommand(SocketCommand.RENT, dvd);
return getResultFor(cmdObj).getBoolean();
}
/**
* Attempts to return the DVD matching the provided UPC.
*
* @param upc The UPC of the DVD you want to rent.
* @return true if the DVD was rented. false if it cannot be rented.
*
* @throws IOException Thrown if an <code>IOException</code> is
* encountered in the <code>db</code> class.
* <br>
* For more information, see {@link DVDDatabase}.
* <br>
* For more information, see {@link DVDDatabase}.
*/
public boolean returnRental(String upc) throws IOException {
DVD dvd = new DVD();
dvd.setUPC(upc);
DvdCommand cmdObj = new DvdCommand(SocketCommand.RETURN, dvd);
return getResultFor(cmdObj).getBoolean();
}
/**
* Gets the store's inventory.
* All of the DVDs in the system.
*
* @return A collection of all found DVD's.
* @throws IOException Indicates there is a problem accessing the data.
*/
Search WWH ::




Custom Search