summaryrefslogtreecommitdiffstats
path: root/odk/examples/DevelopersGuide
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 14:35:04 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:45:50 +0200
commit587c59fbc931b12f4d63d077a78bcaa43ffbf83d (patch)
treec1984991960664faf41ea3e32e3804404aecb22d /odk/examples/DevelopersGuide
parentremove some unnecessary casts (diff)
downloadcore-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.tar.gz
core-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.zip
Java cleanup, Convert Vector to ArrayList
Change-Id: I323a6625f93347e69f3114fc10cb04dc759a539f
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r--odk/examples/DevelopersGuide/Forms/ButtonOperator.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/SalesFilter.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java16
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java13
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java12
-rw-r--r--odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java48
-rw-r--r--odk/examples/DevelopersGuide/UCB/PropertiesComposer.java24
-rw-r--r--odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java22
11 files changed, 83 insertions, 90 deletions
diff --git a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index a447381a2c69..3d121589d8e6 100644
--- a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
@@ -32,6 +32,8 @@
*
*************************************************************************/
// java base stuff
+import java.util.ArrayList;
+
import com.sun.star.awt.ActionEvent;
import com.sun.star.awt.XActionListener;
import com.sun.star.awt.XButton;
@@ -42,7 +44,6 @@ import com.sun.star.form.runtime.XFormOperations;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import java.util.Vector;
/**************************************************************************/
@@ -55,7 +56,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
private XPropertySet m_form;
private XFormOperations m_formOperations;
- private Vector<XPropertySet> m_aButtons;
+ private ArrayList<XPropertySet> m_aButtons;
/* ------------------------------------------------------------------ */
/** ctor
@@ -65,7 +66,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
m_componentContext = xCtx;
m_aDocument = aDocument;
m_form = _form;
- m_aButtons = new Vector<XPropertySet>();
+ m_aButtons = new ArrayList<XPropertySet>();
}
/* ------------------------------------------------------------------ */
@@ -89,7 +90,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
{
for ( int i=0; i < m_aButtons.size(); ++i )
{
- XPropertySet button = m_aButtons.elementAt( i );
+ XPropertySet button = m_aButtons.get( i );
if ( _formFeature == getAssociatedFormFeature( button ) )
return button;
}
@@ -104,7 +105,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
int nPos = -1;
for ( int i=0; ( i < m_aButtons.size() ) && ( -1 == nPos ); ++i )
{
- if ( xButton.equals( m_aButtons.elementAt( i ) ) )
+ if ( xButton.equals( m_aButtons.get( i ) ) )
nPos = i;
}
return nPos;
@@ -207,9 +208,8 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
public void invalidateAllFeatures() throws com.sun.star.uno.RuntimeException
{
- for ( int i=0; i < m_aButtons.size(); ++i )
+ for ( XPropertySet buttonModel : m_aButtons )
{
- XPropertySet buttonModel = m_aButtons.elementAt( i );
updateButtonState( buttonModel, getAssociatedFormFeature( buttonModel ) );
}
}
diff --git a/odk/examples/DevelopersGuide/Forms/SalesFilter.java b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
index e4c516160d0f..33053db662ca 100644
--- a/odk/examples/DevelopersGuide/Forms/SalesFilter.java
+++ b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
@@ -362,7 +362,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
String[] aOldFilterItems = (String[])m_xFilterList.getPropertyValue( "StringItemList" );
// translate this into a vector - much more comfort to work with a vector than with an array ....
- java.util.Vector aFilterItems = new java.util.Vector();
+ java.util.ArrayList aFilterItems = new java.util.ArrayList();
for ( int i=0; i<aOldFilterItems.length; ++i )
aFilterItems.add( aOldFilterItems[i] );
@@ -384,7 +384,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
if ( aFilterItems.size() > 10 ) // (6 standard items + 5 user defined items)
{
// the first (and thus oldes) user defined item
- aFilterItems.removeElementAt( 6 );
+ aFilterItems.remove( 6 );
// keep our date vector synchron
m_aFilterDates.removeElementAt( 6 );
}
@@ -397,7 +397,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
m_bAdjustingFilterList = true;
String[] aNewFilterItems = new String[ aFilterItems.size() ];
for ( int i=0; i<aFilterItems.size(); ++i )
- aNewFilterItems[i] = (String)aFilterItems.elementAt( i );
+ aNewFilterItems[i] = (String)aFilterItems.get( i );
m_xFilterList.setPropertyValue( "StringItemList", aNewFilterItems );
m_bAdjustingFilterList = false;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
index 180137c9f61c..0ab7aa0cd606 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
@@ -32,7 +32,7 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
// __________ Implementation __________
@@ -64,5 +64,5 @@ public interface IOnewayLink
* Note: Atomic types (e.g. int, long) will be transported as objects
* too (Integer, Long)!
*/
- public abstract void execOneway( int nRequest, Vector<Object> lParams );
+ public abstract void execOneway( int nRequest, ArrayList<Object> lParams );
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
index c9fe4f38c33f..628cc587c83d 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
@@ -34,7 +34,7 @@
// __________ Imports __________
-import java.util.Vector;
+import java.util.ArrayList;
import com.sun.star.frame.FrameActionEvent;
import com.sun.star.uno.UnoRuntime;
@@ -160,7 +160,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener,
* @param lParams
* the vector with all packed parameters of the original request
*/
- public void execOneway(/*IN*/ int nRequest,/*IN*/ Vector<Object> lParams )
+ public void execOneway(/*IN*/ int nRequest,/*IN*/ ArrayList<Object> lParams )
{
synchronized(this)
{
@@ -234,7 +234,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener,
return;
// pack the event and start thread - which call us back later
- Vector<Object> lOutParams = new Vector<Object>();
+ ArrayList<Object> lOutParams = new ArrayList<Object>();
lOutParams.add(aEvent);
OnewayExecutor aExecutor = new OnewayExecutor( this ,
@@ -272,7 +272,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener,
lInURL[0] = aURL ;
lInArguments[0] = lArguments;
- Vector<Object> lOutParams = OnewayExecutor.encodeDispatch(
+ ArrayList<Object> lOutParams = OnewayExecutor.encodeDispatch(
lInURL ,
lInArguments );
OnewayExecutor aExecutor = new OnewayExecutor( this ,
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
index 0f48ede996ae..2861b23bde3a 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
@@ -32,7 +32,7 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
// __________ Implementation __________
@@ -76,7 +76,7 @@ class OnewayExecutor extends Thread
*/
private IOnewayLink m_rLink ;
private int m_nRequest ;
- private Vector<Object> m_lParams ;
+ private ArrayList<Object> m_lParams ;
// _______________________________
@@ -102,7 +102,7 @@ class OnewayExecutor extends Thread
*/
public OnewayExecutor( IOnewayLink rLink ,
int nRequest ,
- Vector<Object> lParams )
+ ArrayList<Object> lParams )
{
m_rLink = rLink ;
m_nRequest = nRequest;
@@ -144,13 +144,13 @@ class OnewayExecutor extends Thread
// _______________________________
- public static Vector<Object> encodeDispatch(
+ public static ArrayList<Object> encodeDispatch(
com.sun.star.util.URL[] aURL,
com.sun.star.beans.PropertyValue[][] lArgs)
{
int nLength = lArgs.length+1;
int nPos = 0;
- Vector<Object> lParams = new Vector<Object>(nLength);
+ ArrayList<Object> lParams = new ArrayList<Object>(nLength);
lParams.add( aURL[0] );
--nLength;
@@ -165,7 +165,7 @@ class OnewayExecutor extends Thread
}
public static void decodeDispatch(
- Vector<Object> lParams,
+ ArrayList<Object> lParams,
com.sun.star.util.URL[] aURL,
com.sun.star.beans.PropertyValue[][] lArgs)
{
@@ -173,12 +173,12 @@ class OnewayExecutor extends Thread
int nPos = 0;
lArgs[0] = new com.sun.star.beans.PropertyValue[nLength];
- aURL[0] = (com.sun.star.util.URL) lParams.elementAt(0);
+ aURL[0] = (com.sun.star.util.URL) lParams.get(0);
while (nPos<nLength)
{
lArgs[0][nPos] = (com.sun.star.beans.PropertyValue)
- (lParams.elementAt(nPos+1));
+ (lParams.get(nPos+1));
++nPos;
}
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
index fd79205cfaa3..5de834dac847 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
@@ -35,7 +35,7 @@
// __________ Imports __________
import java.awt.Component;
-import java.util.Vector;
+import java.util.ArrayList;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
@@ -166,7 +166,7 @@ class StatusListener implements com.sun.star.frame.XStatusListener,
* @param lParams
* the vector with all packed parameters of the original request
*/
- public void execOneway(/*IN*/ int nRequest,/*IN*/ Vector<Object> lParams )
+ public void execOneway(/*IN*/ int nRequest,/*IN*/ ArrayList<Object> lParams )
{
synchronized(this)
{
@@ -213,7 +213,7 @@ class StatusListener implements com.sun.star.frame.XStatusListener,
if (! bHandle)
return;
- Vector<Object> lOutParams = new Vector<Object>();
+ ArrayList<Object> lOutParams = new ArrayList<Object>();
lOutParams.add(aEvent);
OnewayExecutor aExecutor = new OnewayExecutor( this ,
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
index c2fbff2cde91..e9f396e1c0a2 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
@@ -74,8 +74,8 @@ public class ViewContainer extends Thread
*/
private ViewContainer()
{
- mlViews = new Vector<Object>();
- mlListener = new Vector<IShutdownListener>();
+ mlViews = new ArrayList<Object>();
+ mlListener = new ArrayList<IShutdownListener>();
mbShutdownActive = false ;
Runtime.getRuntime().addShutdownHook(this);
}
@@ -204,9 +204,8 @@ public class ViewContainer extends Thread
IShutdownListener aListener = null;
synchronized(mlListener)
{
- try{
- aListener = mlListener.firstElement();
- } catch(java.util.NoSuchElementException exEmpty) {}
+ if (!mlListener.isEmpty())
+ aListener = mlListener.get(0);
}
if (aListener==null)
break;
@@ -258,7 +257,7 @@ public class ViewContainer extends Thread
*/
public static boolean mbInplace = false ;
private static ViewContainer maSingleton = null ;
- private Vector<Object> mlViews ;
- private Vector<IShutdownListener> mlListener ;
+ private ArrayList<Object> mlViews ;
+ private ArrayList<IShutdownListener> mlListener ;
private boolean mbShutdownActive ;
}
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 388e4890bbd2..47cc018ac2e4 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
@@ -38,7 +38,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
{
private String aName;
private int nValue;
- private java.util.Vector<XResultListener> aListeners = new java.util.Vector<XResultListener>();
+ private java.util.ArrayList<XResultListener> aListeners = new java.util.ArrayList<XResultListener>();
public ExampleAddInResult( String aNewName )
{
@@ -56,7 +56,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void addResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.addElement( aListener );
+ aListeners.add( aListener );
// immediately notify of initial value
aListener.modified( getResult() );
@@ -64,7 +64,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void removeResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.removeElement( aListener );
+ aListeners.remove( aListener );
}
public void incrementValue()
@@ -72,10 +72,8 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
++nValue;
com.sun.star.sheet.ResultEvent aEvent = getResult();
- java.util.Enumeration<XResultListener> aEnum = aListeners.elements();
- while (aEnum.hasMoreElements())
- aEnum.nextElement().modified(
- aEvent);
+ for( XResultListener l : aListeners)
+ l.modified(aEvent);
}
}
diff --git a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
index 00591ec4bc58..03a45bae9c23 100644
--- a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
@@ -32,19 +32,18 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import com.sun.star.beans.Property;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
import com.sun.star.ucb.OpenCommandArgument2;
import com.sun.star.ucb.OpenMode;
import com.sun.star.ucb.XContent;
import com.sun.star.ucb.XContentAccess;
import com.sun.star.ucb.XDynamicResultSet;
-import com.sun.star.beans.Property;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.sdbc.XRow;
-import com.sun.star.sdbc.XResultSet;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
/**
* Retrieve the Children of a UCB Folder Content
@@ -57,7 +56,7 @@ public class ChildrenRetriever {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propnames = new Vector<String>();
+ private ArrayList<String> m_propnames = new ArrayList<String>();
/**
* Constructor. Create a new connection with the specific args to a running office
@@ -87,30 +86,30 @@ public class ChildrenRetriever {
* This method requires the main and the optional arguments to be set in order to work.
* See Constructor.
*
- *@return Vector Returns children properties values if values successfully retrieved,
+ *@return Returns children properties values if values successfully retrieved,
* null otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Vector<Object>> getChildren()
+ public ArrayList<ArrayList<Object>> getChildren()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
+ ArrayList<String> properties = getProperties();
return getChildren ( properties );
}
/**
* Open a folder content, get properties values for the properties.
*
- *@param Vector Properties
- *@return Vector Returns children properties values if values successfully retrieved,
+ *@param properties
+ *@return Returns children properties values if values successfully retrieved,
* null otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Vector<Object>> getChildren( Vector<String> properties )
+ public ArrayList<ArrayList<Object>> getChildren( ArrayList<String> properties )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<Vector<Object>> result = null;
+ ArrayList<ArrayList<Object>> result = null;
if ( m_content != null ) {
int size = 0;
if ( properties != null && !properties.isEmpty()) {
@@ -140,7 +139,7 @@ public class ChildrenRetriever {
XDynamicResultSet.class, m_helper.executeCommand( m_content, "open", arg ));
XResultSet resultSet = set.getStaticResultSet();
- result = new Vector<Vector<Object>>();
+ result = new ArrayList<ArrayList<Object>>();
/////////////////////////////////////////////////////////////////////
// Iterate over children, access children and property values...
@@ -153,7 +152,7 @@ public class ChildrenRetriever {
XRow row = UnoRuntime.queryInterface( XRow.class, resultSet );
do {
- Vector<Object> propsValues = new Vector<Object>();
+ ArrayList<Object> propsValues = new ArrayList<Object>();
// Obtain URL of child.
String id = contentAccess.queryContentIdentifierString();
@@ -187,7 +186,7 @@ public class ChildrenRetriever {
*
*@return String That contains the properties
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propnames;
}
@@ -240,10 +239,8 @@ public class ChildrenRetriever {
/**
* Print all properties out contained in vector .
- *
- *@param Vector
*/
- public void printLine( Vector<Object> props ) {
+ public void printLine( ArrayList<Object> props ) {
int limit;
while ( !props.isEmpty() ) {
String print = "";
@@ -305,7 +302,7 @@ public class ChildrenRetriever {
ChildrenRetriever access = new ChildrenRetriever( args );
// Get the properties Title and IsFolder for the children.
- Vector<Vector<Object>> result = access.getChildren();
+ ArrayList<ArrayList<Object>> result = access.getChildren();
String tempPrint = "\nChildren of resource " + access.getContentURL();
int size = tempPrint.length();
@@ -318,9 +315,9 @@ public class ChildrenRetriever {
if ( result != null && !result.isEmpty() ) {
- Vector<Object> cont = new Vector<Object>();
+ ArrayList<Object> cont = new ArrayList<Object>();
cont.add("URL:");
- Vector<String> props = access.getProperties();
+ ArrayList<String> props = access.getProperties();
size = props.size();
for ( int i = 0; i < size; i++ ) {
Object obj = props.get( i );
@@ -329,8 +326,7 @@ public class ChildrenRetriever {
}
access.printLine(cont);
System.out.println( "\n" );
- for ( Enumeration<Vector<Object>> e = result.elements(); e.hasMoreElements(); ) {
- Vector<Object> propsV = e.nextElement();
+ for ( ArrayList<Object> propsV : result ) {
access.printLine( propsV );
}
}
diff --git a/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java b/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
index 794502262ff2..19a11139bad8 100644
--- a/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
+++ b/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
@@ -32,7 +32,7 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import com.sun.star.beans.PropertyValue;
@@ -49,8 +49,8 @@ public class PropertiesComposer {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propNames = new Vector<String>();
- private Vector<String> m_propValues = new Vector<String>();
+ private ArrayList<String> m_propNames = new ArrayList<String>();
+ private ArrayList<String> m_propValues = new ArrayList<String>();
/**
* Constructor.
@@ -89,22 +89,22 @@ public class PropertiesComposer {
*/
public Object[] setProperties()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
- Vector<String> propertyValues = getPropertyValues();
+ ArrayList<String> properties = getProperties();
+ ArrayList<String> propertyValues = getPropertyValues();
return setProperties( properties, propertyValues );
}
/**
* Set values of the properties.
*
- *@param Vector Properties
- *@param Vector Properties value
+ *@param properties
+ *@param propertiesValue
*@return Object[] Returns null or instance object of com.sun.star.uno.Any
* if values successfully seted, properties otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Object[] setProperties( Vector<String> properties, Vector<String> propertiesValues )
+ public Object[] setProperties( ArrayList<String> properties, ArrayList<String> propertiesValues )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
Object[] result = null;
@@ -161,7 +161,7 @@ public class PropertiesComposer {
*
*@return Vector That contains the properties names
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propNames;
}
@@ -170,7 +170,7 @@ public class PropertiesComposer {
*
*@return Vector That contains the properties values
*/
- public Vector<String> getPropertyValues() {
+ public ArrayList<String> getPropertyValues() {
return m_propValues;
}
@@ -263,8 +263,8 @@ public class PropertiesComposer {
try {
PropertiesComposer setProp = new PropertiesComposer( args );
- Vector<String> properties = setProp.getProperties();
- Vector<String> propertiesValues = setProp.getPropertyValues();
+ ArrayList<String> properties = setProp.getProperties();
+ ArrayList<String> propertiesValues = setProp.getPropertyValues();
Object[] result = setProp.setProperties( properties, propertiesValues );
String tempPrint = "\nSetting properties of resource " + setProp.getContentURL();
diff --git a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
index 49f0fa2a3604..002d5c4e6cc2 100644
--- a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
@@ -32,13 +32,13 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import com.sun.star.beans.Property;
+import com.sun.star.sdbc.XRow;
import com.sun.star.ucb.XContent;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.sdbc.XRow;
/**
@@ -52,7 +52,7 @@ public class PropertiesRetriever {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propNames = new Vector<String>();
+ private ArrayList<String> m_propNames = new ArrayList<String>();
/**
* Constructor.
@@ -87,9 +87,9 @@ public class PropertiesRetriever {
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Object> getPropertyValues()
+ public ArrayList<Object> getPropertyValues()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
+ ArrayList<String> properties = getProperties();
return getPropertyValues ( properties );
}
@@ -101,9 +101,9 @@ public class PropertiesRetriever {
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Object> getPropertyValues( Vector<String> properties )
+ public ArrayList<Object> getPropertyValues( ArrayList<String> properties )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<Object> m_propValues = null;
+ ArrayList<Object> m_propValues = null;
if ( m_content != null && properties != null && !properties.isEmpty() ) {
int size = properties.size();
@@ -124,7 +124,7 @@ public class PropertiesRetriever {
UnoRuntime.queryInterface(
XRow.class, m_helper.executeCommand( m_content,"getPropertyValues", props ));
- m_propValues = new Vector<Object>();
+ m_propValues = new ArrayList<Object>();
/*
Extract values from row object. Note that the
@@ -155,7 +155,7 @@ public class PropertiesRetriever {
*
*@return Vector That contains the properties
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propNames;
}
@@ -222,8 +222,8 @@ public class PropertiesRetriever {
"--------------------------------------------------------------" );
try {
PropertiesRetriever obtProperty = new PropertiesRetriever( args );
- Vector<String> properties = obtProperty.getProperties();
- Vector<Object> propertiesValues = obtProperty.getPropertyValues( properties );
+ ArrayList<String> properties = obtProperty.getProperties();
+ ArrayList<Object> propertiesValues = obtProperty.getPropertyValues( properties );
String tempPrint = "\nProperties of resource " + obtProperty.getContentURL();
int size = tempPrint.length();