T
- the type of object to store the revision numbers withpublic class Revisions<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<T> |
objects |
private java.util.List<java.lang.Integer> |
revisionNumbers |
Constructor and Description |
---|
Revisions()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(T object,
int revisionNumber)
Adds an object with a specified revision number.
|
T |
getObject(int index)
Returns the object at the specified position.
|
private java.util.List<T> |
getObjects() |
int |
getRevisionNumber(int index)
Returns the revision number at the specified position.
|
private java.util.List<java.lang.Integer> |
getRevisionNumbers() |
protected void |
setRevisionNumber(T object,
int revisionNumber)
Sets the revision number of a specified object.
|
int |
size()
Returns the size.
|
java.lang.String |
toString() |
private java.util.List<T> objects
private java.util.List<java.lang.Integer> revisionNumbers
private java.util.List<T> getObjects()
private java.util.List<java.lang.Integer> getRevisionNumbers()
public T getObject(int index)
index
- the positionjava.lang.IndexOutOfBoundsException
- if the index is out of rangepublic int getRevisionNumber(int index)
index
- the positionjava.lang.IndexOutOfBoundsException
- if the index is out of rangepublic void addObject(T object, int revisionNumber)
object
- the objectrevisionNumber
- the revision numberprotected void setRevisionNumber(T object, int revisionNumber)
object
- the objectrevisionNumber
- the revision numberpublic int size()
public java.lang.String toString()
toString
in class java.lang.Object