aspose file tools*
The moose likes Java in General and the fly likes Advanced collection class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Advanced collection class" Watch "Advanced collection class" New topic
Author

Advanced collection class

shan raj
Ranch Hand

Joined: Dec 16, 2008
Posts: 42
Hi,

I would like to know is there any build in or third party collection class(to perform all operations in the collection interface) which can store the inserted items into the temp file if it exceeds the buffer size(e.g: 500). For e.g, if I am inserting 501 item into the collection class then it has to go into the file instead of having into the memory. While deleting the element in the memory, the element in the file has to be filled in the memory till it reaches the buffer size.

Thanks in Advance.
Shan
shan raj
Ranch Hand

Joined: Dec 16, 2008
Posts: 42
Second try !

Any one please suggest.

Regards
Shan
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
I presume you have tried places like Jakarta Commons? I have never heard of such a class. You could have written your own in the time you were waiting for us to say "don't know".
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

I don't think there is such a collection. Like Campbell said, you can create it yourself. Keep in mind that iterating may be harder than usual since you need to check the file as well. You will also run into synchronization problems if you try to read from the file and write to it at the same time.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
shan raj
Ranch Hand

Joined: Dec 16, 2008
Posts: 42
Thanks you very much. I have started implementing my own custom collection class

one question here, when I use file better to keep the file stream object open for ever or open and close when ever it required.

Regards
Shan
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Keeping it open will lock that file and preclude other code from accessing it. Also there may be a limit to how many file streams the JVM can support, so you might do well to close it if it is idle.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advanced collection class