Move to Android N-MR1 SDK.
[android_tools.git] / sdk / sources / android-25 / org / w3c / domts / UserDataMonitor.java
blobd7e35bb5248075333722f2e825b7555b838d8160
1 /*
2 * Copyright (c) 2004 World Wide Web Consortium, (Massachusetts Institute of
3 * Technology, Institut National de Recherche en Informatique et en
4 * Automatique, Keio University). All Rights Reserved. This program is
5 * distributed under the W3C's Software Intellectual Property License. This
6 * program is distributed in the hope that it will be useful, but WITHOUT ANY
7 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8 * FOR A PARTICULAR PURPOSE. See W3C License
9 * http://www.w3.org/Consortium/Legal/ for more details.
12 package org.w3c.domts;
14 import java.util.ArrayList;
15 import java.util.List;
17 import org.w3c.dom.Node;
18 import org.w3c.dom.UserDataHandler;
20 /**
21 * This is a utility implementation of UserDataHandler that captures all
22 * notifications
24 public class UserDataMonitor
25 implements UserDataHandler {
26 private final List notifications = new ArrayList();
28 /**
29 * Public constructor
32 public UserDataMonitor() {
35 /**
36 * Implementation of UserDataHandler.handle. Creates a UserDataNotification
37 * for later testing
39 * @param operation
40 * See org.w3c.dom.UserDataHandler
41 * @param key
42 * See org.w3c.dom.UserDataHandler
43 * @param data
44 * See org.w3c.dom.UserDataHandler
45 * @param src
46 * See org.w3c.dom.UserDataHandler
47 * @param dst
48 * See org.w3c.dom.UserDataHandler
50 public void handle(
51 short operation,
52 String key,
53 Object data,
54 Node src,
55 Node dst) {
56 notifications.add(
57 new UserDataNotification(operation, key, data, src, dst));
60 /**
61 * Gets list of notifications
63 * @return List of notifications, may not be null.
65 public final List getAllNotifications() {
66 return new ArrayList(notifications);