areaNPtg.isFirstColRelative(),
areaNPtg.isLastColRelative());
ptg.setClass(originalOperandClass);
- } else if (ptg instanceof OperandPtg<?>) {
+ } else if (ptg instanceof OperandPtg) {
// Any subclass of OperandPtg is mutable, so it's safest to not share these instances.
- ptg = ((OperandPtg<?>) ptg).copy();
+ ptg = ((OperandPtg) ptg).copy();
} else {
// all other Ptgs are immutable and can be shared
}
*/
private int _unknownPreFormulaInt;
/** expect tRef, tRef3D, tArea, tArea3D or tName */
- private OperandPtg<?> _linkRefPtg;
+ private OperandPtg _linkRefPtg;
/**
* Not clear if needed . Excel seems to be OK if this byte is not present.
* Value is often the same as the earlier firstColumn byte. */
throw new RecordFormatException("Read " + ptgs.length
+ " tokens but expected exactly 1");
}
- _linkRefPtg = (OperandPtg<?>) ptgs[0];
+ _linkRefPtg = (OperandPtg) ptgs[0];
if (in.remaining() > 0) {
_unknownPostFormulaByte = Byte.valueOf(in.readByte());
} else {
* @author avik
* @author Jason Height (jheight at chariot dot net dot au)
*/
-public final class Area3DPtg extends AreaPtgBase<Area3DPtg> implements WorkbookDependentFormula, ExternSheetReferenceToken {
+public final class Area3DPtg extends AreaPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken {
public final static byte sid = 0x3b;
private final static int SIZE = 11; // 10 + 1 for Ptg
* @author andy
* @author Jason Height (jheight at chariot dot net dot au)
*/
-public abstract class AreaPtgBase<Z extends AreaPtgBase<Z>> extends OperandPtg<Z> implements AreaI {
+public abstract class AreaPtgBase extends OperandPtg implements AreaI {
/**
* TODO - (May-2008) fix subclasses of AreaPtg 'AreaN~' which are used in shared formulas.
* see similar comment in ReferencePtg
package org.apache.poi.hssf.record.formula;
-
/**
* @author Josh Micich
*/
-public abstract class OperandPtg<Y extends OperandPtg<Y>> extends Ptg implements Cloneable {
+public abstract class OperandPtg extends Ptg implements Cloneable {
/**
* All Operand {@link Ptg}s are classified ('relative', 'value', 'array')
public final boolean isBaseToken() {
return false;
}
- public final Y copy() {
+ public final OperandPtg copy() {
try {
- @SuppressWarnings("unchecked")
- Y result = (Y) clone();
- return result;
+ return (OperandPtg) clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
* @author Libin Roman (Vista Portal LDT. Developer)
* @author Jason Height (jheight at chariot dot net dot au)
*/
-public final class Ref3DPtg extends RefPtgBase<Ref3DPtg> implements WorkbookDependentFormula, ExternSheetReferenceToken {
+public final class Ref3DPtg extends RefPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken {
public final static byte sid = 0x3a;
private final static int SIZE = 7; // 6 + 1 for Ptg
* @author Andrew C. Oliver (acoliver@apache.org)
* @author Jason Height (jheight at chariot dot net dot au)
*/
-public abstract class RefPtgBase<Z extends RefPtgBase<Z>> extends OperandPtg<Z> {
+public abstract class RefPtgBase extends OperandPtg {
/** The row index - zero based unsigned 16 bit value */
private int field_1_row;
import org.apache.poi.hssf.record.formula.Area3DPtg;
import org.apache.poi.hssf.record.formula.MemFuncPtg;
import org.apache.poi.hssf.record.formula.NameXPtg;
+import org.apache.poi.hssf.record.formula.OperandPtg;
import org.apache.poi.hssf.record.formula.Ptg;
import org.apache.poi.hssf.record.formula.Ref3DPtg;
import org.apache.poi.hssf.record.formula.SheetNameFormatter;
Ptg ptg = ptgs[i];
if (ptg instanceof Area3DPtg) {
- Area3DPtg a3p = ((Area3DPtg) ptg).copy();
+ Area3DPtg a3p = (Area3DPtg) ((OperandPtg) ptg).copy();
a3p.setExternSheetIndex(newExtSheetIx);
ptgs[i] = a3p;
} else if (ptg instanceof Ref3DPtg) {
- Ref3DPtg r3p = ((Ref3DPtg) ptg).copy();
+ Ref3DPtg r3p = (Ref3DPtg) ((OperandPtg) ptg).copy();
r3p.setExternSheetIndex(newExtSheetIx);
ptgs[i] = r3p;
}