|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.UCL.xmiddle.tree.PrimaryIDVersion
PrimaryIDVersion.java Stores a version identified by the primary ID of the localhost, the primary ID of the remote host, and the version number. Editions are also represented by this class. Created: Tue Aug 7 13:19:37 2001
| Constructor Summary | |
PrimaryIDVersion(java.lang.String primaryID1,
java.lang.String primaryID2,
int number,
boolean isEdition)
Creates a new PrimaryIDVersion instance. |
|
PrimaryIDVersion(java.lang.String primaryID1,
java.lang.String primaryID2,
java.lang.String version)
Creates a new PrimaryIDVersion instance,
using a version string. |
|
| Method Summary | |
short |
compare(Version other)
Compares this version with other |
java.lang.Object[] |
getIDs()
Gets the two ids involved in this version |
int |
getNumber()
Returns the version number |
Version |
inc()
|
Version |
inc(java.lang.Object remoteID)
Return a new version with the version number increased by one. |
Version |
inc(java.lang.Object primaryID1,
java.lang.Object primaryID2)
Return a new version with the version number increased by one. |
boolean |
isEdition()
Returns true if this version is also an edition |
void |
setEdition(boolean edition)
Sets whether this version is also an edition or not |
Version |
toEdition()
Returns a new version of this Version's details, but with the isEdition flag set to true. |
java.lang.String |
toString()
Returns a String representation of this version |
Version |
toVersion()
Returns a new version of this Edition's details, but with the isEdition flag set to false. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PrimaryIDVersion(java.lang.String primaryID1,
java.lang.String primaryID2,
int number,
boolean isEdition)
PrimaryIDVersion instance.
primaryID1 - The id of the first host involved in
generating this versionprimaryID2 - the id of the second host involved in
generating this versionnumber - the version numberisEdition - If true then this version is an edition
public PrimaryIDVersion(java.lang.String primaryID1,
java.lang.String primaryID2,
java.lang.String version)
throws java.lang.NumberFormatException
PrimaryIDVersion instance,
using a version string.
primaryID1 - The id of the first host involved in
generating this versionprimaryID2 - the id of the second host involved in
generating this version (or $)version - String holding a version. If this is a version,
then the string will end in 'v'.
java.lang.NumberFormatException - if the number contained in 'version'
is invalid.| Method Detail |
public short compare(Version other)
other
compare in interface Versionother - another version with which this version is to be compared
public int getNumber()
getNumber in interface Versionint valuepublic java.lang.Object[] getIDs()
getIDs in interface Versionpublic Version inc(java.lang.Object remoteID)
primaryID1 and remoteID
inc in interface VersionremoteID - The id of the remote host with which the new
version was generated
Version
public Version inc(java.lang.Object primaryID1,
java.lang.Object primaryID2)
primaryID1 and primaryID2
inc in interface VersionprimaryID1 - the ID of the first host which generated the
new versionprimaryID2 - the ID of the second host which generated the
new version
Versionpublic void setEdition(boolean edition)
setEdition in interface Versionedition - if TRUE then this version is an editionpublic Version inc()
inc in interface Versionpublic java.lang.String toString()
toString in interface VersiontoString in class java.lang.Objectpublic boolean isEdition()
isEdition in interface Versionboolean valuepublic Version toEdition()
toEdition in interface Versionpublic Version toVersion()
toVersion in interface Version
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||