public final class Logical extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
BitAnd(int num1,
int num2)
Bitwise 'AND' operation of two numbers.
|
static long |
BitAnd(long num1,
long num2)
Bitwise 'AND' operation of two numbers.
|
static long |
BitCompress(String value)
Returns the long made from the string argument, which contains a binary representation of "1"s and "0"s.
|
static String |
BitExpand(long value)
Returns a string containing the binary representation in "1"s and "0"s of the given long.
|
static int |
BitOr(int num1,
int num2)
Bitwise 'OR' operation of two numbers.
|
static long |
BitOr(long num1,
long num2)
Bitwise 'OR' operation of two numbers.
|
static int |
BitXor(int num1,
int num2)
Bitwise 'XOR' operation of two numbers.
|
static long |
BitXor(long num1,
long num2)
Bitwise 'XOR' operation of two numbers.
|
static int |
Not(double val)
Returns the complement of the logical value of an expression.
|
static int |
Not(float val)
Returns the complement of the logical value of an expression.
|
static int |
Not(int val)
Returns the complement of the logical value of an expression.
|
static int |
Not(long val)
Returns the complement of the logical value of an expression.
|
static int |
Not(String val)
Returns the complement of the logical value of the given string.
|
static long |
SetBit(long value,
int[] positions,
int bit)
Returns a long with specific bits set to a specific state.
|
public static long BitAnd(long num1,
long num2)
num1 - first number.num2 - second number.public static int BitAnd(int num1,
int num2)
num1 - first number.num2 - second number.public static long BitOr(long num1,
long num2)
num1 - first number.num2 - second number.public static int BitOr(int num1,
int num2)
num1 - first number.num2 - second number.public static long BitXor(long num1,
long num2)
num1 - first number.num2 - second number.public static int BitXor(int num1,
int num2)
num1 - first number.num2 - second number.public static int Not(double val)
val - expression result.public static int Not(String val)
val - string value.public static int Not(float val)
val - string value.public static int Not(int val)
val - string value.public static int Not(long val)
val - string value.public static long BitCompress(String value)
value - to be compressed.public static String BitExpand(long value)
value - to be expanded into '1' and '0' binary representation.public static long SetBit(long value,
int[] positions,
int bit)
value - to perform action on.positions - array of positions.bit - to be set. Either 1 or 0.Copyright © 2021 CDAP Licensed under the Apache License, Version 2.0.