001package daikon.inv.unary; 002 003import daikon.VarInfo; 004import org.checkerframework.checker.initialization.qual.UnknownInitialization; 005import org.checkerframework.checker.lock.qual.GuardSatisfied; 006 007// An interface satisfied by OneOfScalar, OneOfString, OneOfSequence, and 008// OneOfStringSequence. 009// The variable takes on exactly one value. 010public interface OneOf { 011 /** The number of elements in the OneOf invariant. */ 012 public int num_elts(); 013 014 /** 015 * The single value represented by the OneOf invariant. Throws an error if not exactly one value 016 * is represented by this. 017 */ 018 public Object elt(); 019 020 public VarInfo var(@GuardSatisfied @UnknownInitialization(OneOf.class) OneOf this); 021}