net.ultrametrics.rcs
Class History

java.lang.Object
  |
  +--net.ultrametrics.rcs.History

public class History
extends java.lang.Object

Encapsulation of history for an RCS controlled object. Includes all log entries and modifications associated with the history of of the life of an RCS object.


Field Summary
static java.lang.String _rcsId
           
protected  java.io.BufferedReader reader
           
 
Constructor Summary
History(java.io.BufferedReader reader)
          Create a new history.
 
Method Summary
 void dump()
          Similar to toString(), but more verbose and dumps directly to stderr.
 boolean dump(java.lang.String version)
           
 Revision get(java.lang.String version)
          Retrieve a specific revision by version number.
 Revision getFirstRevision()
          Retrieve the first (initial) revision for this RCS object.
 java.util.Set keySet()
          Retrieve an set of the keys (version numbers) which can be used to retrieve revisions.
 boolean parse()
          Parse a history block.
protected static java.lang.String parseDescriptionBlock(java.io.BufferedReader br)
          All RCS files have a description block.
 java.lang.String toString()
           
 java.util.Collection values()
          Retrieve the collection of all revisions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reader

protected java.io.BufferedReader reader

_rcsId

public static final java.lang.String _rcsId
Constructor Detail

History

public History(java.io.BufferedReader reader)
Create a new history.
Parameters:
reader - the buffered reader from which the history will be subsequently parsed.
Method Detail

getFirstRevision

public Revision getFirstRevision()
Retrieve the first (initial) revision for this RCS object.

usually '1.1'

Returns:
the first revision in this object's history.

get

public Revision get(java.lang.String version)
Retrieve a specific revision by version number.
Parameters:
version - the RCS version number.
Returns:
the revision associated with the specified version.

keySet

public java.util.Set keySet()
Retrieve an set of the keys (version numbers) which can be used to retrieve revisions.

note: the lookup keys return have been internally expanded so they are unique and sortable. They won't match the simple keys used on get() methods. This isn't an issue here because access to the map of revisions is expected to be read-only. private buildRevisions() is only writer and is internal.

Returns:
the set of keys.

values

public java.util.Collection values()
Retrieve the collection of all revisions.
Returns:
the collection of revisions.

parse

public boolean parse()
              throws ParserException
Parse a history block.

Returns:
whether this is the last history block in the reader. It should always be since RCS files have only one history.
See Also:
ControlInformation.parse()

parseDescriptionBlock

protected static java.lang.String parseDescriptionBlock(java.io.BufferedReader br)
                                                 throws ParserException
All RCS files have a description block. It isn't usually populated.
Parameters:
br - the buffered reader, prepositioned at the description block.
Returns:
the text of the description.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

dump

public void dump()
Similar to toString(), but more verbose and dumps directly to stderr.

dump

public boolean dump(java.lang.String version)
Parameters:
the - RCS version of the history block to dump.
See Also:
dump()