EMMA Coverage Report (generated Mon Sep 29 15:05:28 EDT 2008)
[all classes][org.eclipse.jface.util]

COVERAGE SUMMARY FOR SOURCE FILE [ListenerList.java]

nameclass, %method, %block, %line, %
ListenerList.java0%   (0/1)0%   (0/2)0%   (0/7)0%   (0/4)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ListenerList0%   (0/1)0%   (0/2)0%   (0/7)0%   (0/4)
ListenerList (): void 0%   (0/1)0%   (0/4)0%   (0/2)
ListenerList (int): void 0%   (0/1)0%   (0/3)0%   (0/2)

1/*******************************************************************************
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 *     IBM Corporation - initial API and implementation
10 *******************************************************************************/
11package org.eclipse.jface.util;
12 
13/**
14 * This class is used to maintain a list of listeners, and is used in the
15 * implementations of several classes within JFace which allow you to register
16 * listeners of various kinds. It is a fairly lightweight object, occupying
17 * minimal space when no listeners are registered.
18 * <p>
19 * Note that the <code>add</code> method checks for and eliminates duplicates
20 * based on identity (not equality). Likewise, the <code>remove</code> method
21 * compares based on identity.
22 * </p>
23 * <p>
24 * Use the <code>getListeners</code> method when notifying listeners. Note
25 * that no garbage is created if no listeners are registered. The recommended
26 * code sequence for notifying all registered listeners of say,
27 * <code>FooListener.eventHappened</code>, is:
28 * 
29 * <pre>
30 * Object[] listeners = myListenerList.getListeners();
31 * for (int i = 0; i &lt; listeners.length; ++i) {
32 *         ((FooListener) listeners[i]).eventHappened(event);
33 * }
34 * </pre>
35 * 
36 * </p>
37 * 
38 * @deprecated Please use {@link org.eclipse.core.runtime.ListenerList} instead.
39 *             Please note that the {@link #ListenerList(int)} and
40 *             {@link org.eclipse.core.runtime.ListenerList#ListenerList(int)}
41 *             constructors have different semantics. Please read the javadoc
42 *             carefully. Also note that the equivalent of
43 *             {@link #ListenerList()} is actually
44 *             {@link org.eclipse.core.runtime.ListenerList#ListenerList(int)}
45 *             with {@link org.eclipse.core.runtime.ListenerList#IDENTITY} as
46 *             the argument.
47 */
48public class ListenerList extends org.eclipse.core.runtime.ListenerList {
49 
50        /**
51         * Creates a listener list with an initial capacity of 1.
52         */
53        public ListenerList() {
54                super(IDENTITY);
55        }
56 
57        /**
58         * Creates a listener list with the given initial capacity.
59         * 
60         * @param capacity
61         *            the number of listeners which this list can initially accept
62         *            without growing its internal representation; must be at least
63         *            1
64         */
65        public ListenerList(int capacity) {
66                // the runtime ListenerList does not support capacity
67                this();
68        }
69}

[all classes][org.eclipse.jface.util]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov