Thread View: comp.lang.java.programmer
5 messages
5 total messages
Started by Cathy Berthouzoz
Fri, 20 Mar 1998 00:00
indexed sequential files
Author: Cathy Berthouzoz
Date: Fri, 20 Mar 1998 00:00
Date: Fri, 20 Mar 1998 00:00
13 lines
1160 bytes
1160 bytes
Does anybody knows if there is any available java class to manage indexed sequential files? Thanks a lot Cathy -- Cathy Berthouzoz LATL-Dépt. de Linguistique Université de Genève 2 rue de Candolle 1203 Genève tel. ++41227057332 fax. ++41227057931
Re: indexed sequential files
Author: Peter van der Linden
Date: Fri, 20 Mar 1998 00:00
Date: Fri, 20 Mar 1998 00:00
24 lines
1797 bytes
1797 bytes
>Does anybody knows if there is any available java class to manage
>indexed sequential files?
There is no standard java.io.* class to do this.
I have not heard of anyone writing one, but a search on Gamelan
may yield more info.
I bet it would be very simple to whisk up the basics of Indexed Sequential
Access using a hashtable to store the key/offset pairs, and keeping
that hashtable in a separate file which is read in at the start of
processing. Use a random access file to store the data.
I might even have a go at whisking it up this weekend.
The basics would take less than an hour but all the corner cases
would probably take a couple of months.
Peter
--
pvdl@best.com Java Programmer's FAQ at: http://www.afu.com
Trying does not guarantee success, but not trying guarantees failure.
The trampoline that does not bend your brain is not the true trampoline.
Re: indexed sequential files
Author: Christopher Clark
Date: Mon, 23 Mar 1998 00:00
Date: Mon, 23 Mar 1998 00:00
28 lines
2125 bytes
2125 bytes
Peter van der Linden wrote:
> >Does anybody knows if there is any available java class to manage
> >indexed sequential files?
> I have not heard of anyone writing one, but a search on Gamelan
> may yield more info.
Actually, there's a book out in bookstores (entitled "Java
Algorithms", I think), that builds a basic indexed-sequential file
structure with a B-Tree and Serialization as the data format. As
somebody who never gets a clear answer as to what data to store
initially, I LIKE THIS!
> I bet it would be very simple to whisk up the basics of Indexed
> Sequential Access using a hashtable to store the key/offset pairs, and
> keeping that hashtable in a separate file which is read in at the
> start of processing. Use a random access file to store the data.
Umm... Hashtables aren't an ordered storage, which would make the
sequential part difficult...
@>-`--,--
Chris Clark kitanin@hotmail.com
Compudata Systems Consulting, Inc. compudat@cadvision.com
ICQ#9342023
"Now, I wonder who the deuce that could have been?"
-Sherlock Holmes
Re: indexed sequential files
Author: Peter van der Linden
Date: Mon, 23 Mar 1998 00:00
Date: Mon, 23 Mar 1998 00:00
17 lines
1590 bytes
1590 bytes
Christopher Clark <compudat@cadvision.com> wrote: > Actually, there's a book out in bookstores (entitled "Java >Algorithms", I think), that builds a basic indexed-sequential file >structure with a B-Tree and Serialization as the data format. As >somebody who never gets a clear answer as to what data to store >initially, I LIKE THIS! Thanks for the reference. > Umm... Hashtables aren't an ordered storage, which would make the >sequential part difficult... Good point. Maybe define an enumeration on the hastable as well. Or -- if you restrict to fixed length records -- just read the file using an input stream.
Re: indexed sequential files
Author: Christopher Clark
Date: Tue, 24 Mar 1998 00:00
Date: Tue, 24 Mar 1998 00:00
30 lines
2214 bytes
2214 bytes
Peter van der Linden wrote:
> Christopher Clark <compudat@cadvision.com> wrote:
> > Umm... Hashtables aren't an ordered storage, which would make the
> >sequential part difficult...
> Good point. Maybe define an enumeration on the hastable as well.
> Or -- if you restrict to fixed length records -- just read the file
> using an input stream.
AFAIK, an Enumeration on the Hashtable just returns them in hashcode
order. Great as an "annoy client" and-or "pseudo-random" switch, but
not very practical. OTOH, a JDK1.2 TreeMap works nicely, if a bit too
deep for index purposes.
Personally, I'd extend what I saw in "Java Algorithms" to accept a
RandomAccessFile and a (1.2) Map. Then, you can tailor your index to
you intended access. (Mind you, I also like hitting myself in the head
with bricks...)
LE E.
It's just so F X L .
IB . :-)
@>-`--,--
Chris Clark kitanin@hotmail.com
Compudata Systems Consulting, Inc. compudat@cadvision.com
ICQ#9342023
"Now, I wonder who the deuce that could have been?"
-Sherlock Holmes
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads