Skip to content

Package: InternalChildrenList

InternalChildrenList

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eike Stepper - initial API and implementation
13: * Eugen Neufeld - javaDoc
14: *
15: *******************************************************************************/
16:
17: package org.eclipse.emf.ecp.spi.core.util;
18:
19: import java.util.Collection;
20:
21: /**
22: * This class defines a List.
23: *
24: * @author Eike Stepper
25: * @author Eugen Neufeld
26: * @noextend This interface is not intended to be extended by clients.
27: * @noimplement This interface is not intended to be implemented by clients.
28: * @since 1.1
29: */
30: public interface InternalChildrenList {
31:
32:         /**
33:          * The size of the list.
34:          *
35:          * @return number of elements in the list
36:          */
37:         int size();
38:
39:         /**
40:          * Whether this list has children.
41:          *
42:          * @return true if this list has children, false otherwise.
43:          */
44:         boolean hasChildren();
45:
46:         /**
47:          * Returns the children of this list.
48:          *
49:          * @return an array containing all children
50:          */
51:
52:         Object[] getChildren();
53:
54:         /**
55:          * Returns the object with this index from the list. Throws an IndexOutOfBoundException if index is invalid.
56:          *
57:          * @param index the index of the element to get
58:          * @return the element
59:          */
60:
61:         Object getChild(int index);
62:
63:         /**
64:          * Return the parent element of this list.
65:          *
66:          * @return the parent of the list
67:          */
68:         Object getParent();
69:
70:         // TODO describe what slow means
71:         /**
72:          * Whether this list is slow or not.
73:          *
74:          * @return true if it is slow, false otherwise
75:          */
76:
77:         boolean isSlow();
78:
79:         // TODO describe what complete means
80:         /**
81:          * Whether this list is complete or not.
82:          *
83:          * @return true if it is complete, false otherwise
84:          */
85:         boolean isComplete();
86:
87:         void addChildWithoutRefresh(Object child);
88:
89:         /**
90:          * Adds a child to the list.
91:          *
92:          * @param child the child
93:          */
94:         void addChild(Object child);
95:
96:         <T> void addChildren(T... children);
97:
98:         /**
99:          * Adds a list of children to the list.
100:          *
101:          * @param children a collection of new children
102:          */
103:         <T> void addChildren(Collection<T> children);
104:
105:         void setComplete();
106: }