File: InnerTest.java

package info (click to toggle)
android-platform-frameworks-base 21-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,836 kB
  • ctags: 9,265
  • sloc: cpp: 51,953; java: 19,224; ansic: 612; python: 571; yacc: 300; sh: 246; lex: 212; xml: 146; makefile: 70
file content (90 lines) | stat: -rw-r--r-- 2,371 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.eclipse.org/org/documents/epl-v10.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package mock_android.dummy;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class InnerTest {

    private int mSomeField;
    private MyStaticInnerClass mInnerInstance;
    private MyIntEnum mTheIntEnum;
    private MyGenerics1<int[][], InnerTest, MyIntEnum, float[]> mGeneric1;

    public class NotStaticInner2 extends NotStaticInner1 {

    }

    public class NotStaticInner1 {

        public void someThing() {
            mSomeField = 2;
            mInnerInstance = null;
        }

    }

    private static class MyStaticInnerClass {

    }
    
    private static class DerivingClass extends InnerTest {
        
    }
    
    // enums are a kind of inner static class
    public enum MyIntEnum {
        VALUE0(0),
        VALUE1(1),
        VALUE2(2);

        MyIntEnum(int myInt) {
            this.myInt = myInt;
        }
        final int myInt;
    }
    
    public static class MyGenerics1<T, U, V, W> {
        public MyGenerics1() {
            int a = 1;
        }
    }
    
    public <X> void genericMethod1(X a, X[] a) {
    }

    public <X, Y> void genericMethod2(X a, List<Y> b) {
    }

    public <X, Y> void genericMethod3(X a, List<Y extends InnerTest> b) {
    }

    public <T extends InnerTest> void genericMethod4(T[] a, Collection<T> b, Collection<?> c) {
        Iterator<T> i = b.iterator();
    }

    public void someMethod(InnerTest self) {
        mSomeField = self.mSomeField;
        MyStaticInnerClass m = new MyStaticInnerClass();
        mInnerInstance = m;
        mTheIntEnum = null;
        mGeneric1 = new MyGenerics1();
        genericMethod(new DerivingClass[0], new ArrayList<DerivingClass>(), new ArrayList<InnerTest>());
    }
}