Class SingleScalar

    • Method Detail

      • valid_types_static

        public static final boolean valid_types_static​(VarInfo[] vis)
        Returns whether or not the specified types are valid for unary scalar. (Static version of method.)
      • valid_types

        public final boolean valid_types​(VarInfo[] vis)
        Description copied from class: Invariant
        Returns whether or not the invariant is valid over the basic types in vis. This only checks basic types (scalar, string, array, etc) and should match the basic superclasses of invariant (SingleFloat, SingleScalarSequence, ThreeScalar, etc). More complex checks that depend on variable details can be implemented in instantiate_ok().
        Specified by:
        valid_types in class Invariant
        See Also:
        Invariant.instantiate_ok(VarInfo[])
      • add_unmodified

        public InvariantStatus add_unmodified​(long value,
                                              int count)
        By default, do nothing if the value hasn't been seen yet. Subclasses can override this.
      • check_modified

        public abstract InvariantStatus check_modified​(long value,
                                                       int count)
        Presents a sample to the invariant. Returns whether the sample is consistent with the invariant. Does not change the state of the invariant.
        Parameters:
        count - how many identical samples were observed in a row. For example, three calls to check_modified with a count parameter of 1 is equivalent to one call to check_modified with a count parameter of 3.
        Returns:
        whether or not the sample is consistent with the invariant