DDS-Java 1.0b2 FTF Avatar
  1. OMG Issue

DDSJAVA — Data access from DataReader using java.util.List

  • 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 =;

    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 allocation—in 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