Package: AbstractCollectionType

AbstractCollectionType

nameinstructionbranchcomplexitylinemethod
AbstractCollectionType(IReadOnlyQueryEnvironment, IType)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
equals(Object)
M: 23 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getCollectionType()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hashCode()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2015 Obeo.
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: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.query.validation.type;
12:
13: import org.eclipse.acceleo.query.runtime.IReadOnlyQueryEnvironment;
14:
15: /**
16: * Abstract collection type implementation.
17: *
18: * @author <a href="mailto:yvan.lussaud@obeo.fr">Yvan Lussaud</a>
19: */
20: public abstract class AbstractCollectionType extends AbstractJavaType implements ICollectionType {
21:
22:         /**
23:          * The {@link IType}.
24:          */
25:         private final IType type;
26:
27:         /**
28:          * Constructor.
29:          *
30:          * @param queryEnvironment
31:          * the {@link IReadOnlyQueryEnvironment}
32:          * @param type
33:          * the {@link IType}
34:          */
35:         public AbstractCollectionType(IReadOnlyQueryEnvironment queryEnvironment, IType type) {
36:                 super(queryEnvironment);
37:                 this.type = type;
38:         }
39:
40:         /**
41:          * {@inheritDoc}
42:          *
43:          * @see org.eclipse.acceleo.query.validation.type.ICollectionType#getCollectionType()
44:          */
45:         public IType getCollectionType() {
46:                 return type;
47:         }
48:
49:         /**
50:          * {@inheritDoc}
51:          *
52:          * @see java.lang.Object#hashCode()
53:          */
54:         @Override
55:         public int hashCode() {
56:                 return getType().hashCode() ^ getCollectionType().hashCode();
57:         }
58:
59:         /**
60:          * {@inheritDoc}
61:          *
62:          * @see java.lang.Object#equals(java.lang.Object)
63:          */
64:         @Override
65:         public boolean equals(Object obj) {
66:•                return getClass() == obj.getClass() && ((AbstractCollectionType)obj).getType().equals(getType())
67:•                                && ((AbstractCollectionType)obj).getCollectionType().equals(getCollectionType());
68:         }
69:
70: }