summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 15:03:19 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:45:53 +0200
commit8be40d31d78723debd47f671544f480c1c606db7 (patch)
tree0051888bb41793e4d65704a93a4cfc659119c8bc /odk
parente527a340051b55a6f05d05f397d82ec797165163 (diff)
Java cleanup, convert Hashtable to HashMap
Change-Id: If8a9c0c3a4b357fb9c0ff096f44ed1b44ebbcef4
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java13
-rw-r--r--odk/examples/java/Inspector/SourceCodeGenerator.java9
2 files changed, 9 insertions, 13 deletions
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 47cc018ac2e4..0d5cb6bd781a 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
@@ -79,9 +79,9 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
class ExampleAddInThread extends Thread
{
- private java.util.Hashtable<String, ExampleAddInResult> aCounters;
+ private java.util.HashMap<String, ExampleAddInResult> aCounters;
- public ExampleAddInThread( java.util.Hashtable<String, ExampleAddInResult> aResults )
+ public ExampleAddInThread( java.util.HashMap<String, ExampleAddInResult> aResults )
{
aCounters = aResults;
}
@@ -99,9 +99,8 @@ class ExampleAddInThread extends Thread
}
// increment all counters
- java.util.Enumeration<ExampleAddInResult> aEnum = aCounters.elements();
- while (aEnum.hasMoreElements())
- aEnum.nextElement().incrementValue();
+ for (ExampleAddInResult r : aCounters.values())
+ r.incrementValue();
}
}
}
@@ -149,7 +148,7 @@ public class ExampleAddIn
};
private com.sun.star.lang.Locale aFuncLocale;
- private java.util.Hashtable<String, ExampleAddInResult> aResults;
+ private java.util.HashMap<String, ExampleAddInResult> aResults;
public _ExampleAddIn( com.sun.star.lang.XMultiServiceFactory xFactory )
{
@@ -176,7 +175,7 @@ public class ExampleAddIn
{
// create the table of results, and start a thread to increment
// all counters
- aResults = new java.util.Hashtable<String, ExampleAddInResult>();
+ aResults = new java.util.HashMap<String, ExampleAddInResult>();
ExampleAddInThread aThread = new ExampleAddInThread( aResults );
aThread.start();
}
diff --git a/odk/examples/java/Inspector/SourceCodeGenerator.java b/odk/examples/java/Inspector/SourceCodeGenerator.java
index 4e6f3bc30115..8ccba8bba944 100644
--- a/odk/examples/java/Inspector/SourceCodeGenerator.java
+++ b/odk/examples/java/Inspector/SourceCodeGenerator.java
@@ -33,8 +33,7 @@
*************************************************************************/
import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
+import java.util.HashMap;
import com.sun.star.reflection.ParamInfo;
import com.sun.star.reflection.XIdlClass;
@@ -55,7 +54,7 @@ public class SourceCodeGenerator {
private String sStatementCode = "";
private String sMainMethodSignature = "";
- private Hashtable<String, UnoObjectDefinition> aVariables = new Hashtable<String, UnoObjectDefinition>();
+ private HashMap<String, UnoObjectDefinition> aVariables = new HashMap<String, UnoObjectDefinition>();
private final String SSUFFIXSEPARATOR = "_";
private final String SVARIABLENAME = "VariableName";
private final String SARRAYVARIABLENAME = "VariableNameList";
@@ -344,9 +343,7 @@ public class SourceCodeGenerator {
private String getHeaderSourceCode(){
- Enumeration<UnoObjectDefinition> aEnumeration = aVariables.elements();
- while(aEnumeration.hasMoreElements()){
- UnoObjectDefinition oUnoObjectDefinition = aEnumeration.nextElement();
+ for(UnoObjectDefinition oUnoObjectDefinition : aVariables.values()){
String sCurHeaderStatement = m_xLanguageSourceCodeGenerator.getHeaderSourceCode(oUnoObjectDefinition.getUnoObject(), oUnoObjectDefinition.getTypeName(), oUnoObjectDefinition.getTypeClass());
sHeaderStatements.add(sCurHeaderStatement);
}