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 edu.umd.cs.findbugs.annotations.NonNull;
9   
10  import org.checkerframework.checker.index.qual.NonNegative;
11  
12  class IntValueItem extends Item {
13      /**
14       * Value of this item, for an integer item.
15       */
16      int intVal;
17  
18      IntValueItem(@NonNegative int index) {
19          super(index);
20      }
21  
22      IntValueItem(@NonNegative int index, @NonNull IntValueItem item) {
23          super(index, item);
24          intVal = item.intVal;
25      }
26  
27      public final void setValue(int value) {
28          intVal = value;
29          setHashCode(value);
30      }
31  
32      @Override
33      final boolean isEqualTo(@NonNull Item item) {
34          return ((IntValueItem) item).intVal == intVal;
35      }
36  }