public interface Inventory extends java.lang.Iterable<Record>
Data
Modifier and Type | Method and Description |
---|---|
Record |
get(Video v)
Return the record for a given Video; if not present, return
null . |
java.util.Iterator<Record> |
iterator()
Return an iterator over Records in the Inventory.
|
java.util.Iterator<Record> |
iterator(java.util.Comparator<Record> comparator)
Return an iterator over the Inventory, sorted accoring the
Comparator.
|
int |
size()
Return the number of Records.
|
java.lang.String |
toString()
Returns the inventory as a string; one record per line.
|
int size()
java.util.Iterator<Record> iterator()
The iterator returns objects that implement the Record interface.
Any attempt to remove objects using the iterator should
result in an UnsupportedOperationException
.
The Record order is unspecified
iterator
in interface java.lang.Iterable<Record>
java.util.Iterator<Record> iterator(java.util.Comparator<Record> comparator)
The iterator returns objects that implement the
Record
interface.
Any attempt to remove objects using the iterator should
result in an UnsupportedOperationException
.
The iteration order is determined by the comparator (least first).
The comparator may assume that its arguments implement
Record
.
comparator
- determines the order of the records returned.java.lang.String toString()
toString
in class java.lang.Object