final class Record extends java.lang.Object
equals
or hashCode
.
Class Type: Mutable Data Class
Modifier and Type | Field and Description |
---|---|
(package private) int |
numOut
The number of copies of the video that are currently checked out.
|
(package private) int |
numOwned
The number of copies of the video that are in the inventory.
|
(package private) int |
numRentals
The total number of times this video has ever been checked out.
|
(package private) VideoObj |
video
The video.
|
Constructor and Description |
---|
Record(VideoObj video,
int numOwned,
int numOut,
int numRentals)
Initialize all object attributes.
|
Modifier and Type | Method and Description |
---|---|
Record |
copy()
Return a shallow copy of this record.
|
java.lang.String |
toString()
Return a string representation of the object in the following format:
"video [numOwned,numOut,numRentals]" . |
int numOwned
Invariant: numOwned > 0
int numOut
Invariant: numOut <= numOwned
int numRentals
Invariant: numRentals >= numOut