Minor cleanup for builder API (KeyValueReader -> KeyValueSource)

13 views
Skip to first unread message

tsaloranta

unread,
Dec 14, 2010, 3:06:44 PM12/14/10
to ning-tr13-users
Ok after having had to re-read code I wrote earlier (thanks Brian!), I
realized that builder API was a complete mess. This was due to
incomplete refactoring when adding ability to create both byte[] and
VInt valued tries; some code was still assuming values are always
Strings (with conversions to/from byte[]).

Anyway: I ended up adding "KeyValueSource" interface which is the
minimal thing needed for building tries, and is extended by
KeyValueReader (existing class) that does so from a textual stream-
based source (like File).
While building process could still use some more cleanup, at least it
should make some sense now.

Main usage examples can be found from unit tests; for example, src/
test/java/com/ning/tr13/read has "BytesTrieLookupTest" which shows
basic build process from a text file.

-+ Tatu +-
Reply all
Reply to author
Forward
0 new messages