Hardcoding an extremely large ArrayList?
807605Jun 22 2007 — edited Jun 22 2007Hi everybody,
I've come up with a weird idea, and I have no clue if it's even remotely possible or rational, but here goes--
I have an extremely large arraylist, which is...let's see...an arraylist of arraylist of arraylist of arraylist. (whew!) Basically, it's 4 levels of an arraylist<String> nested, representing formatted sections of a paragraph, inside paragraphs, inside pages, inside chapters. I'd like to be able to hard-code this somehow into my program, so the user doesn't have to input the raw text file all the time. Basically, I'm looking to create a completely self-contained program, something like an ebook, which will eventually be wrapped in a .exe wrapper.
The only way I can think of to hard-code this big arraylist is to write every single call and insertion into each arraylist, which would take an extremely long time and be a real pain. I imagine that creating the arraylist when the program runs would be easier, like with a BufferedReader, but I don't know if there's a way to include a text file in a jar or class so it's self-contained and doesn't require any user input. Can anyone give me a hand with how, conceptually, I might be able to do this?
Thanks,
Jezzica85