001package daikon.derive;
002
003import daikon.ValueTuple;
004import org.checkerframework.checker.interning.qual.Interned;
005import org.checkerframework.checker.nullness.qual.Nullable;
006import org.plumelib.util.Intern;
007
008/**
009 * This is a temporary structure for grouping elements to be returned from computeValueAndModified,
010 * not for permanent storage.
011 */
012public final class ValueAndModified {
013  // The constructor checks that it is interned, contradicting the comment.
014  public @Nullable @Interned Object value; // not necessarily an interned value
015  public int modified;
016
017  public static final ValueAndModified MISSING_NONSENSICAL =
018      new ValueAndModified(null, ValueTuple.MISSING_NONSENSICAL);
019
020  public static final ValueAndModified MISSING_FLOW =
021      new ValueAndModified(null, ValueTuple.MISSING_FLOW);
022
023  public ValueAndModified(@Nullable @Interned Object val, int mod) {
024    assert Intern.isInterned(val);
025    // Type should be Long, not Integer
026    assert !(val instanceof Integer);
027    value = val;
028    modified = mod;
029  }
030}