Enum Conjunction

    • Enum Constant Detail

      • AND

        public static final Conjunction AND
        This conjunction is true if and only if all arguments are true.
      • OR

        public static final Conjunction OR
        This conjunction is true if and only if at least one argument is true.
      • NAND

        public static final Conjunction NAND
        This is the negation of AND. It is only true if at least one argument is false.
      • NOR

        public static final Conjunction NOR
        This is the negation of OR. It is only true if all arguments are false .
      • XOR

        public static final Conjunction XOR
        This conjunction is true if and only if two arguments differ (exactly one of two arguments if true).
    • Method Detail

      • values

        public static Conjunction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Conjunction c : Conjunction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Conjunction valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • eval

        public boolean eval​(boolean... arguments)
        This method evaluates this conjunction for the given boolean arguments.
        Parameters:
        arguments - are the boolean values to evaluate.
        Returns:
        the result of this conjunction applied to the given arguments.
      • evalSingle

        public abstract Boolean evalSingle​(boolean argument)
        Parameters:
        argument - is a literal boolean argument.
        Returns:
        Boolean.TRUE if eval(boolean...) will return true if any of the given arguments has the value of the given argument, Boolean.FALSE if eval(boolean...) will return false if any of the given arguments has the value of the given argument, null otherwise.
      • evalEmpty

        public abstract boolean evalEmpty()
        Returns:
        the result of eval(boolean...) for no argument (an empty argument array).
      • getSyntax

        public String getSyntax()
        Returns:
        the syntax used for technical representation (e.g. '&&' for AND).