aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2011-03-04 12:50:02 +0000
committerNick Burch <nick@apache.org>2011-03-04 12:50:02 +0000
commitd7cc7e582bc7215be659f17879573a8a9417fcc8 (patch)
treec77aabd8e2a707305a8cd594300d4a31ea48c5a6 /src/examples
parentce77707b83b197ffd1b7a6be4b06d03ee3c042e4 (diff)
downloadpoi-d7cc7e582bc7215be659f17879573a8a9417fcc8.tar.gz
poi-d7cc7e582bc7215be659f17879573a8a9417fcc8.zip
From bug #50786 - Speed up calls to HSSFColor.getIndexHash() by returning a cached, unmodifiable Map. HSSFColor.getModifiableIndexHash() provides access to the old (slow but modifiable) functionality
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1077920 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java2
-rw-r--r--src/examples/src/org/apache/poi/hssf/view/SVTableUtils.java2
-rw-r--r--src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
index 4fd79a9620..b0c57b0fe0 100644
--- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
+++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java
@@ -37,7 +37,7 @@ import org.apache.poi.hssf.util.HSSFColor;
public class SVTableCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
private static final Color black = getAWTColor(new HSSFColor.BLACK());
private static final Color white = getAWTColor(new HSSFColor.WHITE());
- private Hashtable colors = HSSFColor.getIndexHash();
+ private Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
private HSSFWorkbook wb;
diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableUtils.java b/src/examples/src/org/apache/poi/hssf/view/SVTableUtils.java
index 08ac7b32e0..23ffb851bd 100644
--- a/src/examples/src/org/apache/poi/hssf/view/SVTableUtils.java
+++ b/src/examples/src/org/apache/poi/hssf/view/SVTableUtils.java
@@ -31,7 +31,7 @@ import org.apache.poi.hssf.util.*;
* @author Jason Height
*/
public class SVTableUtils {
- private final static Hashtable colors = HSSFColor.getIndexHash();
+ private final static Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
/** Description of the Field */
public final static Color black = getAWTColor(new HSSFColor.BLACK());
/** Description of the Field */
diff --git a/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java b/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java
index 36fca3a9b9..08108e8e6c 100644
--- a/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java
+++ b/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java
@@ -16,15 +16,15 @@
==================================================================== */
package org.apache.poi.ss.examples.html;
+import java.util.Formatter;
+import java.util.Map;
+
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import java.util.Formatter;
-import java.util.Hashtable;
-
/**
* Implementation of {@link HtmlHelper} for XSSF files.
*
@@ -33,7 +33,7 @@ import java.util.Hashtable;
public class XSSFHtmlHelper implements HtmlHelper {
private final XSSFWorkbook wb;
- private static final Hashtable colors = HSSFColor.getIndexHash();
+ private static final Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
public XSSFHtmlHelper(XSSFWorkbook wb) {
this.wb = wb;