Top Description Fields Constructors Methods
org.apache.poi.ss.formula.functions

public Class Bin2Dec

extends Fixed1ArgFunction
implements FreeRefFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
org.apache.poi.ss.formula.OperationEvaluationContext, org.apache.poi.ss.formula.eval.ErrorEval, .NumberEval, .OperandResolver, .RefEval, .ValueEval, org.apache.poi.util.StringUtil

Implementation for Excel Bin2Dec() function.

Syntax:
Bin2Dec (number)

Converts a binary number to decimal.

Number is the binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.

Remark If number is not a valid binary number, or if number contains more than 10 characters (10 bits), BIN2DEC returns the #NUM! error value.

Field Summary

Modifier and TypeField and Description
public static final FreeRefFunction

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueEval
public ValueEval
evaluate(ValueEval[]
the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
args
,
OperationEvaluationContext
primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
ec
)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

private int
private static String
Inherited from org.apache.poi.ss.formula.functions.Fixed1ArgFunction:
evaluate

Field Detail

instanceback to summary
public static final FreeRefFunction instance

Constructor Detail

Bin2Decback to summary
public Bin2Dec()

Method Detail

evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval numberVE)

Implements org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function1Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

Annotations
@Override
evaluateback to summary
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)

Implements org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

Parameters
args:ValueEval[]

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

the pre-evaluated arguments for this function. args is never null, nor are any of its elements.

ec:OperationEvaluationContext

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.

Returns:ValueEval

Doc from org.apache.poi.ss.formula.functions.FreeRefFunction.evaluate.

never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).

Annotations
@Override
getDecimalValueback to summary
private int getDecimalValue(String unsigned)
toggleBitsback to summary
private static String toggleBits(String s)