package nl.tudelft.simulation.dsol.interpreter.classfile; import java.io.DataInput; import java.io.IOException; /** * A ConstantLong. *

* Copyright (c) 2002-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *

* @author Peter Jacobs * @author Alexander Verbraeck * @since 1.5 */ public class ConstantLong extends Constant { /** the value. */ private long bytes; /** * constructs a new ConstantLong. * @param constantPool Constant[]; the constantPool it is part of * @param inputStream DataInput; the inputstream to read from * @throws IOException on failure */ public ConstantLong(final Constant[] constantPool, final DataInput inputStream) throws IOException { this(constantPool, inputStream.readLong()); } /** * constructs a new ConstantLong. * @param constantPool Constant[]; the constantPool it is part of * @param bytes long; the bytes */ public ConstantLong(final Constant[] constantPool, final long bytes) { super(constantPool); this.bytes = bytes; } /** {@inheritDoc} */ @Override public int getTag() { return 5; } /** * returns the value. * @return long the value */ public long getValue() { return this.bytes; } /** {@inheritDoc} */ @Override public String toString() { return "ConstantLong[value=" + this.bytes + "]"; } }