Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IDiffContainer.java')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IDiffContainer.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IDiffContainer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IDiffContainer.java
new file mode 100644
index 000000000..376a18178
--- /dev/null
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/IDiffContainer.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed Materials - Property of IBM,
+ * WebSphere Studio Workbench
+ * (c) Copyright IBM Corp 2000, 2001
+ */
+package org.eclipse.compare.structuremergeviewer;
+
+import java.util.Iterator;
+
+/**
+ * <code>IDiffContainer</code> is a <code>IDiffElement</code> with children.
+ * <p>
+ * <code>IDiffContainer</code> are the inner nodes displayed
+ * by the <code>DiffTreeViewer</code>.
+ * <code>IDiffContainer</code> are typically created as the result of performing
+ * a compare with the <code>Differencer</code>.
+ * <p>
+ * Clients may implement this interface, or use one of the standard implementations,
+ * <code>DiffContainer</code> or <code>DiffNode</code>.
+ *
+ * @see Differencer
+ * @see DiffTreeViewer
+ */
+public interface IDiffContainer extends IDiffElement {
+
+ /**
+ * Returns whether this container has at least one child.
+ * In some cases this methods avoids having to call the
+ * potential more costly <code>getChildren</code> method.
+ *
+ * @return <code>true</code> if this container has at least one child
+ */
+ boolean hasChildren();
+
+ /**
+ * Returns the children of this container.
+ * If this container has no children an empty array is returned (not <code>null</code>).
+ *
+ * @return the children of this container as an array
+ */
+ IDiffElement[] getChildren();
+
+ /**
+ * Adds the given child to this container.
+ * If the child is already contained in this container, this method has no effect.
+ *
+ * @param child the child to be added to this container
+ */
+ void add(IDiffElement child);
+
+ /**
+ * Removes the given child from this container.
+ * If the container becomes empty it is removed from its container.
+ * If the child is not contained in this container, this method has no effect.
+ *
+ * @param child the child to be removed from this container
+ */
+ void removeToRoot(IDiffElement child);
+}

Back to the top