* <p>The method is called by POI's eventing API for each file in the
* origin POIFS.</p>
*/
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event) {
/* The following declarations are shortcuts for accessing the
* "event" object. */
static class MyPOIFSReaderListener implements POIFSReaderListener
{
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
PropertySet ps = null;
static class MyPOIFSReaderListener implements POIFSReaderListener
{
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
SummaryInformation si = null;
* <p>The method is called by POI's eventing API for each file in the
* origin POIFS.</p>
*/
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
/* The following declarations are shortcuts for accessing the
* Main HSSFListener method, processes events, and outputs the
* CSV as the file is processed.
*/
- public void processRecord(Record record) {
+ @Override
+ public void processRecord(Record record) {
int thisRow = -1;
int thisColumn = -1;
String thisStr = null;
* This method listens for incoming records and handles them as required.
* @param record The record that was found while reading.
*/
+ @Override
public void processRecord(Record record)
{
switch (record.getSid())
}
}
+ @Override
public void close() throws IOException {
wb.close();
}
this.selected = selected;
}
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
+ @Override
+public void paintBorder(Component c, Graphics g, int x, int y, int width,
int height) {
Color oldColor = g.getColor();
throw new RuntimeException("Unexpected Case");
}
- public StringBuffer format(Object obj,
+ @Override
+public StringBuffer format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos) {
if (obj instanceof Number) {
throw new IllegalArgumentException("Can only handle Numbers");
}
- public Object parseObject(String source,
+ @Override
+public Object parseObject(String source,
ParsePosition status) {
//JMH TBD
return null;
}
- public Object parseObject(String source)
+ @Override
+public Object parseObject(String source)
throws ParseException {
//JMH TBD
return null;
}
- public Object clone() {
+ @Override
+public Object clone() {
//JMH TBD
return null;
}
this.sheet = sheet;
}
+ @Override
public int getSize() {
return sheet.getLastRowNum() + 1;
}
+ @Override
public Object getElementAt(int index) {
return Integer.toString(index+1);
}
setFont(header.getFont());
}
+ @Override
public Component getListCellRendererComponent( JList list,
Object value, int index, boolean isSelected, boolean cellHasFocus) {
Dimension d = getPreferredSize();
}
private class HeaderCellRenderer implements TableCellRenderer {
+ @Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
this.formulaDisplay = formulaDisplay;
}
+ @Override
public void valueChanged(ListSelectionEvent e) {
int row = getSelectedRow();
int col = getSelectedColumn();
}
addHierarchyListener(new HierarchyListener() {
- public void hierarchyChanged(HierarchyEvent e) {
+ @Override
+ public void hierarchyChanged(HierarchyEvent e) {
if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
Container changedParent = e.getChangedParent();
if (changedParent instanceof JViewport) {
*
* @return The cellEditable value
*/
- public boolean isCellEditable(java.util.EventObject e) {
+ @Override
+public boolean isCellEditable(java.util.EventObject e) {
if (e instanceof MouseEvent) {
return ((MouseEvent) e).getClickCount() >= 2;
}
}
- public boolean shouldSelectCell(EventObject anEvent) {
+ @Override
+public boolean shouldSelectCell(EventObject anEvent) {
return true;
}
}
- public boolean stopCellEditing() {
+ @Override
+public boolean stopCellEditing() {
System.out.println("Stop Cell Editing");
fireEditingStopped();
return true;
}
- public void cancelCellEditing() {
+ @Override
+public void cancelCellEditing() {
System.out.println("Cancel Cell Editing");
fireEditingCanceled();
}
- public void actionPerformed(ActionEvent e) {
+ @Override
+public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
stopCellEditing();
}
*
* @return The cellEditorValue value
*/
- public Object getCellEditorValue() {
+ @Override
+public Object getCellEditorValue() {
System.out.println("GetCellEditorValue");
//JMH Look at when this method is called. Should it return a HSSFCell?
return editor.getText();
*
* @return The tableCellEditorComponent value
*/
- public Component getTableCellEditorComponent(JTable table, Object value,
+ @Override
+public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected,
int row,
int column) {
this.wb = wb;
}
+ @Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
boolean isBorderSet = false;
return this;
}
+ @Override
public void validate() {}
+ @Override
public void revalidate() {}
+ @Override
public void repaint(long tm, int x, int y, int width, int height) {}
+ @Override
public void repaint(Rectangle r) { }
+ @Override
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
// Strings get interned...
if (propertyName=="text") {
}
}
+ @Override
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { }
/**
}
- public int getColumnCount() {
+ @Override
+public int getColumnCount() {
return this.maxcol+1;
}
- public Object getValueAt(int row, int col) {
+ @Override
+public Object getValueAt(int row, int col) {
HSSFRow r = st.getRow(row);
HSSFCell c = null;
if (r != null) {
}
return c;
}
- public int getRowCount() {
+ @Override
+public int getRowCount() {
return st.getLastRowNum() + 1;
}
- public Class<?> getColumnClass(int c) {
+ @Override
+public Class<?> getColumnClass(int c) {
return HSSFCell.class;
}
- public boolean isCellEditable(int rowIndex, int columnIndex) {
+ @Override
+public boolean isCellEditable(int rowIndex, int columnIndex) {
return true;
}
- public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ @Override
+public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (aValue != null)
System.out.println("SVTableModel.setValueAt. value type = "+aValue.getClass().getName());
else System.out.println("SVTableModel.setValueAt. value type = null");
}
/**Initialize the applet*/
- public void init() {
+ @Override
+public void init() {
try {
jbInit();
}
}
/**Start the applet*/
- public void start() {
+ @Override
+public void start() {
}
/**Stop the applet*/
- public void stop() {
+ @Override
+public void stop() {
}
/**Destroy the applet*/
- public void destroy() {
+ @Override
+public void destroy() {
}
/**Get Applet information*/
- public String getAppletInfo() {
+ @Override
+public String getAppletInfo() {
return "Applet Information";
}
/**Get parameter info*/
- public String[][] getParameterInfo() {
+ @Override
+public String[][] getParameterInfo() {
return null;
}
applet.filename = args[0];
Frame frame;
frame = new Frame() {
- protected void processWindowEvent(WindowEvent e) {
+ @Override
+ protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
- public synchronized void setTitle(String title) {
+ @Override
+ public synchronized void setTitle(String title) {
super.setTitle(title);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
}
return scroll;
}
- public void paint(Graphics g) {
+ @Override
+public void paint(Graphics g) {
//JMH I am only overriding this to get a picture of the time taken to paint
long start = System.currentTimeMillis();
super.paint(g);
}
}
+ @Override
public void mouseClicked(MouseEvent e) {
checkPopup(e);
}
+ @Override
public void mousePressed(MouseEvent e) {
checkPopup(e);
}
+ @Override
public void mouseReleased(MouseEvent e) {
checkPopup(e);
}
+ @Override
public void mouseEntered(MouseEvent e) {}
+ @Override
public void mouseExited(MouseEvent e) {}
}
super("Rename");
}
+ @Override
public void actionPerformed(ActionEvent e) {
int tabIndex = sheetPane.getSelectedIndex();
if (tabIndex != -1) {
super("Insert");
}
+ @Override
public void actionPerformed(ActionEvent e) {
//Create a new sheet then search for the sheet and make sure that the
//sheetPane shows it.
super("Delete");
}
+ @Override
public void actionPerformed(ActionEvent e) {
int tabIndex = sheetPane.getSelectedIndex();
if (tabIndex != -1) {
SViewerPanel p = new SViewerPanel(wb, true);
JFrame frame;
frame = new JFrame() {
+ @Override
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
+ @Override
public synchronized void setTitle(String title) {
super.setTitle(title);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
*
* @return The created stroke as a new shape.
*/
+ @Override
public Shape createStrokedShape(Shape s) {
// Use the first stroke to create an outline of the shape
Shape outline = stroke1.createStrokedShape(s);
}
/** {@inheritDoc} */
+ @Override
public float getLineWidth() {
return stroke1.getLineWidth() + 2 * stroke2.getLineWidth();
}
public class DocumentDescriptorRenderer extends DefaultTreeCellRenderer
{
+ @Override
public Component getTreeCellRendererComponent(final JTree tree,
final Object value,
final boolean selectedCell,
renderers = new HashMap<Class<?>,TreeCellRenderer>();
register(Object.class, new DefaultTreeCellRenderer()
{
+ @Override
public Component getTreeCellRendererComponent
(JTree tree, Object value, boolean selectedCell,
boolean expanded, boolean leaf, int row, boolean hasCellFocus)
*
* @see TreeCellRenderer#getTreeCellRendererComponent
*/
+ @Override
public Component getTreeCellRendererComponent
(final JTree tree, final Object value, final boolean selected,
final boolean expanded, final boolean leaf, final int row,
{
addWindowListener(new WindowAdapter()
{
+ @Override
public void windowClosing(WindowEvent e)
{
System.exit(0);
public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
{
+ @Override
public Component getTreeCellRendererComponent(final JTree tree,
final Object value,
final boolean selectedCell,
* reading. This method retrieves properties of the document and
* adds them to a tree model.</p>
*/
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
DocumentDescriptor d;
* file ends with either '.xls' or '.xlsx' and false will be
* returned in all other instances.
*/
+ @Override
public boolean accept(File file, String name) {
return(name.endsWith(".xls") || name.endsWith(".xlsx"));
}
*/
public class CalculateMortgage implements FreeRefFunction {
+ @Override
public ValueEval evaluate( ValueEval[] args, OperationEvaluationContext ec ) {
// verify that we have enough data
// don't care about the implementation, we are not interested in evaluation\r
// and this method will never be called\r
FreeRefFunction NA = new FreeRefFunction() {\r
+ @Override\r
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {\r
return ErrorEval.NA;\r
}\r
_functionsByName.put("BDS", NA);\r
}\r
\r
+ @Override\r
public FreeRefFunction findFunction(String name) {\r
return _functionsByName.get(name.toUpperCase(Locale.ROOT));\r
}\r
colors = wb.getCustomPalette();
}
+ @Override
public void colorStyles(CellStyle style, Formatter out) {
HSSFCellStyle cs = (HSSFCellStyle) style;
out.format(" /* fill pattern = %d */%n", cs.getFillPattern());
* @author Ken Arnold, Industrious Media LLC
*/
public class XSSFHtmlHelper implements HtmlHelper {
+ @Override
public void colorStyles(CellStyle style, Formatter out) {
XSSFCellStyle cs = (XSSFCellStyle) style;
styleColor(out, "background-color", cs.getFillForegroundXSSFColor());
}
}
+ @Override
public void startRow(int rowNum) {
// If there were gaps, output the missing rows
outputMissingRows(rowNum-currentRow-1);
currentCol = -1;
}
+ @Override
public void endRow(int rowNum) {
// Ensure the minimum number of columns
for (int i=currentCol; i<minColumns; i++) {
output.append('\n');
}
+ @Override
public void cell(String cellReference, String formattedValue,
XSSFComment comment) {
if (firstCellOfRow) {
}
}
+ @Override
public void headerFooter(String text, boolean isHeader, String tagName) {
// Skip, no headers or footers in CSV
}
this.sst = sst;
}
- public void startElement(String uri, String localName, String name,
+ @Override
+ public void startElement(String uri, String localName, String name,
Attributes attributes) throws SAXException {
// c => cell
if(name.equals("c")) {
lastContents = "";
}
- public void endElement(String uri, String localName, String name)
+ @Override
+ public void endElement(String uri, String localName, String name)
throws SAXException {
// Process the last contents as required.
// Do now, as characters() may be called more than once
}
}
- public void characters(char[] ch, int start, int length) throws SAXException { // NOSONAR
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException { // NOSONAR
lastContents += new String(ch, start, length);
}
}
InputStream sourceBytes = new FileInputStream("workbook.xlsx");
XSSFWorkbook workbook = new XSSFWorkbook(sourceBytes) {
/** Avoid DOM parse of large sheet */
+ @Override
public void parseSheet(java.util.Map<String,XSSFSheet> shIdMap, CTSheet ctSheet) {
if (!SHEET_TO_STREAM.equals(ctSheet.getName())) {
super.parseSheet(shIdMap, ctSheet);
private static SheetContentsHandler createSheetContentsHandler() {
return new SheetContentsHandler() {
+ @Override
public void startRow(int rowNum) {
}
+ @Override
public void headerFooter(String text, boolean isHeader, String tagName) {
}
+ @Override
public void endRow(int rowNum) {
}
+ @Override
public void cell(String cellReference, String formattedValue, XSSFComment comment) {
}
};
return precisionToUse;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
precisionToUse = 0 ;
wbUtil = wkbkUtil ;\r
}\r
\r
+ @Override\r
public void execute() throws BuildException {\r
log( "handling the workbook with class " + className, Project.MSG_INFO ) ;\r
try {\r
return cellValue;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
wbUtil.setDoubleValue(cellStr, cellValue ) ;
log( "set cell " + cellStr + " to value " + cellValue + " as double.", Project.MSG_DEBUG ) ;
return cellValue;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
wbUtil.setFormulaValue( cellStr, cellValue ) ;
return stringValue;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
wbUtil.setStringValue(cellStr, stringValue ) ;
log( "set cell " + cellStr + " to value " + stringValue + " as String.", Project.MSG_DEBUG ) ;
functions.add( def ) ;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
checkClassPath();
int totalCount = 0 ;
return evaluators;
}
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
Iterator<Task> taskIt = testTasks.iterator();
*/
public class CalculateMortgageFunction implements FreeRefFunction {
+ @Override
public ValueEval evaluate( ValueEval[] args, OperationEvaluationContext ec ) {
// verify that we have enough data
this.buffer = buffer;\r
}\r
\r
+ @Override\r
public void write(int b) {\r
buffer.append((char) b);\r
}\r
/**\r
* Fired before any targets are started.\r
*/\r
+ @Override\r
public void buildStarted(BuildEvent event) {\r
}\r
\r
*\r
* @see BuildEvent#getException()\r
*/\r
+ @Override\r
public void buildFinished(BuildEvent event) {\r
}\r
\r
*\r
* @see BuildEvent#getTarget()\r
*/\r
+ @Override\r
public void targetStarted(BuildEvent event) {\r
//System.out.println("targetStarted " + event.getTarget().getName());\r
}\r
*\r
* @see BuildEvent#getException()\r
*/\r
+ @Override\r
public void targetFinished(BuildEvent event) {\r
//System.out.println("targetFinished " + event.getTarget().getName());\r
}\r
*\r
* @see BuildEvent#getTask()\r
*/\r
+ @Override\r
public void taskStarted(BuildEvent event) {\r
//System.out.println("taskStarted " + event.getTask().getTaskName());\r
}\r
*\r
* @see BuildEvent#getException()\r
*/\r
+ @Override\r
public void taskFinished(BuildEvent event) {\r
//System.out.println("taskFinished " + event.getTask().getTaskName());\r
}\r
* @see BuildEvent#getMessage()\r
* @see BuildEvent#getPriority()\r
*/\r
+ @Override\r
public void messageLogged(BuildEvent event) {\r
if (event.getPriority() > logLevel) {\r
// ignore event\r
public static Workbook workbook = null;
+ @Override
public void setWorkbook(Workbook workbook) {
MockExcelAntWorkbookHandler.workbook = workbook;
}
+ @Override
public void execute() {
executed = true;
assertNotNull(workbook);
EXPECTED_EXTRACTOR_FAILURES.add("poifs/Notes.ole2");\r
}\r
\r
+ @Override\r
public void handleExtracting(File file) throws Exception {\r
boolean before = ExtractorFactory.getThreadPrefersEventExtractors();\r
try {\r
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
File file = new File("test-data/diagram/44501.vsd");
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
File file = new File("test-data/publisher/SampleBrochure.pub");
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
InputStream stream = new FileInputStream("test-data/hpsf/Test0313rur.adm");
try {
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
InputStream stream = new FileInputStream("test-data/hpsf/Test_Humor-Generation.ppt");
try {
// }
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
InputStream stream = new FileInputStream("test-data/hsmf/example_received_regular.msg");
try {
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
File file = new File("test-data/document/52117.doc");
}
}
+ @Override
public void handleExtracting(File file) throws Exception {
// text-extraction is not possible currenlty for these types of files
}
slide.close();
}
- public void handleExtracting(File file) throws Exception {
+ @Override
+ public void handleExtracting(File file) throws Exception {
super.handleExtracting(file);
}
// a test-case to test this locally without executing the full TestAllFiles
- @Test
+ @Override
+ @Test
public void test() throws Exception {
InputStream stream = new FileInputStream("test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx");
try {
@SuppressWarnings("resource")
NullPrintStream() {
super(new OutputStream() {
+ @Override
public void write(int b) {}
+ @Override
public void write(byte[] b) {}
+ @Override
public void write(byte[] b, int off, int len) {}
});
}
+ @Override
public void write(int b) {}
+ @Override
public void write(byte[] buf, int off, int len) {}
+ @Override
public void print(boolean b) {}
+ @Override
public void print(char c) {}
+ @Override
public void print(int i) {}
+ @Override
public void print(long l) {}
+ @Override
public void print(float f) {}
+ @Override
public void print(double d) {}
+ @Override
public void print(char[] s) {}
+ @Override
public void print(String s) {}
+ @Override
public void print(Object obj) {}
+ @Override
public void println() {}
+ @Override
public void println(boolean x) {}
+ @Override
public void println(char x) {}
+ @Override
public void println(int x) {}
+ @Override
public void println(long x) {}
+ @Override
public void println(float x) {}
+ @Override
public void println(double x) {}
+ @Override
public void println(char[] x) {}
+ @Override
public void println(String x) {}
+ @Override
public void println(Object x) {}
+ @Override
public PrintStream printf(String format, Object... args) { return this; }
+ @Override
public PrintStream printf(Locale l, String format, Object... args) { return this; }
+ @Override
public PrintStream format(String format, Object... args) { return this; }
+ @Override
public PrintStream format(Locale l, String format, Object... args) { return this; }
+ @Override
public PrintStream append(CharSequence csq) { return this; }
+ @Override
public PrintStream append(CharSequence csq, int start, int end) { return this; }
+ @Override
public PrintStream append(char c) { return this; }
+ @Override
public void write(byte[] b) {}
}
}
//
}
+ @Override
protected POIXMLRelation getDescriptor(String relationshipType) {
return null;
}
* Note: the file sizes are rounded up to the next cipher block size,
* so don't rely on file sizes of these custom encrypted zip file entries!
*/
+ @Override
public Enumeration<? extends ZipEntry> getEntries() {
return zipFile.entries();
}
+ @Override
@SuppressWarnings("resource")
public InputStream getInputStream(ZipEntry entry) throws IOException {
InputStream is = zipFile.getInputStream(entry);
zos.putNextEntry(zeNew);
FilterOutputStream fos2 = new FilterOutputStream(zos){
// don't close underlying ZipOutputStream
+ @Override
public void close() {}
};
CipherOutputStream cos = new CipherOutputStream(fos2, ciEnc);
@Test
public void testGeneralFormat() throws Exception {
runFormatTests("GeneralFormatTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
switch (CellFormat.ultimateTypeEnum(cell)) {
case BOOLEAN:
public void testNumberFormat() throws Exception {
runFormatTests("NumberFormatTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
return cell.getNumericCellValue();
}
@Test
public void testNumberApproxFormat() throws Exception {
runFormatTests("NumberFormatApproxTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
return cell.getNumericCellValue();
}
LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET"));
try {
runFormatTests("DateFormatTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
return cell.getDateCellValue();
}
@Test
public void testElapsedFormat() throws Exception {
runFormatTests("ElapsedFormatTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
return cell.getNumericCellValue();
}
@Test
public void testTextFormat() throws Exception {
runFormatTests("TextFormatTests.xlsx", new CellValue() {
+ @Override
public Object getValue(Cell cell) {
switch(CellFormat.ultimateTypeEnum(cell)) {
case BOOLEAN:
@Test
public void testConditions() throws Exception {
runFormatTests("FormatConditionTests.xlsx", new CellValue() {
+ @Override
Object getValue(Cell cell) {
return cell.getNumericCellValue();
}
private OPCPackage pkg;
private XmlVisioDocument xml;
+ @Override
protected void setUp() throws Exception {
diagrams = POIDataSamples.getDiagramInstance();
super(p);\r
}\r
\r
+ @Override\r
public void breakText(Graphics2D graphics) {\r
super.breakText(graphics);\r
}\r
\r
+ @Override\r
public double getWrappingWidth(boolean firstLine, Graphics2D graphics) {\r
return super.getWrappingWidth(firstLine, graphics);\r
}\r
super.bug35084();
}
+ @Override
@Test
public void getCellComment() throws IOException {
// TODO: reading cell comments via Sheet does not work currently as it tries
super(XSSFITestDataProvider.instance);\r
}\r
\r
+ @Override\r
protected void assertColour(String hexExpected, Color actual) {\r
assertNotNull("Colour must be given", actual);\r
XSSFColor colour = (XSSFColor)actual;\r
/**
* [Bug 49928] formatCellValue returns incorrect value for \u00a3 formatted cells
*/
- @Test
+ @Override
+ @Test
public void test49928() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("49928.xlsx");
doTest49928Core(wb);
/**
* [Bug 58532] Handle formats that go numnum, numK, numM etc
*/
- @Test
+ @Override
+ @Test
public void test58532() throws IOException {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("FormatKM.xlsx");
doTest58532Core(wb);
public class TestXSSFForkedEvaluator extends TestForkedEvaluator {
+ @Override
protected Workbook newWorkbook() {
return new XSSFWorkbook();
}
private XWPFDocument hyperlink;\r
private XWPFDocument comments;\r
\r
+ @Override
protected void setUp() throws IOException {\r
simple = XWPFTestDataSamples.openSampleDocument("SampleDoc.docx");\r
hyperlink = XWPFTestDataSamples.openSampleDocument("TestDocument.docx");\r
private XWPFDocument oddEven;
private XWPFDocument diffFirst;
+ @Override
protected void setUp() throws IOException {
noHeader = XWPFTestDataSamples.openSampleDocument("NoHeadFoot.docx");
header = XWPFTestDataSamples.openSampleDocument("ThreeColHead.docx");
* Tests for XWPF Tables
*/
public class TestXWPFTable extends TestCase {
+ @Override
protected void setUp() {
/*
XWPFDocument doc = new XWPFDocument();
* Set things up, using a PowerPoint document and
* a Word Document for our testing
*/
- public void setUp() throws Exception {
+ @Override
+ public void setUp() throws Exception {
doc = new HSLFSlideShowImpl(POIDataSamples.getSlideShowInstance().openResourceAsStream("basic_test_ppt_file.ppt"));
doc2 = HWPFTestDataSamples.openSampleFile("test2.doc");
private POIFSFileSystem fs;
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fs = new POIFSFileSystem(_dgTests.openResourceAsStream("Test_Visio-Some_Random_Text.vsd"));
}
private String defFilename;
private int defTextChunks;
- protected void setUp() {
+ @Override
+ protected void setUp() {
defFilename = "Test_Visio-Some_Random_Text.vsd";
defTextChunks = 5;
}
this.format = format;
}
- public boolean destinationCompressed() { return compressed; }
- public boolean destinationHasChunks() { return false; }
- public boolean destinationHasPointers() { return hasPointers; }
- public boolean destinationHasStrings() { return false; }
- public int getSizeInBytes() { return -1; }
+ @Override
+ public boolean destinationCompressed() { return compressed; }
+ @Override
+ public boolean destinationHasChunks() { return false; }
+ @Override
+ public boolean destinationHasPointers() { return hasPointers; }
+ @Override
+ public boolean destinationHasStrings() { return false; }
+ @Override
+ public int getSizeInBytes() { return -1; }
}
}
private PointerFactory ptrFactory;
private POIFSFileSystem filesystem;
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
ptrFactory = new PointerFactory(11);
chunkFactory = new ChunkFactory(11);
private ChunkFactory chunkFactory;
private PointerFactory ptrFactory;
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
ptrFactory = new PointerFactory(11);
chunkFactory = new ChunkFactory(11);
}
- protected void tearDown() throws Exception {
+ @Override
+protected void tearDown() throws Exception {
stream.close();
super.tearDown();
assertEquals(ch.length-1, recordContainer.getChildRecords().length);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
public final class TestTxMasterStyleAtom extends TestCase {
protected HSLFSlideShow _ppt;
+ @Override
public void setUp() {
_ppt = new HSLFSlideShow();
}
/**
* Create/open the slideshows
*/
- public void setUp() throws Exception {
+ @Override
+ public void setUp() throws Exception {
hss_empty = HSLFSlideShowImpl.create();
ss_empty = new HSLFSlideShow(hss_empty);
assertEquals(hlRun.getEndIndex(), hlShape.getEndIndex());
OutputStream nullOutput = new OutputStream(){
+ @Override
public void write(int b) throws IOException {}
};
final boolean found[] = { false };
DummyGraphics2d dgfx = new DummyGraphics2d(new PrintStream(nullOutput)){
+ @Override
public void drawString(AttributedCharacterIterator iterator, float x, float y) {
// For the test file, common sl draws textruns one by one and not mixed
// so we evaluate the whole iterator
"../spreadsheet" );
for ( final File child : directory.listFiles( new FilenameFilter()
{
+ @Override
public boolean accept( File dir, String name )
{
return name.endsWith( ".xls" ) && !failingFiles.contains( name );
while ((ze = zis.getNextEntry()) != null) {\r
String basename = ze.getName().replaceAll(".*?([^/]+)\\.wmf", "$1");\r
FilterInputStream fis = new FilterInputStream(zis){\r
+ @Override\r
public void close() throws IOException {}\r
};\r
try {\r
final String startFile = "";\r
File files[] = indir.listFiles(new FileFilter() {\r
boolean foundStartFile = false;\r
+ @Override\r
public boolean accept(File pathname) {\r
foundStartFile |= startFile.isEmpty() || pathname.getName().contains(startFile);\r
return foundStartFile && pathname.getName().matches("(?i).*\\.wmf?$");\r
protected HWPFTestCase() {
}
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
super.setUp();
/** @todo verify the constructors */
_hWPFDocFixture = new HWPFDocFixture(this, getTestFile());
return HWPFDocFixture.DEFAULT_TEST_FILE;
}
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
if (_hWPFDocFixture != null) {
_hWPFDocFixture.tearDown();
}
{
}
+ @Override
protected String getTestFile()
{
return "test-fields.doc";
private String imgCFile;
private String imgDFile;
- protected void setUp() {
+ @Override
+ protected void setUp() {
docAFile = "testPictures.doc";
docBFile = "two_images.doc";
*/
private HWPFDocument docUnicode;
- public void setUp() {
+ @Override
+ public void setUp() {
docUnicode = HWPFTestDataSamples.openSampleFile("HeaderFooterUnicode.doc");
docAscii = HWPFTestDataSamples.openSampleFile("ThreeColHeadFoot.doc");
}
"../document" );
for ( final File child : directory.listFiles( new FilenameFilter()
{
+ @Override
public boolean accept( File dir, String name )
{
return name.endsWith( ".doc" ) && !failingFiles.contains( name );
{
wordToHtmlConverter.setPicturesManager( new PicturesManager()
{
+ @Override
public String savePicture( byte[] content,
PictureType pictureType, String suggestedName,
float widthInches, float heightInches )
private HWPFDocument doc;
- protected void setUp() {
+ @Override
+ protected void setUp() {
doc = HWPFTestDataSamples.openSampleFile("test2.doc");
}
// With footnote
private String filename6;
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
String filename = "test2.doc";
String filename2 = "test.doc";
}
}
- protected void setUp()
+ @Override
+protected void setUp()
throws Exception
{
super.setUp();
_hWPFDocFixture.setUp();
}
- protected void tearDown()
+ @Override
+protected void tearDown()
throws Exception
{
_cHPBinTable = null;
}
- protected void setUp()
+ @Override
+protected void setUp()
throws Exception
{
super.setUp();
_hWPFDocFixture.setUp();
}
- protected void tearDown()
+ @Override
+protected void tearDown()
throws Exception
{
_hWPFDocFixture.tearDown();
assertEquals(node.getEnd()-node.getStart(), span);
}
}
- protected void setUp()
+ @Override
+protected void setUp()
throws Exception
{
super.setUp();
_hWPFDocFixture.setUp();
}
- protected void tearDown()
+ @Override
+protected void tearDown()
throws Exception
{
_plexOfCps = null;
}
}
- protected void setUp()
+ @Override
+protected void setUp()
throws Exception
{
super.setUp();
_hWPFDocFixture.setUp();
}
- protected void tearDown()
+ @Override
+protected void tearDown()
throws Exception
{
_hWPFDocFixture.tearDown();
assertEquals(newStyleSheet, _styleSheet);
}
- protected void setUp()
+ @Override
+protected void setUp()
throws Exception
{
super.setUp();
_styleSheet = new StyleSheet(tableStream, fib.getFcStshf());
}
- protected void tearDown()
+ @Override
+protected void tearDown()
throws Exception
{
_styleSheet = null;
private HWPFDocument unicode;
private HWPFDocument withFields;
- protected void setUp() {
+ @Override
+ protected void setUp() {
none = HWPFTestDataSamples.openSampleFile("NoHeadFoot.doc");
header = HWPFTestDataSamples.openSampleFile("ThreeColHead.doc");
private String illustrativeDocFile;
- protected void setUp() {
+ @Override
+ protected void setUp() {
illustrativeDocFile = "testRangeDelete.doc";
}
private String illustrativeDocFile;
- protected void setUp() {
+ @Override
+ protected void setUp() {
illustrativeDocFile = "testRangeInsertion.doc";
}
private HWPFDocument u;
private HWPFDocument a;
+ @Override
protected void setUp() {
u = HWPFTestDataSamples.openSampleFile("HeaderFooterUnicode.doc");
a = HWPFTestDataSamples.openSampleFile("SampleDoc.doc");
private static final class DummyEscherRecord extends EscherRecord {
public DummyEscherRecord() { }
- public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) { return 0; }
- public int serialize(int offset, byte[] data, EscherSerializationListener listener) { return 0; }
- public int getRecordSize() { return 10; }
- public String getRecordName() { return ""; }
+ @Override
+ public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) { return 0; }
+ @Override
+ public int serialize(int offset, byte[] data, EscherSerializationListener listener) { return 0; }
+ @Override
+ public int getRecordSize() { return 10; }
+ @Override
+ public String getRecordName() { return ""; }
}
public void testGetRecordSize() {
final File dataDir = _samples.getFile("");
final File[] docs = dataDir.listFiles(new FileFilter()
{
+ @Override
public boolean accept(final File file)
{
return file.isFile() && file.getName().startsWith("Test");
* does not exist
* @exception IOException if an I/O exception occurs
*/
+ @Override
public void setUp() throws FileNotFoundException, IOException
{
POIDataSamples samples = POIDataSamples.getHPSFInstance();
* Setup is used to get the document ready. Gets the DocumentSummaryInformation and the
* SummaryInformation to reasonable values
*/
- public void setUp() throws Exception {
+ @Override
+ public void setUp() throws Exception {
bout = new ByteArrayOutputStream();
poifs = new POIFSFileSystem();
dir = poifs.getRoot();
* @exception FileNotFoundException if the file to be read does not exist.
* @exception IOException if any other I/O exception occurs
*/
+ @Override
protected void setUp() {
POIDataSamples samples = POIDataSamples.getHPSFInstance();
data = samples.getFile(POI_FS);
final POIFSReader r = new POIFSReader();
r.registerListener(new POIFSReaderListener()
{
+ @Override
public void processPOIFSReaderEvent
(final POIFSReaderEvent event)
{
final POIFSReader r = new POIFSReader();
r.registerListener(new POIFSReaderListener()
{
+ @Override
public void processPOIFSReaderEvent
(final POIFSReaderEvent event)
{
static class MyPOIFSReaderListener implements POIFSReaderListener
{
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
try
POIFSReader r = new POIFSReader();
POIFSReaderListener pfl = new POIFSReaderListener()
{
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
try
final POIFSReader r = new POIFSReader();
POIFSReaderListener pfl = new POIFSReaderListener()
{
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
try
final boolean[] wascalled = { false, }; // hack to pass boolean by ref into inner class
ERFListener listener = new ERFListener() {
+ @Override
public boolean processRecord(Record rec) {
wascalled[0] = true;
assertTrue("must be BOFRecord got SID="+rec.getSid(),
ContinueRecord.class.getName(),
ContinueRecord.class.getName()
};
- public boolean processRecord(Record rec)
+ @Override
+ public boolean processRecord(Record rec)
{
// System.out.println(rec.toString());
assertEquals(
private final List<Record> _records = new ArrayList<Record>();
private final List<Record> _frecs = new ArrayList<Record>();
+ @Override
public void processRecord(Record record) {
_records.add(record);
if(record instanceof FormulaRecord) {
public MockHSSFListener() {}
private final List<Record> _records = new ArrayList<Record>();
- public void processRecord(Record record) {
+ @Override
+ public void processRecord(Record record) {
_records.add(record);
}
}
return result;
}
+ @Override
public void processRecord(Record record) {
records.add(record);
}
private final List<Record> _records = new ArrayList<Record>();
private boolean logToStdOut = false;
- public void processRecord(Record record) {
+ @Override
+ public void processRecord(Record record) {
_records.add(record);
if(record instanceof MissingRowDummyRecord) {
private DrawingManager2 drawingManager2;
private EscherDggRecord dgg;
+ @Override
protected void setUp() {
dgg = new EscherDggRecord();
dgg.setFileIdClusters( new EscherDggRecord.FileIdCluster[0] );
public MergedCellListener() {
_count = 0;
}
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
if (r instanceof MergeCellsRecord) {
_count++;
}
public SizeCheckingRecordVisitor() {
_totalSize = 0;
}
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
int estimatedSize=r.getRecordSize();
byte[] buf = new byte[estimatedSize];
public IndexRecord getIndexRecord() {
return _indexRecord;
}
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
if (r instanceof IndexRecord) {
if (_indexRecord != null) {
throw new RuntimeException("too many index records");
assertNotNull(wb.getNameXPtg("ISODD", AggregatingUDFFinder.DEFAULT));
FreeRefFunction NotImplemented = new FreeRefFunction() {
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
throw new RuntimeException("not implemented");
}
}
private static final RecordVisitor dummyRecordVisitor = new RecordVisitor() {
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
// do nothing
}
};
private List<Record> _list = new ArrayList<Record>();
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
_list.add(r);
}
_writeIndex = 0;
}
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
r.serialize(_writeIndex, _buf);
_writeIndex += r.getRecordSize();
}
final BlankStats bs = new BlankStats();
RecordVisitor rv = new RecordVisitor() {
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
if (r instanceof MulBlankRecord) {
MulBlankRecord mbr = (MulBlankRecord) r;
bs.countMulBlankRecords++;
chartTitleFormatRecords = new ArrayList<ChartTitleFormatRecord>();
}
- public void processRecord(Record record) {
+ @Override
+ public void processRecord(Record record) {
if(record instanceof ChartTitleFormatRecord) {
chartTitleFormatRecords.add((ChartTitleFormatRecord)record);
}
return 1025;
}
+ @Override
public EscherDgRecord createDgRecord()
{
EscherDgRecord dg = new EscherDgRecord();
_list = new ArrayList<Record>(128);
}
- public void visitRecord(Record r) {
+ @Override
+ public void visitRecord(Record r) {
_list.add(r);
}
private Properties properties;
private FontDetails fontDetails;
+ @Override
protected void setUp() {
properties = new Properties();
properties.setProperty("font.Arial.height", "13");
return _countCacheMisses;
}
+ @Override
public void onCacheHit(int sheetIndex, int srcRowNum, int srcColNum, ValueEval result) {
_countCacheHits++;
}
+ @Override
public void onStartEvaluate(EvaluationCell cell, ICacheEntry entry) {
_countCacheMisses++;
}
public TestHSSFConditionalFormatting(){
super(HSSFITestDataProvider.instance);
}
+ @Override
protected void assertColour(String hexExpected, Color actual) {
assertNotNull("Colour must be given", actual);
if (actual instanceof HSSFColor) {
/**
* [Bug 49928] formatCellValue returns incorrect value for \u00a3 formatted cells
*/
+ @Override
@Test
public void test49928() throws IOException {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("49928.xls");
/**
* [Bug 58532] Handle formats that go numnum, numK, numM etc
*/
+ @Override
@Test
public void test58532() throws IOException {
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("FormatKM.xls");
workbook.close();
}
+ @Override
@Test
public void testRowHeight() throws IOException{
HSSFWorkbook workbook = new HSSFWorkbook();
final List<Record> records = Arrays.asList(recs);
try {
new Runnable() {
- public void run() {
+ @Override
+ public void run() {
c.checkRecordOrder(records, check);
}
}.run();
public int getCount() {
return _count;
}
+ @Override
public void visitRecord(Record r) {
if (r instanceof LabelSSTRecord) {
_count++;
_initialValue = initialValue;
}
- public int read() {
+ @Override
+ public int read() {
return (_initialValue+_position++) & 0xFF;
}
}
* @param event the POIFSReaderEvent
*/
+ @Override
public void processPOIFSReaderEvent(POIFSReaderEvent event)
{
}
* @param event the POIFSReaderEvent
*/
+ @Override
public void processPOIFSReaderEvent(final POIFSReaderEvent event)
{
DocumentInputStream istream = event.getStream();
* @param event the POIFSWriterEvent
*/
+ @Override
public void processPOIFSWriterEvent(final POIFSWriterEvent event)
{
try
super(in);
}
+ @Override
public int read(byte[] b, int off, int len) throws IOException {
return super.read(b, off, r.nextInt(len) + 1);
}
// any block size
private static final int _buffer_size = 6;
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
int blocks = (_workbook_size + 511) / 512;
_workbook_data = new byte[ 512 * blocks ];
POIFSFileSystem fs = new POIFSFileSystem();
DirectoryEntry dir = fs.getRoot();
dir.createDocument("Foo", 0, new POIFSWriterListener() {
- public void processPOIFSWriterEvent(POIFSWriterEvent event) {
+ @Override
+ public void processPOIFSWriterEvent(POIFSWriterEvent event) {
_logger.log(POILogger.WARN, "written");
}
});
POIFSFileSystem fs = new POIFSFileSystem();
DirectoryEntry dir = fs.getRoot();
dir.createDocument("Bar", 1, new POIFSWriterListener() {
- public void processPOIFSWriterEvent(POIFSWriterEvent event) {
+ @Override
+ public void processPOIFSWriterEvent(POIFSWriterEvent event) {
try {
event.getStream().write(0);
} catch (IOException exception) {
}
});
dir.createDocument("Foo", 0, new POIFSWriterListener() {
- public void processPOIFSWriterEvent(POIFSWriterEvent event) {
+ @Override
+ public void processPOIFSWriterEvent(POIFSWriterEvent event) {
}
});
protected static POIDataSamples _ssSamples = POIDataSamples.getSpreadSheetInstance();
protected List<NPOIFSFileSystem> openedFSs;
+ @Override
protected void tearDown() throws Exception {
if (openedFSs != null && !openedFSs.isEmpty()) {
for (NPOIFSFileSystem fs : openedFSs) {
_isClosed = false;
}
- public int read() throws IOException {
+ @Override
+ public int read() throws IOException {
int result = _is.read();
if(result >=0) {
checkRead(1);
}
return result;
}
- public int read(byte[] b, int off, int len) throws IOException {
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
int result = _is.read(b, off, len);
checkRead(result);
return result;
throw new MyEx();
}
}
- public void close() throws IOException {
+ @Override
+ public void close() throws IOException {
_isClosed = true;
_is.close();
}
*/
private static final Comparator<Property> OldCaseSensitivePropertyComparator = new Comparator<Property>() {
+ @Override
public int compare(Property o1, Property o2) {
String name1 = o1.getName();
String name2 = o2.getName();
* Method preWrite
*/
+ @Override
protected void preWrite()
{
}
* @return false
*/
+ @Override
public boolean isDirectory()
{
return false;
* do nothing
*/
+ @Override
protected void preWrite()
{
}
* @return false
*/
+ @Override
public boolean isDirectory()
{
return false;
*
* @return desired block
*/
+ @Override
public ListManagedBlock remove(final int index)
throws IOException
{
* @param index the index of the specified block; if the index is
* out of range, that's ok
*/
+ @Override
public void zap(final int index)
{
ensureArrayExists();
}
}
+ @Override
public int blockCount() {
return _list.size();
}
return true;
}
- public int read() {
+ @Override
+ public int read() {
if(pos >= data.length) {
return -1;
}
* size, whichever is lower.
* Quite often will simply claim to have no data
*/
- public int read(byte[] b, int off, int len) {
+ @Override
+ public int read(byte[] b, int off, int len) {
// Keep the length within the chunk size
if(len > chunkSize) {
len = chunkSize;
return len;
}
- public int read(byte[] b) {
+ @Override
+ public int read(byte[] b) {
return read(b, 0, b.length);
}
}
for(String name : shapes.keySet()) {
CustomGeometry geom = shapes.get(name);
Context ctx = new Context(geom, new Rectangle2D.Double(0, 0, 100, 100), new IAdjustableShape() {
+ @Override
public Guide getAdjustValue(String presetName) {
return null;
}
//
}
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length != 1 || !(args[0] instanceof StringEval)) {
return ErrorEval.VALUE_INVALID;
//
}
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length != 1 || !(args[0] instanceof StringEval)) {
return ErrorEval.VALUE_INVALID;
* @author Josh Micich
*/
public abstract class EvaluationListener implements IEvaluationListener {
- public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) {
+ @Override
+ public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) {
// do nothing
}
- public void onReadPlainValue(int sheetIndex, int rowIndex, int columnIndex, ICacheEntry entry) {
+ @Override
+ public void onReadPlainValue(int sheetIndex, int rowIndex, int columnIndex, ICacheEntry entry) {
// do nothing
}
- public void onStartEvaluate(EvaluationCell cell, ICacheEntry entry) {
+ @Override
+ public void onStartEvaluate(EvaluationCell cell, ICacheEntry entry) {
// do nothing
}
- public void onEndEvaluate(ICacheEntry entry, ValueEval result) {
+ @Override
+ public void onEndEvaluate(ICacheEntry entry, ValueEval result) {
// do nothing
}
- public void onClearWholeCache() {
+ @Override
+ public void onClearWholeCache() {
// do nothing
}
- public void onClearCachedValue(ICacheEntry entry) {
+ @Override
+ public void onClearCachedValue(ICacheEntry entry) {
// do nothing
}
- public void onChangeFromBlankValue(int sheetIndex, int rowIndex, int columnIndex,
+ @Override
+ public void onChangeFromBlankValue(int sheetIndex, int rowIndex, int columnIndex,
EvaluationCell cell, ICacheEntry entry) {
// do nothing
}
- public void sortDependentCachedValues(ICacheEntry[] entries) {
+ @Override
+ public void sortDependentCachedValues(ICacheEntry[] entries) {
// do nothing
}
- public void onClearDependentCachedValue(ICacheEntry entry, int depth) {
+ @Override
+ public void onClearDependentCachedValue(ICacheEntry entry, int depth) {
// do nothing
}
}
private EvaluationCell getCell(ICacheEntry a) {
return _formulaCellsByCacheEntry.get(a);
}
- public int compare(ICacheEntry oa, ICacheEntry ob) {
+ @Override
+ public int compare(ICacheEntry oa, ICacheEntry ob) {
EvaluationCell a = getCell(oa);
EvaluationCell b = getCell(ob);
int cmp;
_formulaCellsByCacheEntry = new HashMap<ICacheEntry,EvaluationCell>();
_plainCellLocsByCacheEntry = new HashMap<ICacheEntry, Loc>();
}
- public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) {
+ @Override
+ public void onCacheHit(int sheetIndex, int rowIndex, int columnIndex, ValueEval result) {
log("hit", rowIndex, columnIndex, result);
}
- public void onReadPlainValue(int sheetIndex, int rowIndex, int columnIndex, ICacheEntry entry) {
+ @Override
+ public void onReadPlainValue(int sheetIndex, int rowIndex, int columnIndex, ICacheEntry entry) {
Loc loc = new Loc(0, sheetIndex, rowIndex, columnIndex);
_plainCellLocsByCacheEntry.put(entry, loc);
log("value", rowIndex, columnIndex, entry.getValue());
}
- public void onStartEvaluate(EvaluationCell cell, ICacheEntry entry) {
+ @Override
+ public void onStartEvaluate(EvaluationCell cell, ICacheEntry entry) {
_formulaCellsByCacheEntry.put(entry, cell);
HSSFCell hc = _book.getSheetAt(0).getRow(cell.getRowIndex()).getCell(cell.getColumnIndex());
log("start", cell.getRowIndex(), cell.getColumnIndex(), FormulaExtractor.getPtgs(hc));
}
- public void onEndEvaluate(ICacheEntry entry, ValueEval result) {
+ @Override
+ public void onEndEvaluate(ICacheEntry entry, ValueEval result) {
EvaluationCell cell = _formulaCellsByCacheEntry.get(entry);
log("end", cell.getRowIndex(), cell.getColumnIndex(), result);
}
- public void onClearCachedValue(ICacheEntry entry) {
+ @Override
+ public void onClearCachedValue(ICacheEntry entry) {
int rowIndex;
int columnIndex;
EvaluationCell cell = _formulaCellsByCacheEntry.get(entry);
}
log("clear", rowIndex, columnIndex, entry.getValue());
}
- public void sortDependentCachedValues(ICacheEntry[] entries) {
+ @Override
+ public void sortDependentCachedValues(ICacheEntry[] entries) {
Arrays.sort(entries, new FormulaCellCacheEntryComparer(_formulaCellsByCacheEntry));
}
- public void onClearDependentCachedValue(ICacheEntry entry, int depth) {
+ @Override
+ public void onClearDependentCachedValue(ICacheEntry entry, int depth) {
EvaluationCell cell = _formulaCellsByCacheEntry.get(entry);
log("clear" + depth, cell.getRowIndex(), cell.getColumnIndex(), entry.getValue());
}
- public void onChangeFromBlankValue(int sheetIndex, int rowIndex, int columnIndex,
+ @Override
+ public void onChangeFromBlankValue(int sheetIndex, int rowIndex, int columnIndex,
EvaluationCell cell, ICacheEntry entry) {
log("changeFromBlank", rowIndex, columnIndex, entry.getValue());
if (entry.getValue() == null) { // hack to tell the difference between formula and plain value
}
FunctionEval.registerFunction("FISHER", new Function() {
+ @Override
public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) {
return ErrorEval.NA;
}
}
AnalysisToolPak.registerFunction("CUBEMEMBERPROPERTY", new FreeRefFunction() {
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
return ErrorEval.NUM_ERROR;
}
public void testExceptions() {
Function func = new Function() {
+ @Override
public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) {
return ErrorEval.NA;
}
}
FreeRefFunction atpFunc = new FreeRefFunction() {
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
return ErrorEval.NUM_ERROR;
}
return getRelativeValue(-1, relativeRowIndex, relativeColumnIndex);
}
+ @Override
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
return null;
}
+ @Override
public TwoDEval getColumn(int columnIndex) {
return null;
}
+ @Override
public TwoDEval getRow(int rowIndex) {
return null;
}
return getRelativeValue(-1, relativeRowIndex, relativeColumnIndex);
}
+ @Override
public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
return null;
}
+ @Override
public TwoDEval getColumn(int columnIndex) {
return null;
}
+ @Override
public TwoDEval getRow(int rowIndex) {
return null;
}
//
}
- public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
+ @Override
+ public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length != 1 || !(args[0] instanceof StringEval)) {
return ErrorEval.VALUE_INVALID;
}
//
}
- public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
+ @Override
+ public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length != 1 || !(args[0] instanceof StringEval)) {
return ErrorEval.VALUE_INVALID;
}
}
- protected void setUp() {
+ @Override
+ protected void setUp() {
if (workbook == null) {
workbook = HSSFTestDataSamples.openSampleWorkbook(SS.FILENAME);
sheet = workbook.getSheet( SS.TEST_SHEET_NAME );
public MockRefEval(int rowIndex, int columnIndex) {
super(-1, -1, rowIndex, columnIndex);
}
- public ValueEval getInnerValueEval(int sheetIndex) {
+ @Override
+ public ValueEval getInnerValueEval(int sheetIndex) {
throw new RuntimeException("not expected to be called during this test");
}
- public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx,
+ @Override
+ public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx,
int relLastColIx) {
AreaI area = new OffsetArea(getRow(), getColumn(),
relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx);
private MockAreaEval(int firstRow, int firstColumn, int lastRow, int lastColumn) {
super(firstRow, firstColumn, lastRow, lastColumn);
}
- public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) {
+ @Override
+ public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) {
throw new RuntimeException("not expected to be called during this test");
}
+ @Override
public ValueEval getRelativeValue(int sheetIndex, int relativeRowIndex, int relativeColumnIndex) {
throw new RuntimeException("not expected to be called during this test");
}
- public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx,
+ @Override
+ public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx,
int relLastColIx) {
AreaI area = new OffsetArea(getFirstRow(), getFirstColumn(),
relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx);
return new MockAreaEval(area);
}
- public TwoDEval getRow(int rowIndex) {
+ @Override
+ public TwoDEval getRow(int rowIndex) {
if (rowIndex >= getHeight()) {
throw new IllegalArgumentException("Invalid rowIndex " + rowIndex
+ ". Allowable range is (0.." + getHeight() + ").");
}
return new MockAreaEval(rowIndex, getFirstColumn(), rowIndex, getLastColumn());
}
- public TwoDEval getColumn(int columnIndex) {
+ @Override
+ public TwoDEval getColumn(int columnIndex) {
if (columnIndex >= getWidth()) {
throw new IllegalArgumentException("Invalid columnIndex " + columnIndex
+ ". Allowable range is (0.." + getWidth() + ").");
// The stability classifier is useful to reduce memory consumption of caching logic
IStabilityClassifier stabilityClassifier = new IStabilityClassifier() {
- public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
+ @Override
+ public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
return sheetIndex == 1;
}
};
public static final double POS_ZERO = 1E-4;
public static final double DIFF_TOLERANCE_FACTOR = 1E-8;
+ @Override
public void setUp() {
}
+ @Override
public void tearDown() {
}
super(firstRow, firstColumn, lastRow, lastColumn);
_values = values;
}
- public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) {
+ @Override
+ public ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex) {
return getRelativeValue(-1, relativeRowIndex, relativeColumnIndex);
}
+ @Override
public ValueEval getRelativeValue(int sheetIndex, int relativeRowIndex, int relativeColumnIndex) {
if (relativeRowIndex < 0 || relativeRowIndex >=getHeight()) {
throw new IllegalArgumentException("row index out of range");
int oneDimensionalIndex = relativeRowIndex * width + relativeColumnIndex;
return _values[oneDimensionalIndex];
}
- public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
+ @Override
+ public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
if (relFirstRowIx < 0 || relFirstColIx < 0
|| relLastRowIx >= getHeight() || relLastColIx >= getWidth()) {
throw new RuntimeException("Operation not implemented on this mock object");
}
return result;
}
- public TwoDEval getRow(int rowIndex) {
+ @Override
+ public TwoDEval getRow(int rowIndex) {
if (rowIndex >= getHeight()) {
throw new IllegalArgumentException("Invalid rowIndex " + rowIndex
+ ". Allowable range is (0.." + getHeight() + ").");
}
return new MockAreaEval(rowIndex, getFirstColumn(), rowIndex, getLastColumn(), values);
}
- public TwoDEval getColumn(int columnIndex) {
+ @Override
+ public TwoDEval getColumn(int columnIndex) {
if (columnIndex >= getWidth()) {
throw new IllegalArgumentException("Invalid columnIndex " + columnIndex
+ ". Allowable range is (0.." + getWidth() + ").");
super(-1, -1, ptg.getRow(), ptg.getColumn());
_value = value;
}
- public ValueEval getInnerValueEval(int sheetIndex) {
+ @Override
+ public ValueEval getInnerValueEval(int sheetIndex) {
return _value;
}
- public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
+ @Override
+ public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) {
throw new RuntimeException("Operation not implemented on this mock object");
}
}
HSSFEvaluationWorkbook workbook = HSSFEvaluationWorkbook.create(wb);
WorkbookEvaluator workbookEvaluator = new WorkbookEvaluator(workbook, new IStabilityClassifier() {
+ @Override
public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
return true;
}
private HSSFCell cell11;
private HSSFFormulaEvaluator evaluator;
+ @Override
public void setUp() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
private HSSFCell cell11;
private HSSFFormulaEvaluator evaluator;
+ @Override
public void setUp() {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFEvaluationWorkbook workbook = HSSFEvaluationWorkbook.create(wb);
WorkbookEvaluator workbookEvaluator = new WorkbookEvaluator(workbook, new IStabilityClassifier() {
+ @Override
public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
return true;
}
HSSFEvaluationWorkbook workbook = HSSFEvaluationWorkbook.create(wb);
WorkbookEvaluator workbookEvaluator = new WorkbookEvaluator(workbook, new IStabilityClassifier() {
+ @Override
public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
return true;
}
HSSFEvaluationWorkbook workbook = HSSFEvaluationWorkbook.create(wb);
WorkbookEvaluator workbookEvaluator = new WorkbookEvaluator(workbook, new IStabilityClassifier() {
+ @Override
public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) {
return true;
}
protected UDFFinder _instance;
protected static final FreeRefFunction NotImplemented = new FreeRefFunction() {
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
throw new RuntimeException("not implemented");
}
* @throws IOException\r
* \r
*/\r
+ @Deprecated\r
@SuppressWarnings("deprecated")\r
@Test\r
public void setAlignment() throws IOException {\r
* @deprecated Replaced by {@link #setFillForegroundColorBeforeFillBackgroundColorEnum()}\r
* @since POI 3.15 beta 3\r
*/\r
+ @Deprecated\r
// bug 55555\r
@Test\r
public void setFillForegroundColorBeforeFillBackgroundColor() throws IOException {\r
private int cellsVisited = 0;
private long ordinalNumberSum = 0L;
- public void onCell(Cell cell, CellWalkContext ctx) {
+ @Override
+ public void onCell(Cell cell, CellWalkContext ctx) {
++cellsVisited;
ordinalNumberSum += ctx.getOrdinalNumber();
}
* @param o
*/
+ @Override
public int compareTo(Object o)
{
LocalTestNode other = ( LocalTestNode ) o;
* @return true if equal
*/
+ @Override
public boolean equals(Object o)
{
if (o == null)
/**
* @return hash code
*/
+ @Override
public int hashCode()
{
return getKey().hashCode() ^ getValue().hashCode();