net.ultrametrics.rcs
Class RevisionMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.TreeMap
              |
              +--net.ultrametrics.rcs.RevisionMap

public class RevisionMap
extends java.util.TreeMap

A Map of objects which are Versioned.

See Also:
Serialized Form

Field Summary
static java.lang.String _rcsId
           
 
Constructor Summary
RevisionMap()
           
 
Method Summary
 Versioned get(java.lang.String version)
          Retrieve a versioned object from the map.
static java.lang.String getVersionComparable(java.lang.String version)
          Convert an RCS version number into one which can be compared using String's compareTo().
 void put(Versioned object)
          Store a versioned object in the map.
static int versionCompareTo(java.lang.String a, java.lang.String b)
          Compare two RCS version numbers.
 
Methods inherited from class java.util.TreeMap
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, put, putAll, remove, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_rcsId

public static final java.lang.String _rcsId
Constructor Detail

RevisionMap

public RevisionMap()
Method Detail

put

public void put(Versioned object)
Store a versioned object in the map. Requires no key because the object's internal version is used.
Parameters:
object - the object to store in the map.

get

public Versioned get(java.lang.String version)
Retrieve a versioned object from the map.
Parameters:
version - the version number of the object to retrieve.

getVersionComparable

public static java.lang.String getVersionComparable(java.lang.String version)
Convert an RCS version number into one which can be compared using String's compareTo().

i.e. 1.2.45 -> 00001.00002.00045

Parameters:
version - the RCS version number.
Returns:
a string containing a version number which is comparable.

versionCompareTo

public static int versionCompareTo(java.lang.String a,
                                   java.lang.String b)
Compare two RCS version numbers.