[jsword-svn] jsword/java/jsword/org/crosswire/jsword/passage s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Fri Apr 1 10:09:48 MST 2005
Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage
In directory www.crosswire.org:/tmp/cvs-serv5088/java/jsword/org/crosswire/jsword/passage
Modified Files:
PassageTally.java DefaultLeafKeyList.java Passage.java
SynchronizedPassage.java AbstractKeyList.java
AbstractPassage.java Verse.java RangedPassage.java
ReadOnlyKeyList.java Key.java VerseRange.java
Log Message:
Improved ranking, bible display and fixed a few bugs.
Index: SynchronizedPassage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/SynchronizedPassage.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** SynchronizedPassage.java 6 Mar 2005 20:21:47 -0000 1.14
--- SynchronizedPassage.java 1 Apr 2005 17:09:46 -0000 1.15
***************
*** 328,332 ****
public synchronized Object clone()
{
! return ref.clone();
}
--- 328,342 ----
public synchronized Object clone()
{
! SynchronizedPassage clone = null;
! try
! {
! clone = (SynchronizedPassage) super.clone();
! }
! catch (CloneNotSupportedException e)
! {
! assert false : e;
! }
! clone.ref = (Passage) ref.clone();
! return clone;
}
Index: AbstractPassage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/AbstractPassage.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** AbstractPassage.java 19 Mar 2005 18:44:58 -0000 1.37
--- AbstractPassage.java 1 Apr 2005 17:09:46 -0000 1.38
***************
*** 448,456 ****
raiseNormalizeProtection();
- Passage remainder = null;
int i = 0;
boolean overflow = false;
! remainder = (Passage) this.clone();
Iterator it = iterator();
--- 448,455 ----
raiseNormalizeProtection();
int i = 0;
boolean overflow = false;
! Passage remainder = (Passage) this.clone();
Iterator it = iterator();
***************
*** 492,500 ****
raiseNormalizeProtection();
- Passage remainder = null;
int i = 0;
boolean overflow = false;
! remainder = (Passage) this.clone();
Iterator it = rangeIterator(restrict);
--- 491,498 ----
raiseNormalizeProtection();
int i = 0;
boolean overflow = false;
! Passage remainder = (Passage) this.clone();
Iterator it = rangeIterator(restrict);
Index: RangedPassage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/RangedPassage.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** RangedPassage.java 19 Mar 2005 18:44:58 -0000 1.19
--- RangedPassage.java 1 Apr 2005 17:09:46 -0000 1.20
***************
*** 472,476 ****
// So we know what is broadly next, however the range might need
// splitting according to restrict
! if (restrict.isSameScope(next.start, next.end))
{
return replyNext();
--- 472,476 ----
// So we know what is broadly next, however the range might need
// splitting according to restrict
! if (restrict.isSameScope(next.getStart(), next.getEnd()))
{
return replyNext();
Index: Verse.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/Verse.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Verse.java 8 Sep 2004 19:55:07 -0000 1.33
--- Verse.java 1 Apr 2005 17:09:46 -0000 1.34
***************
*** 272,280 ****
* If this is not cloneable then writing cloneable children is harder
* @return A complete copy of ourselves
- * @exception CloneNotSupportedException We don't do this but our kids might
*/
! public Object clone() throws CloneNotSupportedException
{
! Verse copy = (Verse) super.clone();
copy.book = book;
--- 272,287 ----
* If this is not cloneable then writing cloneable children is harder
* @return A complete copy of ourselves
*/
! public Object clone()
{
! Verse copy = null;
! try
! {
! copy = (Verse) super.clone();
! }
! catch (CloneNotSupportedException e)
! {
! assert false : e;
! }
copy.book = book;
Index: ReadOnlyKeyList.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/ReadOnlyKeyList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ReadOnlyKeyList.java 25 Aug 2004 22:54:37 -0000 1.5
--- ReadOnlyKeyList.java 1 Apr 2005 17:09:46 -0000 1.6
***************
*** 191,194 ****
--- 191,212 ----
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#clone()
+ */
+ public Object clone()
+ {
+ ReadOnlyKeyList clone = null;
+ try
+ {
+ clone = (ReadOnlyKeyList) super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ assert false : e;
+ }
+ clone.keys = (Key) keys.clone();
+ return clone;
+ }
+
/**
* Do we ignore write requests or throw?
Index: DefaultLeafKeyList.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/DefaultLeafKeyList.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultLeafKeyList.java 25 Aug 2004 22:54:37 -0000 1.3
--- DefaultLeafKeyList.java 1 Apr 2005 17:09:46 -0000 1.4
***************
*** 200,203 ****
--- 200,224 ----
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#clone()
+ */
+ public Object clone()
+ {
+ DefaultLeafKeyList clone = null;
+ try
+ {
+ clone = (DefaultLeafKeyList) super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ assert false : e;
+ }
+ if (parent != null)
+ {
+ clone.parent = (Key) this.parent.clone();
+ }
+ return clone;
+ }
+
/**
* The parent of this key
Index: Key.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/Key.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Key.java 25 Aug 2004 22:54:37 -0000 1.4
--- Key.java 1 Apr 2005 17:09:46 -0000 1.5
***************
*** 31,35 ****
* @version $Id$
*/
! public interface Key extends Comparable
{
/**
--- 31,35 ----
* @version $Id$
*/
! public interface Key extends Comparable, Cloneable
{
/**
***************
*** 136,138 ****
--- 136,145 ----
*/
public void blur(int by, RestrictionType restrict);
+
+ /**
+ * This needs to be declared here so that it is visible as a method
+ * on a derived Key.
+ * @return A complete copy of ourselves
+ */
+ public Object clone();
}
Index: AbstractKeyList.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/AbstractKeyList.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** AbstractKeyList.java 25 Aug 2004 22:54:37 -0000 1.6
--- AbstractKeyList.java 1 Apr 2005 17:09:46 -0000 1.7
***************
*** 203,206 ****
--- 203,223 ----
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#clone()
+ */
+ public Object clone()
+ {
+ Object clone = null;
+ try
+ {
+ clone = super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ assert false : e;
+ }
+ return clone;
+ }
+
/**
* The common user visible name for this work
Index: PassageTally.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/PassageTally.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** PassageTally.java 19 Mar 2005 18:44:58 -0000 1.32
--- PassageTally.java 1 Apr 2005 17:09:46 -0000 1.33
***************
*** 568,576 ****
optimizeWrites();
- Passage remainder = null;
int i = 0;
boolean overflow = false;
! remainder = (Passage) this.clone();
Iterator it = iterator();
--- 568,575 ----
optimizeWrites();
int i = 0;
boolean overflow = false;
! Passage remainder = (Passage) this.clone();
Iterator it = iterator();
Index: Passage.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/Passage.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Passage.java 25 Aug 2004 22:54:37 -0000 1.14
--- Passage.java 1 Apr 2005 17:09:46 -0000 1.15
***************
*** 68,72 ****
* @version $Id$
*/
! public interface Passage extends Key, Serializable, Cloneable
{
/**
--- 68,72 ----
* @version $Id$
*/
! public interface Passage extends Key, Serializable
{
/**
***************
*** 238,249 ****
*/
public void removePassageListener(PassageListener li);
-
- /**
- * This needs to be declared here so that it is visible as a method
- * on a derived Passage.
- * Specifically, in SynchronizedPassage, ref.clone() where ref is only
- * known as a Passage has to have clone visible in this interface.
- * @return A complete copy of ourselves
- */
- public Object clone();
}
--- 238,240 ----
Index: VerseRange.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/passage/VerseRange.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** VerseRange.java 19 Mar 2005 18:44:58 -0000 1.37
--- VerseRange.java 1 Apr 2005 17:09:46 -0000 1.38
***************
*** 414,421 ****
* @see java.lang.Object#clone()
*/
! public Object clone() throws CloneNotSupportedException
{
// This gets us a shallow copy
! VerseRange copy = (VerseRange) super.clone();
copy.start = (Verse) start.clone();
--- 414,429 ----
* @see java.lang.Object#clone()
*/
! public Object clone()
{
// This gets us a shallow copy
! VerseRange copy = null;
! try
! {
! copy = (VerseRange) super.clone();
! }
! catch (CloneNotSupportedException e)
! {
! assert false : e;
! }
copy.start = (Verse) start.clone();
***************
*** 953,958 ****
protected VerseIterator(VerseRange range)
{
! next = range.start.getOrdinal();
! last = range.end.getOrdinal();
}
--- 961,966 ----
protected VerseIterator(VerseRange range)
{
! next = range.getStart().getOrdinal();
! last = range.getEnd().getOrdinal();
}
***************
*** 1134,1138 ****
* All ctors init this so leave default
*/
! /* pkg protected */ transient Verse start;
/**
--- 1142,1146 ----
* All ctors init this so leave default
*/
! private transient Verse start;
/**
***************
*** 1140,1144 ****
* All ctors init this so leave default
*/
! /* pkg protected */ transient Verse end;
/**
--- 1148,1152 ----
* All ctors init this so leave default
*/
! private transient Verse end;
/**
More information about the jsword-svn
mailing list