|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.wc.SVNRevision
public class SVNRevision
SVNRevision is a revision wrapper used for an abstract representation of revision information.
Most of high-level API classes' methods receive revision parameters as SVNRevision objects to get information on SVN revisions and use it in version control operations.
This class provides advantages of specifying revisions either as just long numbers or dated revisions (when a revision is determined according to a particular timestamp) or SVN compatible keywords denoting the latest revision (HEAD), Working Copy pristine revision (BASE) and so on. And one more feature is that SVNRevision can parse strings (that can be anything: string representations of numbers, dates, keywords) to construct an SVNRevision to use.
Field Summary | |
---|---|
static SVNRevision |
BASE
Denotes the 'pristine' revision of a Working Copy item. |
static SVNRevision |
COMMITTED
Denotes the last revision in which an item was changed before (or at) BASE. |
static SVNRevision |
HEAD
Denotes the latest repository revision. |
static SVNRevision |
PREVIOUS
Denotes the revision just before the one when an item was last changed (technically, COMMITTED - 1). |
static SVNRevision |
UNDEFINED
Used to denote that a revision is undefined (not available or not valid). |
static SVNRevision |
WORKING
Denotes an item's working (current) revision. |
Method Summary | |
---|---|
static SVNRevision |
create(java.util.Date date)
Creates an SVNRevision object given a particular timestamp. |
static SVNRevision |
create(long revisionNumber)
Creates an SVNRevision object given a revision number. |
boolean |
equals(java.lang.Object o)
Compares this object with another SVNRevision object. |
java.util.Date |
getDate()
Gets the timestamp used to specify a revision. |
int |
getID()
Gets the identifier of the revision information kind this object represents. |
java.lang.String |
getName()
Gets the revision keyword name. |
long |
getNumber()
Gets the revision number represented by this object. |
int |
hashCode()
Evaluates the hash code for this object. |
boolean |
isLocal()
Determines if the revision represented by this abstract object is Working Copy specific - that is one of BASE or WORKING . |
boolean |
isValid()
Checks if the revision information represented by this object is valid. |
static boolean |
isValidRevisionNumber(long revision)
Checks whether a revision number is valid. |
static SVNRevision |
parse(java.lang.String value)
Parses an input string and be it a representation of either a revision number, or a timestamp, or a revision keyword, constructs an SVNRevision representation of the revision. |
java.lang.String |
toString()
Gives a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SVNRevision HEAD
public static final SVNRevision WORKING
public static final SVNRevision PREVIOUS
public static final SVNRevision BASE
public static final SVNRevision COMMITTED
public static final SVNRevision UNDEFINED
Method Detail |
---|
public java.lang.String getName()
public long getNumber()
public java.util.Date getDate()
public boolean isValid()
UNDEFINED
is not a valid revision.
public int getID()
public int hashCode()
hash code = (int) revisionNumber & 0xFFFFFFFF
;
Date.hashCode()
is used;
String.hashCode()
is used for the keyword name;
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- an object to be compared with; if it's not an
SVNRevision then this method certainly returns
false
public static boolean isValidRevisionNumber(long revision)
revision
- a revision number
>=0
),
otherwise falsepublic static SVNRevision create(long revisionNumber)
revisionNumber
- a definite revision number
public static SVNRevision create(java.util.Date date)
date
- a timestamp represented as a Date instance
public boolean isLocal()
BASE
or WORKING
.
public static SVNRevision parse(java.lang.String value)
value
- a string to be parsed
value
; however
if an input string is not a valid one which can be
successfully transformed to an SVNRevision the
return value is UNDEFINED
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |