diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 13:46:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:45:46 +0200 |
commit | e10300dc786beaaa1b126054100d0195a9298b67 (patch) | |
tree | 9f9ee6ff64db17df7af7bcf57c78dcf9f29a2cb2 /odk | |
parent | f8135956a81f95204ab0dbde7f7fd42652f70c74 (diff) |
use generics and convert from Vector to ArrayList
Change-Id: Idcc7d0c386ff59ddee95667939969259cdf11d02
Diffstat (limited to 'odk')
-rw-r--r-- | odk/examples/DevelopersGuide/Forms/InteractionRequest.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/odk/examples/DevelopersGuide/Forms/InteractionRequest.java b/odk/examples/DevelopersGuide/Forms/InteractionRequest.java index 65dbba1af217..b4ba24e27d16 100644 --- a/odk/examples/DevelopersGuide/Forms/InteractionRequest.java +++ b/odk/examples/DevelopersGuide/Forms/InteractionRequest.java @@ -32,8 +32,10 @@ * *************************************************************************/ -import com.sun.star.task.*; -import java.util.Vector; +import java.util.ArrayList; + +import com.sun.star.task.XInteractionContinuation; +import com.sun.star.task.XInteractionRequest; /**************************************************************************/ /** helper class for implementing an interaction request. @@ -41,13 +43,13 @@ import java.util.Vector; class InteractionRequest implements XInteractionRequest { private Object m_aRequest; - private Vector m_aContinuations; + private ArrayList<XInteractionContinuation> m_aContinuations; /* ------------------------------------------------------------------ */ public InteractionRequest( Object aRequest ) { m_aRequest = aRequest; - m_aContinuations = new Vector(); + m_aContinuations = new ArrayList<XInteractionContinuation>(); } /* ------------------------------------------------------------------ */ @@ -66,10 +68,7 @@ class InteractionRequest implements XInteractionRequest /* ------------------------------------------------------------------ */ public XInteractionContinuation[] getContinuations( ) { - XInteractionContinuation[] aContinuations = new XInteractionContinuation[ m_aContinuations.size() ]; - for ( int i=0; i<m_aContinuations.size(); ++i ) - aContinuations[ i ] = (XInteractionContinuation)m_aContinuations.elementAt( i ); - return aContinuations; + return m_aContinuations.toArray( new XInteractionContinuation[ m_aContinuations.size() ] ); } }; |