< prev index next >

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FCONST.java

Print this page


   1 /*
   2  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.bcel.internal.generic;
  22 
  23 /**
  24  * FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
  25  *
  26  * <PRE>Stack: ... -&gt; ..., </PRE>
  27  *
  28  * @version $Id$
  29  * @LastModified: Jun 2019
  30  */
  31 public class FCONST extends Instruction implements ConstantPushInstruction {
  32 
  33     private float value;
  34 
  35 
  36     /**
  37      * Empty constructor needed for Instruction.readInstruction.
  38      * Not to be used otherwise.
  39      */
  40     FCONST() {
  41     }
  42 
  43 
  44     public FCONST(final float f) {
  45         super(com.sun.org.apache.bcel.internal.Const.FCONST_0, (short) 1);
  46         if (f == 0.0) {
  47             super.setOpcode(com.sun.org.apache.bcel.internal.Const.FCONST_0);
  48         } else if (f == 1.0) {
  49             super.setOpcode(com.sun.org.apache.bcel.internal.Const.FCONST_1);


   1 /*
   2  * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.bcel.internal.generic;
  22 
  23 /**
  24  * FCONST - Push 0.0, 1.0 or 2.0, other values cause an exception
  25  *
  26  * <PRE>Stack: ... -&gt; ..., </PRE>
  27  *
  28  * @LastModified: Jan 2020

  29  */
  30 public class FCONST extends Instruction implements ConstantPushInstruction {
  31 
  32     private float value;
  33 
  34 
  35     /**
  36      * Empty constructor needed for Instruction.readInstruction.
  37      * Not to be used otherwise.
  38      */
  39     FCONST() {
  40     }
  41 
  42 
  43     public FCONST(final float f) {
  44         super(com.sun.org.apache.bcel.internal.Const.FCONST_0, (short) 1);
  45         if (f == 0.0) {
  46             super.setOpcode(com.sun.org.apache.bcel.internal.Const.FCONST_0);
  47         } else if (f == 1.0) {
  48             super.setOpcode(com.sun.org.apache.bcel.internal.Const.FCONST_1);


< prev index next >