/** * Called upon unmarshalling. * * @param iTree Tree which belong * @param iParent Parent node if any * @param iRecordId Record to unmarshall */ public OMVRBTreeEntryPersistent( final OMVRBTreePersistent<K, V> iTree, final OMVRBTreeEntryPersistent<K, V> iParent, final ORID iRecordId) { super(iTree); pTree = iTree; dataProvider = pTree.dataProvider.getEntry(iRecordId); dataProvider.setIdentityChangedListener(this); init(); parent = iParent; // setParent(iParent); pTree.addNodeInMemory(this); }
/** * Called on event of splitting an entry. Copy values from the parent node. * * @param iParent Parent node * @param iPosition Current position */ public OMVRBTreeEntryPersistent(final OMVRBTreeEntry<K, V> iParent, final int iPosition) { super(((OMVRBTreeEntryPersistent<K, V>) iParent).getTree()); pTree = (OMVRBTreePersistent<K, V>) tree; OMVRBTreeEntryPersistent<K, V> pParent = (OMVRBTreeEntryPersistent<K, V>) iParent; dataProvider = pTree.dataProvider.createEntry(); dataProvider.setIdentityChangedListener(this); dataProvider.copyDataFrom(pParent.dataProvider, iPosition); if (pParent.dataProvider.truncate(iPosition)) pParent.markDirty(); init(); setParent(pParent); pTree.addNodeInMemory(this); // created entry : force dispatch dirty node. markDirty(); }
/** * Make a new cell with given key, value, and parent, and with <tt>null</tt> child links, and * BLACK color. */ public OMVRBTreeEntryPersistent( final OMVRBTreePersistent<K, V> iTree, final K iKey, final V iValue, final OMVRBTreeEntryPersistent<K, V> iParent) { super(iTree); pTree = iTree; dataProvider = pTree.dataProvider.createEntry(); dataProvider.setIdentityChangedListener(this); dataProvider.insertAt(0, iKey, iValue); init(); setParent(iParent); pTree.addNodeInMemory(this); // created entry : force dispatch dirty node. markDirty(); }