1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17public final class Derived extends Base {
18  public Derived() {
19    this(0);
20  }
21
22  public Derived(int intValue) {
23    super(intValue);
24  }
25
26  public Derived(String stringValue) {
27    super(stringValue);
28    stringField = null;   // Clear field set by Base.<init>(String).
29  }
30
31  public Derived(double doubleValue) {
32    super(doubleValue, null);
33  }
34
35  public Derived(int intValue, double doubleValue, Object objectValue) {
36    super(intValue, doubleValue, objectValue);
37    objectField = null;   // Clear field set by Base.<init>(int, double, Object).
38    intField = 0;         // Clear field set by Base.<init>(int, double, Object).
39  }
40
41  Derived(int intValue, double doubleValue, Object objectValue, String stringValue) {
42    super(intValue, doubleValue, objectValue, stringValue);
43    // Clearing fields here doesn't help because the superclass constructor must
44    // satisfy the pattern constraints on its own and it doesn't (it has 4 IPUTs).
45    intField = 0;
46    doubleField = 0.0;
47    objectField = null;
48    stringField = null;
49  }
50
51  public Derived(float floatValue) {
52    super();
53    floatField = floatValue;
54  }
55
56  public Derived(int intValue, double doubleValue, Object objectValue, float floatValue) {
57    super(intValue, doubleValue, objectValue);
58    objectField = null;   // Clear field set by Base.<init>(int, double, Object).
59    floatField = floatValue;
60  }
61
62  public float floatField;
63}
64