Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

RecordEnumeration. nextRecordId()

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Fellas,

Once a Record Store has been enumerated, there are many methods provided under RecordEnumeration Interface to maniputlate the enumeration...

One such a couple is, int nextRecordId() and int previousRecordId()

I will take int nextRecordId() to convey my problem...

this when invoked on record enumeration, returns the Record ID as an int...
The interesting part is, it advances the pointer too, to the position indicated by the return record ID..

since there isn't a "public byte[] getRecord()" defined by RecordEnumeration interface.... what use do we establish by the getting the record ID of the next element at the cost of pointer advancement...

please state a few usages of the above in practice..

Thanks in advance
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its funny... Never really thought about the advantages... was a bit frustated by this myself but then moved on and implemented the reading logic the way its done in the tutorials available.
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RecordEnumeration does not provide a getRecord() operation,
but RecordStore does ...

You can do the following:



Of course RecordEnumeration provides nextRecord() too, but the code above is useful if you want to access in each iteration both the record data and its id.
[ January 28, 2007: Message edited by: Eduardo Marques ]
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thats why you need expert...

Thats a useful implementation point..

Thanks folks..
 
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic