summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 07:04:49 (EDT)
committerEike Stepper2007-10-11 07:04:49 (EDT)
commit8632ae68b7ade127ebd6d105a6b961cf703fdbfc (patch)
tree432d78cb893c3656d2883e786671d1d85704b0d6
parent8d71e0422f2f46a20206507470f01205db835602 (diff)
downloadcdo-8632ae68b7ade127ebd6d105a6b961cf703fdbfc.zip
cdo-8632ae68b7ade127ebd6d105a6b961cf703fdbfc.tar.gz
cdo-8632ae68b7ade127ebd6d105a6b961cf703fdbfc.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/ContainerEvent.java16
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/SingleDeltaContainerEvent.java9
2 files changed, 25 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/ContainerEvent.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/ContainerEvent.java
index ff31659..b5e1a96 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/ContainerEvent.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/ContainerEvent.java
@@ -18,6 +18,7 @@ import org.eclipse.net4j.util.container.IContainerEventVisitor;
import org.eclipse.net4j.util.container.IContainerDelta.Kind;
import org.eclipse.net4j.util.container.IContainerEventVisitor.Filtered;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -113,4 +114,19 @@ public class ContainerEvent<E> extends Event implements IContainerEvent<E>
}
}
}
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ for (IContainerDelta<E> delta : getDeltas())
+ {
+ builder.append(", ");
+ builder.append(delta.getKind());
+ builder.append("=");
+ builder.append(delta.getElement());
+ }
+
+ return MessageFormat.format("{0}[source={1}{2}]", getClass().getSimpleName(), getSource(), builder.toString());
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/SingleDeltaContainerEvent.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/SingleDeltaContainerEvent.java
index fd33b07..f8ee7c5 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/SingleDeltaContainerEvent.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/container/SingleDeltaContainerEvent.java
@@ -18,6 +18,8 @@ import org.eclipse.net4j.util.container.IContainerEventVisitor;
import org.eclipse.net4j.util.container.IContainerDelta.Kind;
import org.eclipse.net4j.util.container.IContainerEventVisitor.Filtered;
+import java.text.MessageFormat;
+
/**
* @author Eike Stepper
*/
@@ -86,4 +88,11 @@ public class SingleDeltaContainerEvent<E> extends Event implements IContainerEve
}
}
}
+
+ @Override
+ public String toString()
+ {
+ return MessageFormat.format("{0}[source={1}, {2}={3}]", getClass().getSimpleName(), getSource(), getDeltaElement(),
+ getDeltaKind());
+ }
}