1 7 8 package org.gjt.jclasslib.structures.constants; 9 10 import org.gjt.jclasslib.structures.CPInfo; 11 import org.gjt.jclasslib.structures.InvalidByteCodeException; 12 13 import java.io.*; 14 15 21 public abstract class ConstantLargeNumeric extends CPInfo { 22 23 24 public static final int SIZE = 8; 25 26 27 protected int highBytes; 28 29 protected int lowBytes; 30 31 35 public int getHighBytes() { 36 return highBytes; 37 } 38 39 43 public void setHighBytes(int highBytes) { 44 this.highBytes = highBytes; 45 } 46 47 51 public int getLowBytes() { 52 return lowBytes; 53 } 54 55 59 public void setLowBytes(int lowBytes) { 60 this.lowBytes = lowBytes; 61 } 62 63 68 public String getFormattedHighBytes() { 69 return printBytes(highBytes); 70 } 71 72 77 public String getFormattedLowBytes() { 78 return printBytes(lowBytes); 79 } 80 81 public void read(DataInput in) 82 throws InvalidByteCodeException, IOException { 83 84 highBytes = in.readInt(); 85 lowBytes = in.readInt(); 86 } 87 88 public void write(DataOutput out) 89 throws InvalidByteCodeException, IOException { 90 91 out.writeInt(highBytes); 92 out.writeInt(lowBytes); 93 } 94 95 public boolean equals(Object object) { 96 if (!(object instanceof ConstantLargeNumeric)) { 97 return false; 98 } 99 ConstantLargeNumeric constantLargeNumeric = (ConstantLargeNumeric)object; 100 return super.equals(object) && 101 constantLargeNumeric.highBytes == highBytes && 102 constantLargeNumeric.lowBytes == lowBytes; 103 } 104 105 public int hashCode() { 106 return super.hashCode() ^ highBytes ^ lowBytes; 107 } 108 109 } 110 | Popular Tags |