View Javadoc

1   /*
2    * Copyright 2005 The Apache Software Foundation.
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  
17  
18  package org.apache.jdo.impl.enhancer.classfile;
19  
20  import java.io.*;
21  
22  /***
23   * Class representing a reference to an interface method of some class
24   * in the constant pool of a class file.
25   */
26  public class ConstInterfaceMethodRef extends ConstBasicMemberRef {
27      /* The tag value associated with ConstDouble */
28      public static final int MyTag = CONSTANTInterfaceMethodRef;
29  
30      /* public accessors */
31  
32      /***
33       * The tag of this constant entry
34       */
35      public int tag () { return MyTag; }
36  
37      /***
38       * A printable representation
39       */
40      public String toString () {
41          return "CONSTANTInterfaceMethodRef(" + indexAsString() + "): " + 
42              super.toString();
43      }
44  
45      /* package local methods *//package-summary/html">class="comment"> package local methods *//package-summary.html">/* package local methods *//package-summary.html">class="comment"> package local methods */
46  
47      ConstInterfaceMethodRef (ConstClass cname, ConstNameAndType NT) {
48          super(cname, NT);
49      }
50  
51      ConstInterfaceMethodRef (int cnameIndex, int NT_index) {
52          super(cnameIndex, NT_index);
53      }
54  
55      static ConstInterfaceMethodRef read (DataInputStream input) 
56          throws IOException {
57          int cname = input.readUnsignedShort();
58          int NT = input.readUnsignedShort();
59          return new ConstInterfaceMethodRef (cname, NT);
60      }
61  }