Is there a class for this?

I'm trying to store a collection of data in which certain elements are removed after they've been present for a certain period of time. Some items live longer than others. What I want is to retrieve these items in roughly the same order every time.
Let's say that I start with 1 2 3 4 5 6 7 8 9 10. Then 4 times out, and 11 comes in. I want retrieve them as 1 2 3 11 5 6 7 8 9 10.
I could write my own class for this, but I'd rather not have to if something like this exists. Any help would be greatly apreciated.

Let's examine your problem carefully
You want to have some data structure that behaves like a list, but insertion order is not at a fixed position, but preferrably at "erased" positions (like a disk using the FAT file system).
java.util.ArrayList will not do the job nicely , nor java.util.LinkedList - you will need to maintain a lot of pointers.
Probably you will have to write a class that borrows the idea from the FAT file system - you have an (almost) fixed-size array representing the data. If you want to remove an item, simply set its reference to "null" in the array.
If you want to insert a new item, you need to find the first (or last - depends on your needs and if it is better to move less or more items on screen) empty slot.
If your data requires more elements than your array size, you must copy the array into a bigger array, and release the older array.

Similar Messages

Maybe you are looking for

  • C# Script to open and read an Excel spreadsheet with multiple worksheets

    Can someone provide me the C# syntax and Edit Script to open an Excel spreadsheet with multiple worksheets and then using the data to create and output a .csv file? The multiple worksheets contain different data elements that I'll need to parse out a

  • Has anyone updated to 10.5.3 yet?

    Have you done it? Frankly, I'm terrified. I've had so much trouble getting the darn thing to work that i don't want to mess it up! I rely on that thing for ichat, radius auth, dns, and a couple other things. though, i never did get ical server workin

  • Cannot install drivers in win 7 32 bits using bootcamp 4 or 5

    I posted this question yesterday. anyway, I have a imac midi 2011, 21,5 inches using OS x mountain lion 10.8.2. Manuals say I have to install bootcamp 4, because I install windows 7 profesional 32 bits. Al follow all this instalation requirements, bu

  • Configuring mod_wl_ohs for OHS to weblogic

    Hello, I'm trying to configure SSL between OHS and a weblogic application server. I've been through various docs and threads, but cannot seem to find the answer to the problem. I can pull up a ssl page on the app server itself, and see that it's secu

  • Error handling for SAP dumps

    In my custom funstion module some where the code is written like below for marc table read   CALL FUNCTION 'MARC_SINGLE_READ'        EXPORTING             matnr = matnr             werks = werks        IMPORTING             wmarc = lv_marc What I nee