public interface Record
Public view of an inventory record.
Records are mutable, but cannot be changed outside the package.
This interface should not be implemented outside the package.
equals and hashCode delegate to the
underlying Video object.
Data| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object thatObject)
Delegates to video.
|
int |
hashCode()
Delegates to video.
|
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.
|
int numOwned()
Invariant: numOwned() > 0.
int numOut()
Invariant: numOut() <= numOwned().
int numRentals()
Invariant: numRentals() >= numOut().
boolean equals(java.lang.Object thatObject)
equals in class java.lang.Objectint hashCode()
hashCode in class java.lang.Objectjava.lang.String toString()
"video [numOwned,numOut,numRentals]".toString in class java.lang.Object