1 package com.sun.org.apache.bcel.internal.classfile; 2 3 56 57 import com.sun.org.apache.bcel.internal.Constants; 58 import java.io.*; 59 60 69 public final class ConstantLong extends Constant implements ConstantObject { 70 private long bytes; 71 72 75 public ConstantLong(long bytes) 76 { 77 super(Constants.CONSTANT_Long); 78 this.bytes = bytes; 79 } 80 83 public ConstantLong(ConstantLong c) { 84 this(c.getBytes()); 85 } 86 92 ConstantLong(DataInputStream file) throws IOException 93 { 94 this(file.readLong()); 95 } 96 103 public void accept(Visitor v) { 104 v.visitConstantLong(this); 105 } 106 112 public final void dump(DataOutputStream file) throws IOException 113 { 114 file.writeByte(tag); 115 file.writeLong(bytes); 116 } 117 120 public final long getBytes() { return bytes; } 121 124 public final void setBytes(long bytes) { 125 this.bytes = bytes; 126 } 127 130 public final String toString() { 131 return super.toString() + "(bytes = " + bytes + ")"; 132 } 133 134 136 public Object getConstantValue(ConstantPool cp) { 137 return new Long (bytes); 138 } 139 } 140 | Popular Tags |