FuncPtgpublic class FuncPtg extends AbstractFunctionPtg
Fields Summary |
---|
public static final byte | sid | public static final int | SIZE | private int | numParams |
Constructors Summary |
---|
private FuncPtg()FuncPtgs are defined to be 4 bytes but the actual FuncPtg uses only 2 bytes.
If we have leftOvers that are read from the file we should serialize them back out.
If the leftovers are removed, a prompt "Warning: Data may have been lost occurs in Excel"
//protected byte[] leftOvers = null;
//Required for clone methods
| public FuncPtg(RecordInputStream in)Creates new function pointer from a byte array
usually called while reading an excel file.
//field_1_num_args = data[ offset + 0 ];
field_2_fnc_index = in.readShort();
/*
if (data.length - offset > 2) { //save left overs if there are any
leftOvers = new byte[2];
System.arraycopy(data, offset+1, leftOvers, 0, leftOvers.length);
}
*/
try {
numParams = ( (Integer)functionData[field_2_fnc_index][2]).intValue();
} catch (NullPointerException npe) {
numParams=0;
}
|
Methods Summary |
---|
public java.lang.Object | clone()
FuncPtg ptg = new FuncPtg();
//ptg.field_1_num_args = field_1_num_args;
ptg.field_2_fnc_index = field_2_fnc_index;
ptg.setClass(ptgClass);
return ptg;
| public int | getNumberOfOperands()
return numParams;
| public int | getSize()
return SIZE;
| public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer
.append("<FunctionPtg>").append("\n")
.append(" numArgs(internal)=").append(this.numParams).append("\n")
.append(" name =").append(lookupName(field_2_fnc_index)).append("\n")
.append(" field_2_fnc_index=").append(field_2_fnc_index).append("\n")
.append("</FunctionPtg>");
return buffer.toString();
| public void | writeBytes(byte[] array, int offset)
array[offset+0]= (byte) (sid + ptgClass);
//array[offset+1]=field_1_num_args;
LittleEndian.putShort(array,offset+1,field_2_fnc_index);
/**if (leftOvers != null) {
System.arraycopy(leftOvers, 0, array, offset+2, leftOvers.length);
}**/
|
|