1 11 package org.eclipse.core.internal.dtree; 12 13 import org.eclipse.core.internal.utils.Messages; 14 import org.eclipse.core.runtime.IPath; 15 import org.eclipse.osgi.util.NLS; 16 17 22 public class DeletedNode extends AbstractDataTreeNode { 23 24 27 DeletedNode(String localName) { 28 super(localName, NO_CHILDREN); 29 } 30 31 34 AbstractDataTreeNode asBackwardDelta(DeltaDataTree myTree, DeltaDataTree parentTree, IPath key) { 35 if (parentTree.includes(key)) 36 return parentTree.copyCompleteSubtree(key); 37 return this; 38 } 39 40 43 AbstractDataTreeNode childAt(String localName) { 44 45 throw new ObjectNotFoundException(NLS.bind(Messages.dtree_missingChild, localName)); 46 } 47 48 51 AbstractDataTreeNode childAtOrNull(String localName) { 52 53 return null; 54 } 55 56 AbstractDataTreeNode compareWithParent(IPath key, DeltaDataTree parent, IComparator comparator) { 57 62 if (parent.includes(key)) 63 return convertToRemovedComparisonNode(parent.copyCompleteSubtree(key), NodeComparison.K_REMOVED); 64 return new DataTreeNode(key.lastSegment(), new NodeComparison(null, null, 0, 0)); 67 } 68 69 73 AbstractDataTreeNode copy() { 74 return new DeletedNode(name); 75 } 76 77 80 boolean isDeleted() { 81 return true; 82 } 83 84 87 AbstractDataTreeNode simplifyWithParent(IPath key, DeltaDataTree parent, IComparator comparer) { 88 if (parent.includes(key)) 89 return this; 90 return new NoDataDeltaNode(name); 91 } 92 93 96 int size() { 97 98 return 0; 99 } 100 101 105 public String toString() { 106 return "a DeletedNode(" + this.getName() + ")"; } 108 109 112 int type() { 113 return T_DELETED_NODE; 114 } 115 116 AbstractDataTreeNode childAtIgnoreCase(String localName) { 117 118 return null; 119 } 120 } 121 | Popular Tags |