• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • 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..
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic