[Nodal-cvs] nodal/j-src/storage/memory AbstractOperator.java,NONE,1.1 memBoolSequenceContent.java,1.
Status: Pre-Alpha
Brought to you by:
leei
Update of /cvsroot/nodal/nodal/j-src/storage/memory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29271/storage/memory Modified Files: memBoolSequenceContent.java OpReplaceRange.java OpInsertAfter.java BareContent.java OpAnchor.java memNodeMapContent.java memLiteralSetContent.java OpRemoveRange.java memContent.java memRecordContent.java MemContentI.java memLiteralMapContent.java memMapContent.java memStringContent.java OpClone.java OpAdd.java memNodeSetContent.java memByteSequenceContent.java memFloatSequenceContent.java memSetContent.java memSequenceContent.java memLongSequenceContent.java OpInsertBefore.java memIntSequenceContent.java OpSetValue.java memDoubleSequenceContent.java OpCreate.java OpRemove.java OpSetField.java memShortSequenceContent.java memGenericSequenceContent.java Added Files: AbstractOperator.java Removed Files: MemOperator.java Log Message: Move seatNode into AbstractRepository.Backend interface and AbstractBackend implementation. Rename MemOperator to AbstractOperator in storage.memory. Index: memLiteralMapContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memLiteralMapContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** memLiteralMapContent.java 28 Jun 2004 19:13:10 -0000 1.1 --- memLiteralMapContent.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 69,73 **** } ! void opSetValue(Object key, Object val, NodeContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary --- 69,73 ---- } ! void opSetValue(Object key, Object val, BareContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary *************** *** 78,82 **** } else { if (isNodeValue) { ! val = assignNode(c, key, (Node) val); } // Notify any interested values --- 78,82 ---- } else { if (isNodeValue) { ! val = c.assignNode(key, (Node) val); } // Notify any interested values Index: MemContentI.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/MemContentI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MemContentI.java 13 May 2004 19:39:17 -0000 1.3 --- MemContentI.java 16 Nov 2004 20:46:18 -0000 1.4 *************** *** 95,99 **** * applyTo method of the memOperator. */ ! void modify(MemOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure; } \ No newline at end of file --- 95,99 ---- * applyTo method of the memOperator. */ ! void modify(AbstractOperator op, BareContent.Editor c) throws InvalidOperator, ConstraintFailure; } \ No newline at end of file Index: memDoubleSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memDoubleSequenceContent.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** memDoubleSequenceContent.java 15 Jul 2004 04:47:57 -0000 1.19 --- memDoubleSequenceContent.java 16 Nov 2004 20:46:19 -0000 1.20 *************** *** 146,150 **** // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new DoubleSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 146,150 ---- // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new DoubleSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 153,160 **** private class IndexSetter implements DoubleSetterUtil.DoubleSetter { private int idx; ! private NodeContent.Editor content; private NodeManager mgr; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { idx = i; this.content = c; --- 153,160 ---- private class IndexSetter implements DoubleSetterUtil.DoubleSetter { private int idx; ! private BareContent.Editor content; private NodeManager mgr; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { idx = i; this.content = c; *************** *** 186,190 **** * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { // Convert to something close to Double --- 186,190 ---- * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { // Convert to something close to Double *************** *** 200,204 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, double v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 200,204 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, double v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 214,218 **** * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, double v, NodeContent c) throws ConstraintFailure { if (i < 0) { --- 214,218 ---- * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, double v, BareContent.Editor c) throws ConstraintFailure { if (i < 0) { *************** *** 224,228 **** synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure { DoubleSeq seq = (val == null ? null : DoubleSeqUtil.create(val)); if (seq != null) { --- 224,228 ---- synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! BareContent.Editor c) throws ConstraintFailure { DoubleSeq seq = (val == null ? null : DoubleSeqUtil.create(val)); if (seq != null) { *************** *** 256,260 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 256,260 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { *************** *** 266,270 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 266,270 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { Index: memSetContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memSetContent.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** memSetContent.java 16 Nov 2004 19:25:35 -0000 1.7 --- memSetContent.java 16 Nov 2004 20:46:18 -0000 1.8 *************** *** 211,228 **** } ! MemOperator invertAdd(Object key, NodeContent c) { Object value = getValue(key, c); if (value != null) { return null; } ! return MemOperator.createOpRemove(value); } ! MemOperator invertRemoveKey(Object key, NodeContent c) { Object value = getValue(key, c); if (value == null) { return null; } ! return MemOperator.createOpAdd(value); } --- 211,228 ---- } ! AbstractOperator invertAdd(Object key, NodeContent c) { Object value = getValue(key, c); if (value != null) { return null; } ! return AbstractOperator.createOpRemove(value); } ! AbstractOperator invertRemoveKey(Object key, NodeContent c) { Object value = getValue(key, c); if (value == null) { return null; } ! return AbstractOperator.createOpAdd(value); } *************** *** 324,331 **** public abstract Set asSet(); ! abstract boolean opAdd(Object v, NodeContent.Editor c) throws ConstraintFailure; ! abstract boolean opRemove(Object k, NodeContent.Editor c); ! final void opSetValue(Object key, Object val, NodeContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary key = checkItemType(key); --- 324,331 ---- public abstract Set asSet(); ! abstract boolean opAdd(Object v, BareContent.Editor c) throws ConstraintFailure; ! abstract boolean opRemove(Object k, BareContent.Editor c); ! final void opSetValue(Object key, Object val, BareContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary key = checkItemType(key); --- MemOperator.java DELETED --- Index: memFloatSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memFloatSequenceContent.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** memFloatSequenceContent.java 15 Jul 2004 04:47:57 -0000 1.19 --- memFloatSequenceContent.java 16 Nov 2004 20:46:18 -0000 1.20 *************** *** 146,150 **** // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new FloatSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 146,150 ---- // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new FloatSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 153,160 **** private final class IndexSetter implements FloatSetterUtil.FloatSetter { private final int idx; ! private final NodeContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; --- 153,160 ---- private final class IndexSetter implements FloatSetterUtil.FloatSetter { private final int idx; ! private final BareContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; *************** *** 186,190 **** * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { // Convert to something close to Double --- 186,190 ---- * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { // Convert to something close to Double *************** *** 200,204 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, float v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); --- 200,204 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, float v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); *************** *** 213,217 **** * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, float v, NodeContent c) throws ConstraintFailure { if (i < 0) { --- 213,217 ---- * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, float v, BareContent.Editor c) throws ConstraintFailure { if (i < 0) { *************** *** 223,227 **** synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure { FloatSeq seq = (val == null ? null : FloatSeqUtil.create(val)); if (seq != null) { --- 223,227 ---- synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! BareContent.Editor c) throws ConstraintFailure { FloatSeq seq = (val == null ? null : FloatSeqUtil.create(val)); if (seq != null) { *************** *** 255,259 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 255,259 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { *************** *** 265,269 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 265,269 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { Index: OpAnchor.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpAnchor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpAnchor.java 13 May 2004 19:39:16 -0000 1.1 --- OpAnchor.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 20,24 **** * @author leei */ ! class OpAnchor extends MemOperator implements org.nodal.model.OpAnchor { private static CacheMap map = new CacheMap(); --- 20,24 ---- * @author leei */ ! class OpAnchor extends AbstractOperator implements org.nodal.model.OpAnchor { private static CacheMap map = new CacheMap(); *************** *** 105,114 **** } ! void applyTo(memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAnchor on " + content); } ! MemOperator invertOn(memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return this; --- 105,114 ---- } ! void applyTo(memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAnchor on " + content); } ! AbstractOperator invertOn(memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return this; Index: OpAdd.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpAdd.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpAdd.java 13 May 2004 19:39:16 -0000 1.1 --- OpAdd.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 14,18 **** import org.nodal.util.ConstraintFailure; ! final class OpAdd extends MemOperator implements org.nodal.model.OpAdd { private Object val; --- 14,18 ---- import org.nodal.util.ConstraintFailure; ! final class OpAdd extends AbstractOperator implements org.nodal.model.OpAdd { private Object val; *************** *** 23,31 **** public Object value () { return val; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opAdd (val, c); } ! MemOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertAdd (val, c); --- 23,31 ---- public Object value () { return val; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opAdd (val, c); } ! AbstractOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertAdd (val, c); Index: OpSetField.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpSetField.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpSetField.java 13 May 2004 19:39:16 -0000 1.1 --- OpSetField.java 16 Nov 2004 20:46:19 -0000 1.2 *************** *** 16,20 **** import org.nodal.util.PropertyConstraintFailure; ! final class OpSetField extends MemOperator implements org.nodal.model.OpSetField { private Name field; private Object newValue; --- 16,20 ---- import org.nodal.util.PropertyConstraintFailure; ! final class OpSetField extends AbstractOperator implements org.nodal.model.OpSetField { private Name field; private Object newValue; *************** *** 40,48 **** } ! void applyTo(memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opSetField(field, newValue, c); } ! MemOperator invertOn(memContent content, NodeContent node) throws InvalidOperator, PropertyConstraintFailure { return content.invertSetField(field, node); --- 40,48 ---- } ! void applyTo(memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opSetField(field, newValue, c); } ! AbstractOperator invertOn(memContent content, NodeContent node) throws InvalidOperator, PropertyConstraintFailure { return content.invertSetField(field, node); Index: OpInsertAfter.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpInsertAfter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpInsertAfter.java 13 May 2004 19:39:16 -0000 1.1 --- OpInsertAfter.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 14,18 **** import org.nodal.util.ConstraintFailure; ! final class OpInsertAfter extends MemOperator implements org.nodal.model.OpInsertAfter { private int index; private Object newValue; --- 14,18 ---- import org.nodal.util.ConstraintFailure; ! final class OpInsertAfter extends AbstractOperator implements org.nodal.model.OpInsertAfter { private int index; private Object newValue; *************** *** 26,34 **** public Object value () { return newValue; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opInsertAfter (index, newValue, c); } ! MemOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertInsertAfter (index, newValue, c); --- 26,34 ---- public Object value () { return newValue; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opInsertAfter (index, newValue, c); } ! AbstractOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertInsertAfter (index, newValue, c); Index: OpRemove.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpRemove.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OpRemove.java 14 May 2004 17:31:28 -0000 1.2 --- OpRemove.java 16 Nov 2004 20:46:19 -0000 1.3 *************** *** 15,19 **** import org.nodal.util.PropertyConstraintFailure; ! final class OpRemove extends MemOperator implements org.nodal.model.OpRemove { private Object key; --- 15,19 ---- import org.nodal.util.PropertyConstraintFailure; ! final class OpRemove extends AbstractOperator implements org.nodal.model.OpRemove { private Object key; *************** *** 24,32 **** public Object key () { return key; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opRemove (key, c); } ! MemOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { return content.invertRemoveKey (key, c); --- 24,32 ---- public Object key () { return key; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opRemove (key, c); } ! AbstractOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { return content.invertRemoveKey (key, c); Index: memLiteralSetContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memLiteralSetContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** memLiteralSetContent.java 28 Jun 2004 19:13:10 -0000 1.1 --- memLiteralSetContent.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 14,18 **** import java.util.TreeSet; - import org.nodal.model.NodeContent; import org.nodal.model.SetContent; import org.nodal.type.SetType; --- 14,17 ---- *************** *** 74,78 **** } ! boolean opRemove (Object key, NodeContent.Editor c) { key = checkItemType(key); // Notify interested parties --- 73,77 ---- } ! boolean opRemove (Object key, BareContent.Editor c) { key = checkItemType(key); // Notify interested parties *************** *** 82,86 **** } ! boolean opAdd(Object val, NodeContent.Editor c) throws ConstraintFailure { val = checkValue(val); // Notify any interested values --- 81,85 ---- } ! boolean opAdd(Object val, BareContent.Editor c) throws ConstraintFailure { val = checkValue(val); // Notify any interested values Index: memShortSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memShortSequenceContent.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** memShortSequenceContent.java 15 Jul 2004 04:47:57 -0000 1.20 --- memShortSequenceContent.java 16 Nov 2004 20:46:19 -0000 1.21 *************** *** 145,149 **** // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new ShortSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 145,149 ---- // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new ShortSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 152,159 **** private final class IndexSetter implements ShortSetterUtil.ShortSetter { private final int idx; ! private final NodeContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; --- 152,159 ---- private final class IndexSetter implements ShortSetterUtil.ShortSetter { private final int idx; ! private final BareContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; *************** *** 182,186 **** * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 182,186 ---- * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 197,201 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, short v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); --- 197,201 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, short v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); *************** *** 220,224 **** synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure { ShortSeq seq = (val == null ? null : ShortSeqUtil.create(val)); if (seq != null) { --- 220,224 ---- synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! BareContent.Editor c) throws ConstraintFailure { ShortSeq seq = (val == null ? null : ShortSeqUtil.create(val)); if (seq != null) { *************** *** 250,254 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 250,254 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { *************** *** 260,264 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 260,264 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { Index: OpInsertBefore.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpInsertBefore.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpInsertBefore.java 13 May 2004 19:39:16 -0000 1.1 --- OpInsertBefore.java 16 Nov 2004 20:46:19 -0000 1.2 *************** *** 14,18 **** import org.nodal.util.ConstraintFailure; ! class OpInsertBefore extends MemOperator implements org.nodal.model.OpInsertBefore { private int index; private Object newValue; --- 14,18 ---- import org.nodal.util.ConstraintFailure; ! class OpInsertBefore extends AbstractOperator implements org.nodal.model.OpInsertBefore { private int index; private Object newValue; *************** *** 26,34 **** public Object value () { return newValue; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opInsertBefore (index, newValue, c); } ! MemOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertInsertBefore (index, content, c); --- 26,34 ---- public Object value () { return newValue; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opInsertBefore (index, newValue, c); } ! AbstractOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertInsertBefore (index, content, c); Index: OpRemoveRange.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpRemoveRange.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpRemoveRange.java 13 May 2004 19:39:16 -0000 1.1 --- OpRemoveRange.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 14,18 **** import org.nodal.util.ConstraintFailure; ! class OpRemoveRange extends MemOperator implements org.nodal.model.OpRemoveRange { private int startIndex; private int endIndex; --- 14,18 ---- import org.nodal.util.ConstraintFailure; ! class OpRemoveRange extends AbstractOperator implements org.nodal.model.OpRemoveRange { private int startIndex; private int endIndex; *************** *** 26,34 **** public int endIndex () { return endIndex; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { content.opRemoveRange (startIndex, endIndex, c); } ! MemOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertRemoveRange (startIndex, endIndex, c); --- 26,34 ---- public int endIndex () { return endIndex; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { content.opRemoveRange (startIndex, endIndex, c); } ! AbstractOperator invertOn (memContent content, NodeContent c) throws InvalidOperator, ConstraintFailure { return content.invertRemoveRange (startIndex, endIndex, c); Index: OpClone.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/OpClone.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpClone.java 13 May 2004 19:39:17 -0000 1.1 --- OpClone.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 14,18 **** import org.nodal.model.NodeContent; ! final class OpClone extends MemOperator implements org.nodal.model.OpClone { private final Node context; private final Node source; --- 14,18 ---- import org.nodal.model.NodeContent; ! final class OpClone extends AbstractOperator implements org.nodal.model.OpClone { private final Node context; private final Node source; *************** *** 29,38 **** public Node source () { return source; } ! void applyTo (memContent content, NodeContent c) throws InvalidOperator { throw new InvalidOperator ("invalid OpClone on "+content); } // The inverse of a creation Operator is itself. ! MemOperator invertOn (memContent content, NodeContent c) { return this; } --- 29,38 ---- public Node source () { return source; } ! void applyTo (memContent content, BareContent.Editor c) throws InvalidOperator { throw new InvalidOperator ("invalid OpClone on "+content); } // The inverse of a creation Operator is itself. ! AbstractOperator invertOn (memContent content, NodeContent c) { return this; } Index: memNodeSetContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memNodeSetContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** memNodeSetContent.java 28 Jun 2004 19:13:10 -0000 1.1 --- memNodeSetContent.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 16,20 **** import org.nodal.model.Node; - import org.nodal.model.NodeContent; import org.nodal.model.SetContent; import org.nodal.type.SetType; --- 16,19 ---- *************** *** 78,82 **** } ! boolean opRemove (Object key, NodeContent.Editor c) { key = checkItemType(key); // Notify interested parties --- 77,81 ---- } ! boolean opRemove (Object key, BareContent.Editor c) { key = checkItemType(key); // Notify interested parties *************** *** 90,96 **** } ! boolean opAdd(Object val, NodeContent.Editor c) throws ConstraintFailure { val = checkValue(val); ! val = assignNode(c, val, (Node) val); // Notify any interested values --- 89,95 ---- } ! boolean opAdd(Object val, BareContent.Editor c) throws ConstraintFailure { val = checkValue(val); ! val = c.assignNode(val, (Node) val); // Notify any interested values Index: memIntSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memIntSequenceContent.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** memIntSequenceContent.java 15 Jul 2004 04:47:57 -0000 1.46 --- memIntSequenceContent.java 16 Nov 2004 20:46:19 -0000 1.47 *************** *** 144,148 **** // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new IntSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 144,148 ---- // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new IntSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 151,158 **** private class IndexSetter implements IntSetterUtil.IntSetter { private int idx; ! private final NodeContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { idx = i; this.content = c; --- 151,158 ---- private class IndexSetter implements IntSetterUtil.IntSetter { private int idx; ! private final BareContent.Editor content; private final NodeManager mgr; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { idx = i; this.content = c; *************** *** 181,185 **** * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 181,185 ---- * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 196,200 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, int v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); --- 196,200 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, int v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); *************** *** 219,223 **** synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure { IntSeq seq = (val == null ? null : IntSeqUtil.create(val)); if (seq != null) { --- 219,223 ---- synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! BareContent.Editor c) throws ConstraintFailure { IntSeq seq = (val == null ? null : IntSeqUtil.create(val)); if (seq != null) { *************** *** 249,253 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 249,253 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { *************** *** 259,263 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 259,263 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { Index: memNodeMapContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memNodeMapContent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** memNodeMapContent.java 28 Jun 2004 19:13:10 -0000 1.1 --- memNodeMapContent.java 16 Nov 2004 20:46:18 -0000 1.2 *************** *** 17,21 **** import org.nodal.model.MapContent; import org.nodal.model.Node; - import org.nodal.model.NodeContent; import org.nodal.type.MapType; --- 17,20 ---- *************** *** 63,70 **** } ! void opRemoveKey(Object key, NodeContent.Editor c) throws PropertyConstraintFailure { key = checkKeyType(key); ! key = seatNode (c, (Node) key); // Notify interested parties --- 62,69 ---- } ! void opRemoveKey(Object key, BareContent.Editor c) throws PropertyConstraintFailure { key = checkKeyType(key); ! key = c.seatNode ((Node) key); // Notify interested parties *************** *** 75,79 **** } ! void opSetValue(Object key, Object val, NodeContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary --- 74,78 ---- } ! void opSetValue(Object key, Object val, BareContent.Editor c) throws ConstraintFailure { // Check types and convert if necessary *************** *** 84,91 **** opRemoveKey(key, c); } else { ! key = seatNode(c, (Node) key); if (isNodeValue) { ! val = assignNode(c, key, (Node) val); } // Notify any interested values --- 83,90 ---- opRemoveKey(key, c); } else { ! key = c.seatNode((Node) key); if (isNodeValue) { ! val = c.assignNode(key, (Node) val); } // Notify any interested values Index: BareContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/BareContent.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** BareContent.java 16 Nov 2004 19:25:35 -0000 1.31 --- BareContent.java 16 Nov 2004 20:46:18 -0000 1.32 *************** *** 40,43 **** --- 40,44 ---- import storage.framework.AbstractRepository; + import storage.framework.EdgeIndex; public abstract class BareContent extends NodeFilter implements NodeContent { *************** *** 47,50 **** --- 48,54 ---- protected List txnHandlers; + // NEXT Should this be Repo-based? + private static final EdgeIndex globalIndex = EdgeIndex.create(); + protected BareContent(Node n, memContent c, Capability cap, AbstractRepository.Backend backend) { *************** *** 76,79 **** --- 80,87 ---- } + Node seatNode (Node node) { + return backend.seatNode(node); + } + // Methods from org.nodal.model.TxnMonitorable public void addTxnHandler(TxnHandler handler) { *************** *** 181,185 **** public Operator invert(Operator op) throws InvalidOperator, ConstraintFailure { ! return c.invert((MemOperator) op, this); } --- 189,193 ---- public Operator invert(Operator op) throws InvalidOperator, ConstraintFailure { ! return c.invert((AbstractOperator) op, this); } *************** *** 220,223 **** --- 228,254 ---- } + // Methods inherited from BareContent + Node seatNode (Node node) { + return content.seatNode(node); + } + + /** + * Called whenever a Node value is assigned anywhere in a BareContent object. This takes + * care of accessing the {@link org.nodal.model.Node#bareNode()}, ensuring + * that the reference stored is in the same repository, and then that all + * indices are properly updated. + * + * @param property + * the property being assigned + * @param node + * the Node being assigned as the value for property + * @return the Node pointer ultimately assigned + */ + protected Node assignNode(Object property, Node node) { + node = seatNode(node); + globalIndex.add(this, property, node); + return node; + } + // Methods inherited from Node public NodeContent content() { *************** *** 264,268 **** public final Operator invert(Operator op) throws InvalidOperator, ConstraintFailure { ! return content.invert((MemOperator) op); } --- 295,299 ---- public final Operator invert(Operator op) throws InvalidOperator, ConstraintFailure { ! return content.invert((AbstractOperator) op); } *************** *** 351,360 **** return applyCreateOp((CreateOp) op); } ! content.c.modify((MemOperator) op, this); return this; } public void modify(Operator op) throws InvalidOperator, ConstraintFailure { ! content.c.modify((MemOperator) op, this); } --- 382,391 ---- return applyCreateOp((CreateOp) op); } ! content.c.modify((AbstractOperator) op, this); return this; } public void modify(Operator op) throws InvalidOperator, ConstraintFailure { ! content.c.modify((AbstractOperator) op, this); } Index: memContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memContent.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** memContent.java 16 Nov 2004 19:25:35 -0000 1.35 --- memContent.java 16 Nov 2004 20:46:18 -0000 1.36 *************** *** 33,37 **** import org.nodal.util.PropertyConstraintFailure; - import storage.framework.EdgeIndex; import storage.framework.AbstractRepository; --- 33,36 ---- *************** *** 47,52 **** protected final CacheMap nodeContents; protected final Set allContents; - // NEXT Should this be Repo-based? - private static final EdgeIndex globalIndex = EdgeIndex.create(); protected memContent() { --- 46,49 ---- *************** *** 104,108 **** * the memOperator to apply this content to */ ! public void modify(MemOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure { op.applyTo(this, c); --- 101,105 ---- * the memOperator to apply this content to */ ! public void modify(AbstractOperator op, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { op.applyTo(this, c); *************** *** 112,120 **** // pattern of memOperator.applyTo. They should be overridden for // any memContent class that recognizes the Operator. ! abstract void opSetValue(Object k, Object v, NodeContent.Editor c) throws ConstraintFailure; // Methods valid only for MapContent ! boolean opRemove(Object k, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpRemoveKey on " + this); --- 109,117 ---- // pattern of memOperator.applyTo. They should be overridden for // any memContent class that recognizes the Operator. ! abstract void opSetValue(Object k, Object v, BareContent.Editor c) throws ConstraintFailure; // Methods valid only for MapContent ! boolean opRemove(Object k, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpRemoveKey on " + this); *************** *** 122,126 **** // Methods valid only for RecordContent ! void opSetField(Name n, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpSetField on " + this); --- 119,123 ---- // Methods valid only for RecordContent ! void opSetField(Name n, Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpSetField on " + this); *************** *** 128,157 **** // Methods valid only for SequenceContent ! void opSetItem(int i, Object v, NodeContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpSetItem on " + this); } ! void opRemoveRange(int startIndex, int endIndex, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpRemoveRange on " + this); } ! void opReplaceRange(int startIndex, int endIndex, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpReplaceRange on " + this); } ! void opInsertBefore(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertBefore on " + this); } ! void opInsertAfter(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertAfter on " + this); } ! boolean opAdd(Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAdd on " + this); --- 125,154 ---- // Methods valid only for SequenceContent ! void opSetItem(int i, Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpSetItem on " + this); } ! void opRemoveRange(int startIndex, int endIndex, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpRemoveRange on " + this); } ! void opReplaceRange(int startIndex, int endIndex, Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpReplaceRange on " + this); } ! void opInsertBefore(int index, Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertBefore on " + this); } ! void opInsertAfter(int index, Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertAfter on " + this); } ! boolean opAdd(Object v, BareContent.Editor c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAdd on " + this); *************** *** 160,164 **** public Operator invert(Operator op, NodeContent c) throws InvalidOperator, ConstraintFailure { ! return invert((MemOperator) op, c); } --- 157,161 ---- public Operator invert(Operator op, NodeContent c) throws InvalidOperator, ConstraintFailure { ! return invert((AbstractOperator) op, c); } *************** *** 168,172 **** * @return a memOperator that represents the inverse operation. */ ! public MemOperator invert(MemOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure { // Use the double dispatch pattern with memOperator to compute this --- 165,169 ---- * @return a memOperator that represents the inverse operation. */ ! public AbstractOperator invert(AbstractOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure { // Use the double dispatch pattern with memOperator to compute this *************** *** 177,211 **** // pattern of memOperator.applyTo. They should be overridden for // any memContent class that recognizes the Operator. ! MemOperator invertRemoveKey(Object key, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpRemoveKey on " + this); } ! MemOperator invertSetField(Name name, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpSetField on " + this); } ! MemOperator invertRemoveRange(int startIndex, int endIndex, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpRemoveRange on " + this); } ! MemOperator invertReplaceRange(int startIndex, int endIndex, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpReplaceRange on " + this); } ! MemOperator invertInsertBefore(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertBefore on " + this); } ! MemOperator invertInsertAfter(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertAfter on " + this); } ! MemOperator invertAdd(Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAdd on " + this); --- 174,208 ---- // pattern of memOperator.applyTo. They should be overridden for // any memContent class that recognizes the Operator. ! AbstractOperator invertRemoveKey(Object key, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpRemoveKey on " + this); } ! AbstractOperator invertSetField(Name name, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpSetField on " + this); } ! AbstractOperator invertRemoveRange(int startIndex, int endIndex, NodeContent c) throws InvalidOperator, PropertyConstraintFailure { throw new InvalidOperator("invalid OpRemoveRange on " + this); } ! AbstractOperator invertReplaceRange(int startIndex, int endIndex, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpReplaceRange on " + this); } ! AbstractOperator invertInsertBefore(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertBefore on " + this); } ! AbstractOperator invertInsertAfter(int index, Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpInsertAfter on " + this); } ! AbstractOperator invertAdd(Object v, NodeContent c) throws InvalidOperator, ConstraintFailure { throw new InvalidOperator("invalid OpAdd on " + this); *************** *** 294,340 **** return null; } - - /** - * Ensure that any Node references are within the current Repository. - * - * @param node - * the Node being referenced - * @param c - * the NodeContent context for this reference - * @return a "seated" reference to the given Node - */ - protected Node seatNode(NodeContent.Editor c, Node node) { - // Make sure that we only use bareNode references. - if (node != null) { - // Only use direct Node references. - node = node.bareNode(); - // If we are not in the same Repository, then create an AnchorNode - // reference to the other Repository. - if (node.repository() != c.repository()) { - node = c.createAnchor(node.path()); - System.out.println("Storing " + node + " in " + c.repository()); - } - } - return node; - } - - /** - * Called whenever a Node value is assigned anywhere in memContent. This takes - * care of accessing the {@link org.nodal.model.Node#bareNode()}, ensuring - * that the reference stored is in the same repository, and then that all - * indices are properly updated. - * - * @param c - * the NodeContent context for this assignment - * @param property - * the property being assigned - * @param node - * the Node being assigned as the value for property - * @return the Node pointer ultimately assigned - */ - protected Node assignNode(NodeContent.Editor c, Object property, Node node) { - node = seatNode(c, node); - globalIndex.add(c.content(), property, node); - return node; - } }; --- 291,293 ---- Index: memBoolSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memBoolSequenceContent.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** memBoolSequenceContent.java 15 Jul 2004 04:47:57 -0000 1.21 --- memBoolSequenceContent.java 16 Nov 2004 20:46:18 -0000 1.22 *************** *** 145,149 **** // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new BooleanSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 145,149 ---- // Implementation of StSequenceEditor methods ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new BooleanSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 153,159 **** private int idx; private NodeManager mgr; ! private NodeContent.Editor content; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { this.idx = i; this.mgr = mgr; --- 153,159 ---- private int idx; private NodeManager mgr; ! private BareContent.Editor content; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { this.idx = i; this.mgr = mgr; *************** *** 181,185 **** } ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 181,185 ---- } ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 196,200 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, boolean v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 196,200 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, boolean v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 210,214 **** * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, boolean v, NodeContent c) { if (i < 0) { i = normalizeIndex(i); --- 210,214 ---- * must have already been done. */ ! private synchronized void opSetItemUnchecked(int i, boolean v, BareContent.Editor c) { if (i < 0) { i = normalizeIndex(i); *************** *** 219,223 **** synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure { BooleanSeq seq = (val == null ? null : BooleanSeqUtil.create(val)); if (seq != null) { --- 219,223 ---- synchronized void opReplaceRange(int startIndex, int endIndex, Object val, ! BareContent.Editor c) throws ConstraintFailure { BooleanSeq seq = (val == null ? null : BooleanSeqUtil.create(val)); if (seq != null) { *************** *** 251,255 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 251,255 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { *************** *** 261,265 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { if (val == null) { --- 261,265 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { if (val == null) { Index: memStringContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memStringContent.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** memStringContent.java 15 Jul 2004 04:47:57 -0000 1.39 --- memStringContent.java 16 Nov 2004 20:46:18 -0000 1.40 *************** *** 161,165 **** } ! protected Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new CharSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); --- 161,165 ---- } ! protected Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException { return new CharSetterUtil(itemGetter(i, c), new IndexSetter(i, c, mgr)); *************** *** 169,175 **** private final int idx; private final NodeManager mgr; ! private final NodeContent.Editor content; ! IndexSetter(int i, NodeContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; --- 169,175 ---- private final int idx; private final NodeManager mgr; ! private final BareContent.Editor content; ! IndexSetter(int i, BareContent.Editor c, NodeManager mgr) { this.idx = i; this.content = c; *************** *** 199,203 **** * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); --- 199,203 ---- * Automatically converts to a valid value if necessary. */ ! void opSetItem(int i, Object v, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); *************** *** 214,218 **** * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, char ch, NodeContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); --- 214,218 ---- * Set an item value with full checking of validity of value or index. */ ! void opSetItem(int i, char ch, BareContent.Editor c) throws ConstraintFailure { checkIndex(i); Type itemType = type.itemType(); *************** *** 249,253 **** */ synchronized void opReplaceRange(int start, int end, Object val, ! NodeContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); checkSeq(seq); --- 249,253 ---- */ synchronized void opReplaceRange(int start, int end, Object val, ! BareContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); checkSeq(seq); *************** *** 284,288 **** } ! synchronized void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); --- 284,288 ---- } ! synchronized void opInsertBefore(int index, Object val, BareContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); *************** *** 295,299 **** } ! synchronized void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); --- 295,299 ---- } ! synchronized void opInsertAfter(int index, Object val, BareContent.Editor c) throws ConstraintFailure { CharSeq seq = CharSeqUtil.create(val); Index: memSequenceContent.java =================================================================== RCS file: /cvsroot/nodal/nodal/j-src/storage/memory/memSequenceContent.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** memSequenceContent.java 16 Nov 2004 19:25:35 -0000 1.70 --- memSequenceContent.java 16 Nov 2004 20:46:18 -0000 1.71 *************** *** 254,258 **** // Implementation of opSetValue from memContent ! void opSetValue(Object k, Object value, NodeContent.Editor c) throws ConstraintFailure { if (k instanceof Byte || k instanceof Short || k instanceof Integer) { --- 254,258 ---- // Implementation of opSetValue from memContent ! void opSetValue(Object k, Object value, BareContent.Editor c) throws ConstraintFailure { if (k instanceof Byte || k instanceof Short || k instanceof Integer) { *************** *** 266,285 **** throws IndexBoundsException; ! protected abstract Setter itemSetter(int i, NodeContent.Editor c, NodeManager mgr) throws IndexBoundsException; ! abstract void opSetItem(int i, Object val, NodeContent.Editor c) throws ConstraintFailure; abstract void opReplaceRange(int startIndex, int endIndex, Object val, ! NodeContent.Editor c) throws ConstraintFailure; ! abstract void opInsertBefore(int index, Object val, NodeContent.Editor c) throws ConstraintFailure; ! abstract void opInsertAfter(int index, Object val, NodeContent.Editor c) throws ConstraintFailure; ! final void opRemoveRange(int startIndex, int endIndex, NodeContent.Editor c) throws ConstraintFailure { checkRange(startIndex, endIndex); --- 266,285 ---- throws IndexBoundsException; ! protected abstract Setter itemSetter(int i, BareContent.Editor c, NodeManager mgr) throws IndexBoundsException; ! abstract void opSetItem(int i, Object val, BareContent.Editor c) throws Co... [truncated message content] |