Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Navigating a Vector: msg#00005

java.bio.general

Subject: Re: Navigating a Vector

mark.schreiber@xxxxxxxxxxxxxxxxxx wrote:
I'm not sure you can, especially because iterators on Vectors are not gaurenteed to operate in any special order. If possible you should use an ArrayList or LinkedList. In this case you will be able to find the index or even ask for items by their index.

While order is not guuranteed, you can actually loop over a Vector using a for loop and the Vector elementAt(int index) method. Besides, if you create a [Array|Linked]List from the Vector, you would get the same order. If you want to use an Iterator, Vector implements the iterator() method as well.

The only difference between Vector and ArrayList is that Vector is synchronized (threadsafe) and ArrayList is not.

http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html

Thanks,
Rahul
_______________________________________________
Biojava-l mailing list - Biojava-l@xxxxxxxxxxx
http://biojava.org/mailman/listinfo/biojava-l



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo