element « iterator « Java Collection Q&A

Home
Java Collection Q&A
1.algorithm
2.array
3.Array Byte
4.Array Char
5.Array Convert
6.Array Dimension
7.Array Integer
8.Array Object
9.Array String
10.ArrayList
11.collection
12.comparator
13.Development
14.Garbage Collection
15.Generic
16.hash
17.HashMap
18.HashTable
19.iterator
20.LinkedList
21.List
22.Map
23.queue
24.Set
25.Sort
26.tree
Java Collection Q&A » iterator » element 

1. Java: adding elements to a collection during iteration    stackoverflow.com

Is it possible to add elements to a collection while iterating over it? More specifically, I would like to iterate over a collection, and if an element satisfies a certain condition I ...

2. parallel computation for an Iterator of elements in Java    stackoverflow.com

I've had the same need a few times now and wanted to get other thoughts on the right way to structure a solution. The need is to perform some operation ...

3. Iterator has .next() - is there a way to get the previous element instead of the next one?    stackoverflow.com

I have an Iterator that I use on a HashMap, and I save and load the iterator. is there a way to get the previous key in the HashMap with Iterator? (java.util.Iterator)

Update

I ...

4. Set.size() doesn't match the number of elements in iterator    stackoverflow.com

Why doesn't Set.size() match the number of elements in the set's iterator? I'm using a HashSet, and I added some duplicate values. Those duplicates were automatically eliminated since I used a ...

5. Java Set iterator, safe for removal of elements?    stackoverflow.com

I would like to iterate over a Set and remove the elements from the set that match some condition. The documentation of iterator says nothing about modifying the list ...

6. How do I "peek" the next element on a Java Scanner?    stackoverflow.com

That is, how do I get the next element of the iterator without removing it? As I may or may not want to remove it depending on its content. I have ...

7. Get a random element from a sequential collection    stackoverflow.com

I talk to an API that gives me an java.util.Iterator over a collection. That means I can iterate over it but I can't get direct/random access to the elements. Now to my ...

8. How can I access elements in a java collection beyond my iterator without "losing my place"?    stackoverflow.com

I have created a class called Month that extends Calendar, which I am using to hold events for a given month. I have several years worth of Month objects stored in ...

9. Iterator does not return the Element Object or does not Cast to its corresponding object?    stackoverflow.com

Could someone please tell me why the Iterator in this code does not return with he Element Object?!? Can't cast to Element Object! This is a JDOM implementation of SAX!

 ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.