Logo Search packages:      
Sourcecode: wims version File versions  Download package

rene::util::MyVector Class Reference

Inherits java::util::Enumeration.

List of all members.

Detailed Description

This is a more effective replacement of the Vector class. It is based on a growing array. If an object is removed, it is replaced by null. The class knows about the first null object (the gap). Searching for elements or other operations automatically compress the array by copying the elements upwards, but only as far as they need to go anyway.

Accessing an element is very effective, at least the second time. If you want to make sure, it is always effective, compress first. The most effective way is to get the object array itself.

The objects can be enumerated. The object returned by nextElement() is found very rapidly. E.g. it can be deleted at once.

Enumeration is not reentrant. Do it only once each time.

Nothing in this class is synchronized!

Definition at line 25 of file MyVector.java.

Public Member Functions

void addElement (Object o)
void compress ()
void copyInto (Object o[])
Object elementAt (int n)
Enumeration elements ()
boolean equals (MyVector V)
boolean equalsIdentical (MyVector V)
void extend ()
Object[] getArray ()
boolean hasMoreElements ()
int indexOf (Object o)
 MyVector (int initsize)
Object nextElement ()
void removeAllElements ()
void removeElement (Object o)
int size ()
void truncate (int n)

Static Public Member Functions

static void main (String args[])

Package Attributes

int EN = 0
int Gap
Object O []
int OLast
int ON
int OSize

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index