1 /*
2  * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 package sun.jvm.hotspot.types.basic;
26 
27 import sun.jvm.hotspot.debugger.*;
28 import sun.jvm.hotspot.types.*;
29 
30 /** This is an adapter class which allows delegation of operation to
31     another BasicCField; see, for example, BasicCharCFieldWrapper. */
32 
33 public class BasicFieldWrapper implements Field {
34   protected Field field;
35 
BasicFieldWrapper(Field field)36   public BasicFieldWrapper(Field field) {
37     this.field = field;
38   }
39 
getName()40   public String getName() {
41     return field.getName();
42   }
43 
getType()44   public Type getType() {
45     return field.getType();
46   }
47 
getSize()48   public long getSize() {
49     return field.getSize();
50   }
51 
isStatic()52   public boolean isStatic() {
53     return field.isStatic();
54   }
55 
getOffset()56   public long getOffset() throws WrongTypeException {
57     return field.getOffset();
58   }
59 
getStaticFieldAddress()60   public Address getStaticFieldAddress() throws WrongTypeException {
61     return field.getStaticFieldAddress();
62   }
63 
getJBoolean(Address addr)64   public boolean    getJBoolean (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
65     return field.getJBoolean(addr);
66   }
getJByte(Address addr)67   public byte       getJByte    (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
68     return field.getJByte(addr);
69   }
getJChar(Address addr)70   public char       getJChar    (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
71     return field.getJChar(addr);
72   }
getJDouble(Address addr)73   public double     getJDouble  (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
74     return field.getJDouble(addr);
75   }
getJFloat(Address addr)76   public float      getJFloat   (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
77     return field.getJFloat(addr);
78   }
getJInt(Address addr)79   public int        getJInt     (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
80     return field.getJInt(addr);
81   }
getJLong(Address addr)82   public long       getJLong    (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
83     return field.getJLong(addr);
84   }
getJShort(Address addr)85   public short      getJShort   (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
86     return field.getJShort(addr);
87   }
getCInteger(Address addr, CIntegerType type)88   public long       getCInteger (Address addr, CIntegerType type) throws UnmappedAddressException, UnalignedAddressException {
89     return field.getCInteger(addr, type);
90   }
getAddress(Address addr)91   public Address    getAddress  (Address addr) throws UnmappedAddressException, UnalignedAddressException {
92     return field.getAddress(addr);
93   }
getOopHandle(Address addr)94   public OopHandle  getOopHandle(Address addr)
95     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
96     return field.getOopHandle(addr);
97   }
getNarrowOopHandle(Address addr)98   public OopHandle  getNarrowOopHandle(Address addr)
99     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
100     return field.getNarrowOopHandle(addr);
101   }
102 
getJBoolean()103   public boolean    getJBoolean () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
104     return field.getJBoolean();
105   }
getJByte()106   public byte       getJByte    () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
107     return field.getJByte();
108   }
getJChar()109   public char       getJChar    () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
110     return field.getJChar();
111   }
getJDouble()112   public double     getJDouble  () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
113     return field.getJDouble();
114   }
getJFloat()115   public float      getJFloat   () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
116     return field.getJFloat();
117   }
getJInt()118   public int        getJInt     () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
119     return field.getJInt();
120   }
getJLong()121   public long       getJLong    () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
122     return field.getJLong();
123   }
getJShort()124   public short      getJShort   () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
125     return field.getJShort();
126   }
getCInteger(CIntegerType type)127   public long       getCInteger (CIntegerType type) throws UnmappedAddressException, UnalignedAddressException {
128     return field.getCInteger(type);
129   }
getAddress()130   public Address    getAddress  () throws UnmappedAddressException, UnalignedAddressException {
131     return field.getAddress();
132   }
getOopHandle()133   public OopHandle  getOopHandle()
134     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
135     return field.getOopHandle();
136   }
getNarrowOopHandle()137   public OopHandle  getNarrowOopHandle()
138     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
139     return field.getNarrowOopHandle();
140   }
141 }
142