View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
5    */
6   package mockit.asm.constantPool;
7   
8   import static mockit.asm.jvmConstants.ConstantPoolTypes.DOUBLE;
9   
10  import edu.umd.cs.findbugs.annotations.NonNull;
11  
12  import org.checkerframework.checker.index.qual.NonNegative;
13  
14  public final class DoubleItem extends LongValueItem {
15      public DoubleItem(@NonNegative int index) {
16          super(index);
17          type = DOUBLE;
18      }
19  
20      DoubleItem(@NonNegative int index, @NonNull DoubleItem item) {
21          super(index, item);
22      }
23  
24      /**
25       * Sets the value of this item.
26       */
27      public void set(double value) {
28          long longValue = Double.doubleToRawLongBits(value);
29          setValue(longValue);
30      }
31  }