26 package javax.swing;
27
28 import java.util.Vector;
29 import java.util.Collection;
30 import java.util.Enumeration;
31
32
33 /**
34 * This class loosely implements the {@code java.util.Vector}
35 * API, in that it implements the 1.1.x version of
36 * {@code java.util.Vector}, has no collection class support,
37 * and notifies the {@code ListDataListener}s when changes occur.
38 * Presently it delegates to a {@code Vector},
39 * in a future release it will be a real Collection implementation.
40 * <p>
41 * <strong>Warning:</strong>
42 * Serialized objects of this class will not be compatible with
43 * future Swing releases. The current serialization support is
44 * appropriate for short term storage or RMI between applications running
45 * the same version of Swing. As of 1.4, support for long term storage
46 * of all JavaBeans™
47 * has been added to the {@code java.beans} package.
48 * Please see {@link java.beans.XMLEncoder}.
49 *
50 * @param <E> the type of the elements of this model
51 *
52 * @author Hans Muller
53 * @since 1.2
54 */
55 @SuppressWarnings("serial") // Same-version serialization only
56 public class DefaultListModel<E> extends AbstractListModel<E>
57 {
58 private Vector<E> delegate = new Vector<E>();
59
60 /**
61 * Returns the number of components in this list.
62 * <p>
63 * This method is identical to {@code size}, which implements the
64 * {@code List} interface defined in the 1.2 Collections framework.
65 * This method exists in conjunction with {@code setSize} so that
66 * {@code size} is identifiable as a JavaBean property.
|
26 package javax.swing;
27
28 import java.util.Vector;
29 import java.util.Collection;
30 import java.util.Enumeration;
31
32
33 /**
34 * This class loosely implements the {@code java.util.Vector}
35 * API, in that it implements the 1.1.x version of
36 * {@code java.util.Vector}, has no collection class support,
37 * and notifies the {@code ListDataListener}s when changes occur.
38 * Presently it delegates to a {@code Vector},
39 * in a future release it will be a real Collection implementation.
40 * <p>
41 * <strong>Warning:</strong>
42 * Serialized objects of this class will not be compatible with
43 * future Swing releases. The current serialization support is
44 * appropriate for short term storage or RMI between applications running
45 * the same version of Swing. As of 1.4, support for long term storage
46 * of all JavaBeans
47 * has been added to the {@code java.beans} package.
48 * Please see {@link java.beans.XMLEncoder}.
49 *
50 * @param <E> the type of the elements of this model
51 *
52 * @author Hans Muller
53 * @since 1.2
54 */
55 @SuppressWarnings("serial") // Same-version serialization only
56 public class DefaultListModel<E> extends AbstractListModel<E>
57 {
58 private Vector<E> delegate = new Vector<E>();
59
60 /**
61 * Returns the number of components in this list.
62 * <p>
63 * This method is identical to {@code size}, which implements the
64 * {@code List} interface defined in the 1.2 Collections framework.
65 * This method exists in conjunction with {@code setSize} so that
66 * {@code size} is identifiable as a JavaBean property.
|