2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package org.apidesign.vm4brwsr;
9 * @author Jaroslav Tulach <jtulach@netbeans.org>
11 public class Instance {
16 protected byte b = (byte)31;
21 public Instance(int i, double d) {
25 public byte getByte() {
29 public void setByte(byte b) {
32 public static double defaultDblValue() {
33 Instance create = new Instance();
37 public static byte assignedByteValue() {
38 return new Instance().b;
40 public static double magicOne() {
41 Instance i = new Instance(10, 3.3d);
43 return (i.i - i.b) * i.d;
45 public static int virtualBytes() {
46 Instance i = new InstanceSub(7, 2.2d);
47 i.setByte((byte)0x0a);
48 Instance i2 = new Instance(3, 333.0d);
50 return i.getByte() + i2.getByte();
52 public static float interfaceBytes() {
53 GetByte i = new InstanceSub(7, 2.2d);
56 public static boolean instanceOf(boolean sub) {
57 Instance i = createInstance(sub);
58 return isInstanceSubOf(i);
60 private static boolean isInstanceSubOf(Instance instance) {
61 return instance instanceof InstanceSub;
63 private static Instance createInstance(boolean sub) {
64 return sub ? new InstanceSub(3, 0) : new Instance();
66 private static boolean isNull() {
67 return createInstance(true) == null;