Update of /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/util/note
In directory sc8-pr-cvs1:/tmp/cvs-serv18085/src/java/org/krysalis/version/util/note
Modified Files:
AnnotationScratchpad.java
Log Message:
1) Refactored some shared behaviours
2) Worked on constraints colelcting/evaluating/result sets...
Index: AnnotationScratchpad.java
===================================================================
RCS file: /cvsroot/metamorphosis/krysalis-version/src/java/org/krysalis/version/util/note/AnnotationScratchpad.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AnnotationScratchpad.java 7 Feb 2003 20:11:48 -0000 1.3
--- AnnotationScratchpad.java 5 Mar 2003 19:58:05 -0000 1.4
***************
*** 56,60 ****
package org.krysalis.version.util.note;
- import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
--- 56,59 ----
***************
*** 62,71 ****
import java.util.Iterator;
/**
* @author [email protected]
*/
! public class AnnotationScratchpad {
!
! private ArrayList m_list = null;
/**
--- 61,74 ----
import java.util.Iterator;
+ import org.krysalis.version.util.collection.EntityList;
+ import org.krysalis.version.util.debug.DebugUtils;
+ import org.krysalis.version.util.debug.Dumpable;
+
/**
* @author [email protected]
*/
! public class AnnotationScratchpad implements Dumpable {
!
! private EntityList m_list = null;
/**
***************
*** 75,80 ****
public AnnotationScratchpad(AnnotationScratchpad otherPad) {
super();
!
! m_list = new ArrayList(otherPad.m_list);
}
--- 78,83 ----
public AnnotationScratchpad(AnnotationScratchpad otherPad) {
super();
!
! m_list = new EntityList(otherPad.m_list);
}
***************
*** 85,90 ****
public AnnotationScratchpad() {
super();
!
! m_list = new ArrayList();
}
--- 88,93 ----
public AnnotationScratchpad() {
super();
!
! m_list = new EntityList();
}
***************
*** 95,100 ****
public AnnotationScratchpad(Collection c) {
super();
!
! m_list = new ArrayList(c);
}
--- 98,103 ----
public AnnotationScratchpad(Collection c) {
super();
!
! m_list = new EntityList(c);
}
***************
*** 129,178 ****
}
! public Iterator iterator() { return m_list.iterator(); }
!
! public Iterator errorIterator()
! {
! return new AnnotationIterator(this,Annotation.ERROR);
}
! public Iterator infoIterator()
! {
! return new AnnotationIterator(this,Annotation.INFORMATION);
}
! public Iterator verboseIterator()
! {
! return new AnnotationIterator(this,Annotation.VERBOSE);
! }
!
! public Iterator debugIterator()
! {
! return new AnnotationIterator(this,Annotation.DEBUG);
}
! public boolean hasAnnotations() {
! return !m_list.isEmpty();
}
! public void dump(PrintStream out) {
! dump(out, 0);
}
! public void dump(PrintStream out, int depth) {
! dump(new PrintWriter(out, true), depth);
}
! public void dump(PrintWriter out) {
! dump(out, 0);
}
public void dump(PrintWriter out, int depth) {
out.println("Annotation Scratchpad");
if (hasAnnotations()) {
out.println("(");
for (Iterator i = m_list.iterator(); i.hasNext();) {
Object entry = (Object) i.next();
! out.println("\t" + entry.toString());
}
out.println(")");
}
--- 132,179 ----
}
! public void addPad(AnnotationScratchpad pad) {
! m_list.addAll(pad.m_list);
}
! public Iterator iterator() {
! return m_list.iterator();
}
! public Iterator errorIterator() {
! return new AnnotationIterator(this, Annotation.ERROR);
}
! public Iterator infoIterator() {
! return new AnnotationIterator(this, Annotation.INFORMATION);
}
! public Iterator verboseIterator() {
! return new AnnotationIterator(this, Annotation.VERBOSE);
}
! public Iterator debugIterator() {
! return new AnnotationIterator(this, Annotation.DEBUG);
}
! public boolean hasAnnotations() {
! return !m_list.isEmpty();
}
public void dump(PrintWriter out, int depth) {
+
+ final String indent = DebugUtils.getIndent(depth);
+ final String indent1 = DebugUtils.getIndent(depth);
+
+ out.print(indent);
out.println("Annotation Scratchpad");
if (hasAnnotations()) {
+ out.print(indent);
out.println("(");
for (Iterator i = m_list.iterator(); i.hasNext();) {
Object entry = (Object) i.next();
! out.print(indent1);
! out.println(entry.toString());
}
+ out.print(indent);
out.println(")");
}
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.