1 21 package com.db4o.inside.ix; 22 23 import com.db4o.*; 24 import com.db4o.foundation.*; 25 import com.db4o.inside.freespace.*; 26 27 30 public class IxAdd extends IxPatch { 31 32 boolean _keepRemoved; 33 34 public IxAdd(IndexTransaction a_ft, int a_parentID, Object a_value) { 35 super(a_ft, a_parentID, a_value); 36 } 37 38 void beginMerge(){ 39 super.beginMerge(); 40 handler().prepareComparison( handler().comparableObject(trans(), _value)); 41 } 42 43 public void visit(Object obj){ 44 ((Visitor4)obj).visit(new Integer (_parentID)); 45 } 46 47 public void visit(Visitor4 visitor, int[] lowerAndUpperMatch){ 48 visitor.visit(new Integer (_parentID)); 49 } 50 51 public void freespaceVisit(FreespaceVisitor visitor, int index){ 52 visitor.visit(_parentID, ((Integer )_value).intValue()); 53 } 54 55 public int write(Indexable4 a_handler, YapWriter a_writer) { 56 a_handler.writeIndexEntry(a_writer, _value); 57 a_writer.writeInt(_parentID); 58 a_writer.writeForward(); 59 return 1; 60 } 61 62 public String toString(){ 63 if(! Debug4.prettyToStrings){ 64 return super.toString(); 65 } 66 String str = "IxAdd " + _parentID + "\n " + handler().comparableObject(trans(), _value); 67 return str; 68 } 69 70 public void visitAll(IntObjectVisitor visitor) { 71 visitor.visit(_parentID, handler().comparableObject(trans(), _value)); 72 } 73 74 public Object shallowClone() { 75 IxAdd add=new IxAdd(_fieldTransaction,_parentID,_value); 76 super.shallowCloneInternal(add); 77 add._keepRemoved=_keepRemoved; 78 return add; 79 } 80 } 81 | Popular Tags |