src/main/java/com/osiris/maths/binary/Bits.java
/**
     * Converts the current number/{@link #bits}
     * to the new state and returns the new number.
     * @return this object for chaining.
     */
Converts the current number/ #bits
to the new state and returns the new number.
@return this object for chaining.
Converts the current number / #bits to the new state and returns the new number . @return this object for chaining .
public Bits to(State newState, boolean printSteps) {
        if(printSteps) System.out.println("Converting from "+this.state+" to "+newState+".");
        switch (newState) {
            case COMPLEMENT_1:
                if (state == State.UNMODIFIED) {
                    toComplement1(this, printSteps);
                } else if (state == State.COMPLEMENT_1) {
                } else if (state == State.COMPLEMENT_2) {
                    revertComplement2(this);
                }
                this.state = State.COMPLEMENT_1;
                break;
            case COMPLEMENT_2:
                if (state == State.UNMODIFIED) {
                    toComplement1(this, printSteps);
                    toComplement2(this, printSteps);
                } else if (state == State.COMPLEMENT_1) {
                    toComplement2(this, printSteps);
                } else if (state == State.COMPLEMENT_2) {}
                this.state = State.COMPLEMENT_2;
                break;
            default: 
                if (state == State.UNMODIFIED) {
                } else if (state == State.COMPLEMENT_1) {
                    revertComplement1(this);
                } else if (state == State.COMPLEMENT_2) {
                    revertComplement2(this);
                    revertComplement1(this);
                }
                this.state = State.UNMODIFIED;
                break;
        }
        return this;
    }
public Bits to ( State newState , boolean printSteps ) { if ( printSteps ) System . out . println ( "Converting from " + this . state + " to " + newState + "." ) ; switch ( newState ) { case COMPLEMENT_1 : if ( state == State . UNMODIFIED ) { toComplement1 ( this , printSteps ) ; } else if ( state == State . COMPLEMENT_1 ) { } else if ( state == State . COMPLEMENT_2 ) { revertComplement2 ( this ) ; } this . state = State . COMPLEMENT_1 ; break ; case COMPLEMENT_2 : if ( state == State . UNMODIFIED ) { toComplement1 ( this , printSteps ) ; toComplement2 ( this , printSteps ) ; } else if ( state == State . COMPLEMENT_1 ) { toComplement2 ( this , printSteps ) ; } else if ( state == State . COMPLEMENT_2 ) { } this . state = State . COMPLEMENT_2 ; break ; default : if ( state == State . UNMODIFIED ) { } else if ( state == State . COMPLEMENT_1 ) { revertComplement1 ( this ) ; } else if ( state == State . COMPLEMENT_2 ) { revertComplement2 ( this ) ; revertComplement1 ( this ) ; } this . state = State . UNMODIFIED ; break ; } return this ; }
Converts the current number/{@link #bits}
 to the new state and returns the new number.
Converts the current number / { @link #bits } to the new state and returns the new number .
// case UNMODIFIED