j2me in the vector
On the vector, was easier to use, can be added to different instances of different classes. Faster. When I used String PIM storage array storage or rms, when reading contacts speed particularly slow, then even without contact information. Will soon be replaced by vector contact information of the. addelement add information to the vector which, with elementat (i) function to show that the vector inside the first i +1 a value, insertElementAt insert a value, by removeElementAt (n) can remove an element from a vector. Finally can removeAllElements () Remove all the elements. Vector can view the contents of the specific api (see more recommendations api, watching and writing process to achieve), the following is the vector of the api I just see when the vector used to write their own procedures.
/ *
* VectorMidlet.java
*
* Created on 2007 ??9 17, 11:45 AM
* /
package Vectortest;
import javax.microedition.midlet .*;
import javax.microedition.lcdui .*;
import java.util.Vector;
public class vectorMidlet extends MIDlet (
private Form form;
private Vector aVector;
private Display display;
private int bool;
private String s1;
private String s [];
public void startApp () (
bool = 1;
s1 = “try”;
display = Display.getDisplay (this);
form = new Form (”Vector test”);
aVector = new Vector (10,10);
form.append (String.valueOf (aVector.capacity ()));
aVector.addElement (String.valueOf (bool));
aVector.addElement (”hello”);
aVector.addElement (”0″);
if (aVector.size ()> 0)
(
form.append (String.valueOf (aVector.size ()));
form.append (aVector.elementAt (0). toString ());
)
for (int i = 1; i < = 21; i + +)
(
aVector.addElement (String.valueOf (i));
)
form.append (String.valueOf (aVector.capacity ()));
aVector.removeElementAt (aVector.lastIndexOf (”1″));
form.append (aVector.toString ());
for (int i = 0; i
(
if (aVector.elementAt (i). equals (”1″))
(
/ / Form.append (”sucess”)
/ / Form.append (aVector.toString ());
aVector.removeElement (”1″);
)
)
aVector.insertElementAt (”insert”, 5);
aVector.trimToSize ();
form.append (String.valueOf (aVector.size ()));
/ / String s [24];
/ / AVector.copyInto (s);
/ / For (int i = 0; i
/ / Form.append (s [i]);
form.append (aVector.toString ());
aVector.removeAllElements ();
display.setCurrent (form);
)
public void pauseApp () (
)
public void destroyApp (boolean unconditional) (
)
)
The last tip we are all, vector more suitable for reading data, if you add or remove elements may be quite slow
????:
“Two” A Dell: Whose Heart Hurt
evaluation Covert Surveillance
gghost a key support for windows 7 x64 Recovery 09
To Yushu in Qinghai Province earthquake in MOURNING the dead and injured
Orient Securities Executive Assistant Shu Wang: grab the share of off-site transactions
FreeBSD Serial (93): reverse proxy load balancing
Terminal And Telnet Clients INTRODUCTION
“Aion” 1.2 There are a brush obs of the bug is still alive
Watch cool mechanical picture production process
