src/share/classes/com/sun/tools/classfile/CharacterRangeTable_attribute.java

Wed, 02 Jul 2008 12:56:02 -0700

author
xdono
date
Wed, 02 Jul 2008 12:56:02 -0700
changeset 54
eaf608c64fec
parent 46
7708bd6d800d
child 339
85b317ac8a0c
permissions
-rw-r--r--

6719955: Update copyright year
Summary: Update copyright year for files that have been modified in 2008
Reviewed-by: ohair, tbell

jjg@46 1 /*
xdono@54 2 * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
jjg@46 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@46 4 *
jjg@46 5 * This code is free software; you can redistribute it and/or modify it
jjg@46 6 * under the terms of the GNU General Public License version 2 only, as
jjg@46 7 * published by the Free Software Foundation. Sun designates this
jjg@46 8 * particular file as subject to the "Classpath" exception as provided
jjg@46 9 * by Sun in the LICENSE file that accompanied this code.
jjg@46 10 *
jjg@46 11 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@46 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@46 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@46 14 * version 2 for more details (a copy is included in the LICENSE file that
jjg@46 15 * accompanied this code).
jjg@46 16 *
jjg@46 17 * You should have received a copy of the GNU General Public License version
jjg@46 18 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@46 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@46 20 *
jjg@46 21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
jjg@46 22 * CA 95054 USA or visit www.sun.com if you need additional information or
jjg@46 23 * have any questions.
jjg@46 24 */
jjg@46 25
jjg@46 26 package com.sun.tools.classfile;
jjg@46 27
jjg@46 28 import java.io.IOException;
jjg@46 29
jjg@46 30 /**
jjg@46 31 * <p><b>This is NOT part of any API supported by Sun Microsystems. If
jjg@46 32 * you write code that depends on this, you do so at your own risk.
jjg@46 33 * This code and its internal interfaces are subject to change or
jjg@46 34 * deletion without notice.</b>
jjg@46 35 */
jjg@46 36 public class CharacterRangeTable_attribute extends Attribute {
jjg@46 37 public static final int CRT_STATEMENT = 0x0001;
jjg@46 38 public static final int CRT_BLOCK = 0x0002;
jjg@46 39 public static final int CRT_ASSIGNMENT = 0x0004;
jjg@46 40 public static final int CRT_FLOW_CONTROLLER = 0x0008;
jjg@46 41 public static final int CRT_FLOW_TARGET = 0x0010;
jjg@46 42 public static final int CRT_INVOKE = 0x0020;
jjg@46 43 public static final int CRT_CREATE = 0x0040;
jjg@46 44 public static final int CRT_BRANCH_TRUE = 0x0080;
jjg@46 45 public static final int CRT_BRANCH_FALSE = 0x0100;
jjg@46 46
jjg@46 47 CharacterRangeTable_attribute(ClassReader cr, int name_index, int length) throws IOException {
jjg@46 48 super(name_index, length);
jjg@46 49 int character_range_table_length = cr.readUnsignedShort();
jjg@46 50 character_range_table = new Entry[character_range_table_length];
jjg@46 51 for (int i = 0; i < character_range_table_length; i++)
jjg@46 52 character_range_table[i] = new Entry(cr);
jjg@46 53 }
jjg@46 54
jjg@46 55 public CharacterRangeTable_attribute(ConstantPool constant_pool, Entry[] character_range_table)
jjg@46 56 throws ConstantPoolException {
jjg@46 57 this(constant_pool.getUTF8Index(Attribute.CharacterRangeTable), character_range_table);
jjg@46 58 }
jjg@46 59
jjg@46 60 public CharacterRangeTable_attribute(int name_index, Entry[] character_range_table) {
jjg@46 61 super(name_index, character_range_table.length * Entry.length());
jjg@46 62 this.character_range_table = character_range_table;
jjg@46 63 }
jjg@46 64
jjg@46 65 public <R, D> R accept(Visitor<R, D> visitor, D data) {
jjg@46 66 return visitor.visitCharacterRangeTable(this, data);
jjg@46 67 }
jjg@46 68
jjg@46 69 public final Entry[] character_range_table;
jjg@46 70
jjg@46 71 public static class Entry {
jjg@46 72 Entry(ClassReader cr) throws IOException {
jjg@46 73 start_pc = cr.readUnsignedShort();
jjg@46 74 end_pc = cr.readUnsignedShort();
jjg@46 75 character_range_start = cr.readInt();
jjg@46 76 character_range_end = cr.readInt();
jjg@46 77 flags = cr.readUnsignedShort();
jjg@46 78 }
jjg@46 79
jjg@46 80 public static int length() {
jjg@46 81 return 14;
jjg@46 82 }
jjg@46 83
jjg@46 84 public final int start_pc;
jjg@46 85 public final int end_pc;
jjg@46 86 public final int character_range_start;
jjg@46 87 public final int character_range_end;
jjg@46 88 public final int flags;
jjg@46 89 };
jjg@46 90 }

mercurial