All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lt.lang.implicit.RichBool Maven / Gradle / Ivy

Go to download

The latte-lang compiler project, which contains compiler and runtime required library.

The newest version!
package lt.lang.implicit;

import lt.runtime.LtRuntime;

/**
 * rich Bool
 */
public class RichBool {
        private Boolean b;

        public RichBool(Boolean b) {
                this.b = b;
        }

        public boolean logicNot() throws Throwable {
                return !b;
        }

        /*
         * ============
         *     add
         * ============
         */

        // none

        /*
         * ============
         *     and
         * ============
         */

        public boolean and(Boolean b) {
                return this.b & b;
        }

        public boolean and(Object o) throws Throwable {
                return this.b & LtRuntime.castToBool(o);
        }

        /*
         * ============
         *     or
         * ============
         */

        public boolean or(Boolean b) {
                return this.b | b;
        }

        public boolean or(Object o) throws Throwable {
                return this.b | LtRuntime.castToBool(o);
        }

        /*
         * ============
         *    divide
         * ============
         */

        // none

        /*
         * ============
         *      ge
         * ============
         */

        // none

        /*
         * ============
         *      gt
         * ============
         */

        // none

        /*
         * ============
         *      le
         * ============
         */

        // none

        /*
         * ============
         *      lt
         * ============
         */

        // none

        /*
         * ============
         *   multiply
         * ============
         */

        // none

        /*
         * ============
         *   remainder
         * ============
         */

        // none

        /*
         * ============
         *   shiftLeft
         * ============
         */

        // none

        /*
         * ============
         *  shiftRight
         * ============
         */

        // none

        /*
         * ============
         *   subtract
         * ============
         */

        // none

        /*
         * ====================
         *  unsignedShiftRight
         * ====================
         */

        // none

        /*
         * ============
         *     xor
         * ============
         */

        public boolean xor(Boolean b) throws Throwable {
                return this.b ^ b;
        }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy