private static final class InventorySet.RecordObj extends java.lang.Object implements Record
This is a utility class for Inventory. Fields are immutable and package-private.
Class Invariant: No two instances may reference the same Video.
Record| Modifier and Type | Field and Description | 
|---|---|
| (package private) int | numOut | 
| (package private) int | numOwned | 
| (package private) int | numRentals | 
| (package private) Video | video | 
| Constructor and Description | 
|---|
| RecordObj(Video video,
         int numOwned,
         int numOut,
         int numRentals) | 
| Modifier and Type | Method and Description | 
|---|---|
| int | numOut()Returns the number of copies of the video that are currently checked out. | 
| int | numOwned()Returns the number of copies of the video that are in the inventory. | 
| int | numRentals()Returns the total number of times this video has ever been checked out. | 
| java.lang.String | toString()Return a string representation of the object in the following format:
  "video [numOwned,numOut,numRentals]". | 
| Video | video()Returns the video. | 
final int numOwned
final int numOut
final int numRentals
public Video video()
RecordInvariant: video() != null.
public int numOwned()
RecordInvariant: numOwned() > 0.
public int numOut()
RecordInvariant: numOut() <= numOwned().
public int numRentals()
RecordInvariant: numRentals() >= numOut().
numRentals in interface Record