blob: 589dd76de19fc56138443df074de88b68b43aae0 [file] [log] [blame]
Christoffer Quist Adamsen48877022021-02-15 14:30:31 +01001// Copyright (c) 2021, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5package com.android.tools.r8.graph;
6
Christoffer Quist Adamsen306f0b32021-02-15 16:08:22 +01007import com.android.tools.r8.references.ClassReference;
Christoffer Quist Adamsen48877022021-02-15 14:30:31 +01008import java.util.function.Consumer;
9
10public interface ClassDefinition extends Definition {
11
12 Iterable<DexType> allImmediateSupertypes();
13
14 void forEachClassField(Consumer<? super DexClassAndField> consumer);
15
16 void forEachClassMethod(Consumer<? super DexClassAndMethod> consumer);
17
18 MethodCollection getMethodCollection();
19
Christoffer Quist Adamsen306f0b32021-02-15 16:08:22 +010020 ClassReference getClassReference();
21
Christoffer Quist Adamsen48877022021-02-15 14:30:31 +010022 DexType getType();
23
Christoffer Quist Adamsen840e63d2021-03-04 15:27:10 +010024 boolean isInterface();
25
Christoffer Quist Adamsen306f0b32021-02-15 16:08:22 +010026 @Override
27 default boolean isClass() {
28 return true;
29 }
30
Christoffer Quist Adamsen48877022021-02-15 14:30:31 +010031 boolean isClasspathClass();
32
33 DexClasspathClass asClasspathClass();
34
35 boolean isLibraryClass();
36
37 DexLibraryClass asLibraryClass();
Christoffer Quist Adamsen48877022021-02-15 14:30:31 +010038}