OpcodeInfo.java revision 16829a7fc923d557b7c0cd951f0251b9d53a45aa
1/*
2 * Copyright (C) 2010 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
17package dalvik.bytecode;
18
19/**
20 * Information about Dalvik opcodes.
21 */
22public final class OpcodeInfo {
23    /**
24     * The maximum possible value of a Dalvik opcode.
25     *
26     * <p><b>Note:</b>: This is constant in any given VM incarnation,
27     * but it is subject to change over time, so it is not appropriate
28     * to represent as a compile-time constant value.</p>
29     */
30    public static final int MAXIMUM_VALUE = getMaximumValue();
31
32    /**
33     * Gets the maximum possible value of a Dalvik opcode.
34     *
35     * @see #MAXIMUM_VALUE
36     *
37     * @return the maximum possible value of a Dalvik opcode
38     */
39    private static int getMaximumValue() {
40        // TODO: Make this constant be generated by opcode-gen.
41        return 255;
42    }
43
44    /**
45     * This class is not instantiable.
46     */
47    private OpcodeInfo() {
48        // This space intentionally left blank.
49    }
50}
51