Comment 2 for bug 1042960

Revision history for this message
Nathan Williams (nwilliams) wrote :

There are something like 120 public methods on Value, 95 of which deal with the objects contained in it (put, get, isNull, etc). A good chunk of those, are as Peter mentions, dealing with primitives explicitly. I don't foresee those going away any time soon, though, given Persistit's focus on performance and what we know about GC.

It would be nice to make the API as use friendly as possible. Once a user knows about stream mode, I think all of the put and get methods are pretty obvious. That leaves decodeDisplyable, isType, getCursor, setCursor, isNull, getType, hasMoreItems, and skip (I think).

Some of these don't document their stream behavior (decodeDisplyable, isType, getCursor, setCursor, isNull, getType), some of them don't properly handle stream and error conditions (isType, isNull, getType) and some are not defensive enough outside of stream (hasMoreItems).

After more thought, I think I'm of the opinion that isNull() should not take a flag but that all the "query only" methods should be documented, and fixed, to act only on the current position in stream mode.