juergen 01/02/15 04:16:28
Modified: src/share/org/apache/slide/content
NodeRevisionDescriptors.java
Log:
added method enumerateBranchNames and made method enumerateRevisionNumbers public.
Needed for nonJava serialisation purpose.
Revision Changes Path
1.5 +39 -27
jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java
Index: NodeRevisionDescriptors.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NodeRevisionDescriptors.java 2000/12/03 07:19:29 1.4
+++ NodeRevisionDescriptors.java 2001/02/15 12:16:25 1.5
@@ -1,13 +1,13 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java,v
1.4 2000/12/03 07:19:29 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2000/12/03 07:19:29 $
+ * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java,v
1.5 2001/02/15 12:16:25 juergen Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/02/15 12:16:25 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.slide.content;
@@ -73,9 +73,9 @@
/**
* Node Revision Descriptors class.
- *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public final class NodeRevisionDescriptors implements Serializable, Cloneable {
@@ -86,7 +86,7 @@
public static final String MAIN_BRANCH = "main";
- protected static final NodeRevisionNumber initialRevision
+ protected static final NodeRevisionNumber initialRevision
= new NodeRevisionNumber();
@@ -118,10 +118,10 @@
/**
* Store Constructor.
*/
- public NodeRevisionDescriptors(String uri,
- NodeRevisionNumber initialRevision,
- Hashtable workingRevisions,
- Hashtable latestRevisionNumbers,
+ public NodeRevisionDescriptors(String uri,
+ NodeRevisionNumber initialRevision,
+ Hashtable workingRevisions,
+ Hashtable latestRevisionNumbers,
Hashtable branches, boolean isVersioned) {
this.uri = uri;
this.latestRevisionNumbers = latestRevisionNumbers;
@@ -275,7 +275,7 @@
/**
* Add relation.
*/
- void setSuccessors(NodeRevisionNumber number,
+ void setSuccessors(NodeRevisionNumber number,
NodeRevisionNumber successor) {
Vector tempVector = new Vector();
tempVector.addElement(successor);
@@ -294,7 +294,7 @@
/**
* Add relation.
*/
- void addSuccessor(NodeRevisionNumber number,
+ void addSuccessor(NodeRevisionNumber number,
NodeRevisionNumber successor) {
Object result = this.branches.get(number);
if (result != null) {
@@ -308,7 +308,7 @@
/**
* Remove relation.
*/
- void removeSuccessor(NodeRevisionNumber number,
+ void removeSuccessor(NodeRevisionNumber number,
NodeRevisionNumber successor) {
Object result = this.branches.get(number);
if (result != null) {
@@ -320,17 +320,28 @@
/**
* Enumerate all revision numbers in all branches.
*/
- Enumeration enumerateRevisionNumbers() {
+ public Enumeration enumerateRevisionNumbers() {
return this.branches.keys();
}
+
+ /**
+ * Enumerate all branch names.
+ */
+ public Enumeration enumerateBranchNames() {
+ return this.latestRevisionNumbers.keys();
+ }
+
+
+
+
// --------------------------------------------------------- Object Methods
/**
* Clone.
- *
+ *
* @return Object clone
*/
public NodeRevisionDescriptors cloneObject() {
@@ -348,7 +359,7 @@
}
result.branches = branchesClone;
// Cloning latest revision list
- result.latestRevisionNumbers =
+ result.latestRevisionNumbers =
(Hashtable) this.latestRevisionNumbers.clone();
} catch(CloneNotSupportedException e) {
e.printStackTrace();
@@ -359,7 +370,7 @@
/**
* Equals.
- *
+ *
* @param obj Object to test
* @return boolean True if the two object are equal :
* <li>obj is of type NodeRevisionDescriptors and is not null</li>
@@ -368,7 +379,7 @@
public boolean equals(Object obj) {
boolean result = false;
if ((obj != null) && (obj instanceof NodeRevisionDescriptors)) {
- NodeRevisionDescriptors revisionDescriptors =
+ NodeRevisionDescriptors revisionDescriptors =
(NodeRevisionDescriptors) obj;
result = this.getUri().equals(revisionDescriptors.getUri());
}
@@ -394,19 +405,19 @@
if (workingRevisions == null)
throw new ObjectValidationFailedException
(uri, Messages.message
- (NodeRevisionDescriptors.class.getName()
+ (NodeRevisionDescriptors.class.getName()
+ ".nullWorkingRevisions"));
if (latestRevisionNumbers == null)
throw new ObjectValidationFailedException
(uri, Messages.message
- (NodeRevisionDescriptors.class.getName()
+ (NodeRevisionDescriptors.class.getName()
+ ".nullLatestRevisionNumbers"));
if (branches == null)
throw new ObjectValidationFailedException
(uri, Messages.message
- (NodeRevisionDescriptors.class.getName()
+ (NodeRevisionDescriptors.class.getName()
+ ".nullBranches"));
// FIXME : Check branches integrity. Problem : It's quite expensive.
@@ -415,3 +426,4 @@
}
+