Java Long Number Create toLong(boolean b)

Here you can find the source of toLong(boolean b)

Description

Return the long value of the boolean.
If boolean is TRUE this will return 1, else 0.

License

Open Source License

Parameter

Parameter Description
b The boolean

Return

1, if boolean is TRUE; 0, otherwise

Declaration

public static long toLong(boolean b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from ww w.j ava  2s . c  om
     * Return the long value of the boolean.<br/>
     * If boolean is TRUE this will return 1, else 0.
     *
     * @param b
     *            The boolean
     * @return 1, if boolean is TRUE; 0, otherwise
     */
    public static long toLong(boolean b) {
        if (b) {
            return 1L;
        }
        return 0L;
    }
}

Related

  1. convertLongPriceToString(long price)
  2. convertLongtoMultiByte(long val)
  3. fromLong(byte[] buffer, int pos, long l)
  4. fromLong(long value, byte[] arr, int offset)
  5. fromLongLE(byte src[], int offset, int numBytes)
  6. toLong(boolean... a)
  7. toLong(byte b)
  8. toLong(byte byte7, byte byte6, byte byte5, byte byte4, byte byte3, byte byte2, byte byte1, byte byte0)
  9. toLong(byte... b)