📄 integervalue.cs
字号:
using System;
using Microsoft.Fawvw.Components.NExcel.ExcelCommon;
using Microsoft.Fawvw.Components.NExcel.Biff;
namespace Microsoft.Fawvw.Components.NExcel.Biff.Formula
{
/// <summary> A cell reference in a formula</summary>
class IntegerValue:NumberValue, ParsedThing
{
/// <summary> Gets the token representation of this item in RPN
///
/// </summary>
/// <returns> the bytes applicable to this formula
/// </returns>
override internal sbyte[] Bytes
{
get
{
sbyte[] data = new sbyte[3];
data[0] = Token.INTEGER.Code;
IntegerHelper.getTwoBytes((int) Value, data, 1);
return data;
}
}
/// <summary> The logger</summary>
private static Logger logger;
/// <summary> The value of this integer</summary>
private double Value;
/// <summary> Constructor</summary>
public IntegerValue()
{
}
/// <summary> Constructor for an integer value being read from a string</summary>
public IntegerValue(string s)
{
try
{
Value = System.Int32.Parse(s);
}
catch (System.FormatException e)
{
logger.warn(e, e);
Value = 0;
}
}
/// <summary> Reads the ptg data from the array starting at the specified position
///
/// </summary>
/// <param name="data">the RPN array
/// </param>
/// <param name="pos">the current position in the array, excluding the ptg identifier
/// </param>
/// <returns> the number of bytes read
/// </returns>
public override int read(sbyte[] data, int pos)
{
Value = IntegerHelper.getInt(data[pos], data[pos + 1]);
return 2;
}
/// <summary> Accessor for the value
///
/// </summary>
/// <returns> the value
/// </returns>
public override double getValue()
{
return Value;
}
static IntegerValue()
{
logger = Logger.getLogger(typeof(IntegerValue));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -