-
Key: DDSJAVA-4
-
Legacy Issue Number: 16056
-
Status: closed
-
Source: Thales ( Andre Bonhof)
-
Summary:
Currently the DataReader provides read() and take() methods that return a special type of java.util.ListIterator: Sample.Iterator. The Iterator is not the most convenient way to access data retrieved from the DataReader (e.g. an Iterator can only be traversed once).
Propose to modify all read()/take() operations currently returning an Iterator to let them return a java.util.List. The List is more developer friendly, as it can be traversed multiple times and a List is also an Iterable with the added benefit that it can be used in Java’s “foreach” statement:
List<Sample<TYPE>> data = dataReader.read();
for (Sample<Type> sample : data)
{ // ... } -
Reported: DDS-Java 1.0b1 — Thu, 10 Mar 2011 05:00 GMT
-
Disposition: Resolved — DDS-Java 1.0b2
-
Disposition Summary:
Merge this issue with #16321, which proposes other changes to the read/take overloads.
Overloads that return a loan should do so in the form of a ListIterator implementation, which will allows multiple forward and backward navigation of elements. The loaned samples should not be returned as a List, as retrieving an iterator from a list would force critical-path memory allocationin direct contradiction of the low-latency goal of the loaning operations.
Overloads that return a copy should continue to accept a List to be filled in and should return a reference to the same list for convenience. These overloads will therefore support the “for-each” construct requested by this issue.
Disposition: Merged with issue #16321 -
Updated: Fri, 6 Mar 2015 20:58 GMT
DDSJAVA — Data access from DataReader using java.util.List
- Key: DDSJAVA-4
- OMG Task Force: Java 5 Language PSM for DDS 1.0 FTF