Whats the best way to expose this in memory database? (ArrayList)

Hello everyone.
I was looking for advice on how I should implement this...currently I have the following ArrayList that stores ClassEntity objects. I'm going to write 2 classes that need to access this ClassEntity Object arrayList because they are goign to use these objects to spit out 2 different files.
I didn't want to make the database public and static though.
Here's a snippet of my current class that populates and creates the arrayList data structure:
public class RODMFileParser
     //used to keep file information
     ClassEntity classEntity = null;
     //used to store ClassEntity objects
     List<ClassEntity> classEntityList = new ArrayList<ClassEntity>();
     //used to store the conversion table RODM->ENGLISH/ENGLISH->RODM
     ConversionTableParser convTableParser = new ConversionTableParser();
        else if(line.contains("Field Value "))
                    //now we can create a new Entity Class object! tricky! huh
                    classEntityList.add(new ClassEntity(idClassName,  idFieldName,
                                                                   englishClassName, englishFieldName, fieldType));
Iterator listIter = classEntityList.iterator();
          while(listIter.hasNext())
               ClassEntity tempObj = (ClassEntity) listIter.next();
               System.out.println(tempObj);
          }So now classEntityList has all the objects I need to create these 2 seperate files but these 2 files are dramtically different. What would be the best way at exposing this classEntityList ArrayList so my 2 other classes can access it?
Thanks!

well if I made it non-static, wouldn't I have to create a new object of that class in each class I want to use it in?
for example, that class that populates the database must parse a file to create the database.
RODMFileParser file = new RODMFileParser();
          file.parseFile("QAGENT");So inside each class I would have to do this wouldn't I? if I made it public static, wouldn't I only have to read to the disk once?
Putting it to a worst case say, 100 classes need this database, that means I would have to make 100 accesses to the disk woulnd't it?
And if it was public static, it would jsut return a copy of the database that was only read from the disk once or am I misunderstanding how it works?

Similar Messages

  • I want to connect a Mac mini to a Samsung 40", Whats the best way to do this?

    I want to connect a Mac mini to a Samsung 40" LED tv to use as the monitor, whats the best way of doing this?

    Understand that there is one HDMI port on your TV that is specifically designated for PC connectivity. The order that the TV or Mini are powered on may determine your results. For your specific TV model, check buyer reviews on Amazon or elsewhere that can include optimum TV/Computer settings adjustment for improved viewing results.

  • I want to run Quicken through Windows on my macbook pro, whats the best way to do this?

    I want to run Quicken 2012 through Windows on my macbook pro, whats the best way to do this?
    I have been looking at Parallels or VMware in order to use Windows but then I will also need to get a Windows license. Just looking for the most inexpensive way possible as this will probably be the only Windows app I run.
    Also looking at this CrossOver software which says you dont need Windows license. Anyone used this before? had success?

    CrossOver's website has a list of software it has certified as working or working with known issues - Quicken 2012 has a bronze rating meaning it runs but with enough issues that it isn't recommended. In other words, "Run away!"
    Get a copy of Windows 7 OEM from Amazon or New Egg and give it a try with VirtualBox (an open source virtualization program). If VirtualBox doesn't cut it you can always buy VMWare or Parallels.

  • My business has 100 ipads 3g with no control at the moment - i need to now control the ipads - what apps they can use - and restict certian use on the ipads - whats the best way to do this - it will need to be done remotley.

    my business has 100 ipads 3g with no control at the moment - i need to now control the ipads - what apps they can use - and restict certian use on the ipads - whats the best way to do this - it will need to be done remotley.

    MDM  -- moble device management 
    MDMs
    Airwatch, Meraki, MobileIron, Profile Manager on OS X Server, or Zenprise
    For a comparison see this page:
    http://www.enterpriseios.com/wiki/Comparison_MDM_Providers
    Airwatch
      http://www.air-watch.com/
    Meraki -- A free MDM   [ expect lots of email and phone calls about upgrades ]
      http://www.meraki.com/products/systems-manager/
      https://discussions.apple.com/thread/4067210?tstart=0
      Good howto by Sergio Sosa.
      https://discussions.apple.com/thread/2594001?start=15&tstart=0
    MobileIron
      http://www.mobileiron.com/
    Profile Manager by Apple
    Zenprise
      http://www.zenprise.com/

  • URGENT - Items archiving in Portal - Whats the best way to do this ?

    Gurus,
    My client has following requirement -
    - The client has lots and lots of content.
    - The content must show on site for 6 months.
    - After 6 months, the content goes to archives (meaning - it does not show on site, but that does NOT mean its deleted - its kind of hidden)
    - The archive content must be searchable
    - After 4 years some content expires while some of it remains in archive forever
    Currently, the client stores the content on a file system and there is a process that moves the items after 6 months to an archiving area and after 4 years some content is deleted and some is retained forever.
    What is the best way to approach this requirement ?
    If there is a solution how to move their existing system (content valid for 6 months and archives for last 4 yrs) to portal ?
    Any help would be greatly appreciated.
    Thanx
    Hero

    There are a couple of ways to do this:
    1. If the items are all file items and don't have extended attributes, you can just use WebDAV to move the items to an archive location (can be another page or a file system). Use a WebDAV command line utility like sitecopy, combined with the WWSBR_ALL_ITEMS view to select the content. sitecopy should be able to select items based on their last modified date, so you may not have to use the view.
    2. If you also want to archive the attributes, or if the items include non-file items, you'll need to use the content management APIs to copy the items to an archive page. Currently there is no delete API, so once you've copied the items you'll have to expire the originals and then manually purge them.
    Regards,
    Jerry
    PortalPM

  • I need help entering ALL of my addresses for Christmas card address labels on my new iMac.  Whats the best way to do this?

    Anyone have any tips how to get started with address labels?  I went to my address book, but it looks so time intensive.  Can I mail merge addresses I put into a excell spread sheet to print labels?? 

    Don't waste your time with formatting in any of those programs - creating two pages for cards, blah blah blah.
    The best way to mail merge on a mac is using address book.
    People think merging got harder, but apple made it easier - more intuitive. You don't merge mailing labels through a word processor - you do it through the program which houses the addresses.  If the addresses aren't in address book yet, that's a snap.
    First, go to your program/file with the addresses (pages, numbers, excel, etc.). I think it's easiest to use numbers.
    make sure the column headings are set to Mac Address Book Standard Names - that way you won't have to spend too much time mapping them in address book. (if you're not sure what those are - open address book and just a view a card/record, or open pages or numbers and search in the help menu for the term "merge field names" and it will give you a list. They're pretty simple - things like "First Name" "Last Name" "Street Address" etc.
    For christmas cards, I add an extra column under the heading "Note" and input "Christmas Card List" for every record.
    Once your data is formatted with the correct column names, export the list to a csv file.
    Open Address book in mac and import the list - make sure the columns match up with the correct fields.
    It might ask if you want to overwrite or update - that's up to you.
    If you know your christmas card list has the most recent address info, hit update.
    Once the import is done it should take you to the front page for the address book in which you'll be given the choice to view Icloud addresses (if you sync those) and also the Last import. Any groups or smart groups you have will show up in the list too.
    Click on Last import - make sure all the addresses and names you just imported are there. If not, something went wrong - go back and check your import field mapping. If all's good, keep rollin'. (it helps to scroll to the bottom of the import list to get the count of imported records)
    Here, you can do one of two things - create a group or a smart group.
    For a regular group - Highlight all the records on the right panel in your last import, then go to file > new group from selection. Rename your group christmas cards or something like that.
    I prefer to create smart groups.
    For that, goto file > new smart group. You'll come to a filter window. Click on the first drop down box and scroll to "Note." Then in the second drop down box choose "is" and in the third and final input box on the right, enter the text from the note column you created in the address list file. I used "Christmas Card List".
    That will create a smart group, such that any time you enter a new address or contact in the address book with the note field that equals "christmas Card list" it will automatically be entered into this group.
    Either way, you're only one step away from labels.
    With that Christmas Card List selected in address book, go to print. When the print dialogue box opens, make sure to click on the button for show details toward the bottom left. That will open up your choices for style.
    Under "Style" click on mailing labels.
    Under "Layout" choose your label layout (i use avery 5160). It will show you a picture of the label and you can tell if it's the right one.  You'll also notice the labels are being merged correctly, with one address per label, rather than one name for the entire page - like if you try to do this through pages.
    Print away.
    Hope that helps.
    Craig

  • Im buying a new macbook pro with 750 memory and want to dump all existing data, pic video on to hard drive.  Whats the best way to do this?

    How can i transfer my hard drive data from Macbook to new Macbook pro?  What's the best and fastest way, cable etc...

    Apple Tips: Setting-up a new Mac from an old one or its Backups Using Setup Assistant on Snow Leopard or Leopard
    How to use Migration Assistant to transfer files from another Mac

  • Hello, Help needed! I want to add an extra 4 bars of a new track in the middle of my project but I need all the remaining tracks to move over 4 bars if you know what I mean. Whats the best way to do this?

    Hello, I need to add 4 extra bars in the middle of one of my projects. Therefore all the tracks need to be split at that point and moved 4 bars further along. Is there an easy way to do this? I cant see a way without painstakingly splitting each track at that point, trying to move each of the tracks individually along by 4 bars and trying to line them all up exactly again. Ive tried this a few times but their not in exact sinc. Any help at all greatly appreciated! Thanks Declan

    Use the arrangement track. If you define arrangement regions, you can move sections of your song around, across all tracks.
    See this help text on how to add arrangement markers and to move arrangement regions:
    http://help.apple.com/garageband/mac/10.0/#gbnd8431c634

  • I have several 20,000+ point scatter plots that I'd like to graph with a best fit. Whats the best way to do this?

    Since they're so large and occupy the same range of y values, I'm kind of reluctant to plot them one over another so a best fit line would, I think, be the most helpful in analysing the data. I'm not quite sure however how to go about this since the data can be random

    Well, here's a very primitive way to decimate the data without any fancy algorithm. For this particular case, it looks pretty good. Each loop makes the array 3x smaller, averaging 3 adjacent elements. 4 iterations seem to be perfect. (I have included your raw data in diagram constants).
    For a polynomial fit, the more complex the data, the higher the order polynomial is needed to describe it. If it is a simple "banana" (my example above) you're OK with an order of 2 (up to quadratic), if it is s-shaped, you need at least 3rd order, etc. I tried your data with much higher orders (up to 40!) and it did not work.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Best_Fit2.vi ‏370 KB

  • Whats the best way to do this? Out of sync in middle of movie.

    Not real familiar with Soundbooth as I have just started using it. But here is what I have;
    I have a foreign video that I am trying to synch up with the english audio track (its an old movie and thankfully an animation so the synch does not have to be dead on).
    I have been able to get the begining of the movie (up to the 24 min. mark) and the end of the movie (from the 1 hr mark to 1:21) to line up fine. The problem is the middle part of the movie (from 25min to 1 hr) I am about 1.5 sec. too slow (IE the video is faster than the audio) I suppose the English audio added a bit of music or something to this part.
    I guess I have to cut the audio in 3 parts. The first from 0 to 24min and then from 24 min to 1 hr (here I will cut 1.5 sec from the beginning and add it to the end of the clip) and of course then I have the last clip from 1 hr to 1:21.
    I am pretty sure thats what I need to do - is there an easier way in Soundbooth?

    Not real familiar with Soundbooth as I have just started using it. But here is what I have;
    I have a foreign video that I am trying to synch up with the english audio track (its an old movie and thankfully an animation so the synch does not have to be dead on).
    I have been able to get the begining of the movie (up to the 24 min. mark) and the end of the movie (from the 1 hr mark to 1:21) to line up fine. The problem is the middle part of the movie (from 25min to 1 hr) I am about 1.5 sec. too slow (IE the video is faster than the audio) I suppose the English audio added a bit of music or something to this part.
    I guess I have to cut the audio in 3 parts. The first from 0 to 24min and then from 24 min to 1 hr (here I will cut 1.5 sec from the beginning and add it to the end of the clip) and of course then I have the last clip from 1 hr to 1:21.
    I am pretty sure thats what I need to do - is there an easier way in Soundbooth?

  • What is the best way is to implement a friend database

    Hi
    I was wondering what the best way is to implement a friend database. E.g. facebook where a person can have friends.
    Would you create a person table and a friendtable where each entry in the friendtable contains the owners personid and the friends personid?
    I would like to to view the picture of Darwin Cabigas Cano?
    Please..

    We call it as Database Design.
    Yes, you can have one table as Person and Friends table which should refer to your Person table.
    It should look like below: (Reference:
    Facebook Style Friend Request System Database Design )
    -Vaibhav Chaudhari

  • My old computer is dying and I want to transfer my account to my new computer.  I will not be using the old computer at all.  What is the best way do do this?

    I want to stop using my old computer completely and transfer my itunes account to my new computer.  What is the best way to do this?

    A simple search

  • I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. What is the best way to do this

    I am trying to make a pdf of a file and I need to get the file size to be no bigger than 10MB. Even when I save it, the image quality at minimum the file size is 10.9 MB. What is the best way to do this

    @Barbara – What purpose is that PDF for? Print? Web?
    If web purpose, you could convert CMYK images to sRGB. That would reduce the file size as well.
    A final resort to bring down file size is:
    1. Print to PostScript
    2. Distill to PDF
    That would bring file size down even more. About 20%, depending on the images and other contents you are using, compared with the Acrobat Pro method. If you like you could send me a personal message, so we could exchange mail addresses. I could test for you. Just provide the highres PDF without any downsampling and transparency intact. Best provide a PDF/X-4.
    I will place the PDF in InDesign, print to PostScript, distill to PDF.
    Uwe

  • HT1451 I need to move my library from my old computer to my new laptop. What's the best way to do this?

    I need to move my library from my old computer to my new laptop (Windows 8). What's the best way to do this?

    These are two possible approaches that will normally work to move an existing library to a new computer.
    Method 1
    Backup the library with this User Tip.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Restore the backup to your new computer using the same tool used to back it up.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase and reload.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    If you have an iOS device that syncs with contact & calendar data on your computer you should migrate this information too. If that isn't possible create a dummy entry of each type in your new profile and iTunes should offer to merge the existing data from the device into the computer, otherwise the danger is that it will wipe the information from the device.
    If your media folder has been split out from the main iTunes folder you may need to do some preparatory work to make it easier to move. See make a split library portable.
    Should you be in the unfortunate position where you are no longer able to access your original library, or a backup of it, then see Recover your iTunes library from your iPod or iOS device for advice on how to set up your devices with a new library with the maximum preservation of data. If you don't have any Apple devices then see HT2519 - Downloading past purchases from the App Store, iBookstore, and iTunes Store.
    tt2

  • I want to upgrade my Imac from tiger 10.4.11 to Mac OS 10.6 Snow Leopard. What is the best way to do this.

    I have just purchased an iphone 4 and it needs me to have the latest itunes on my computer.  I have not upgraded by computer for some time and thought this is probably the time to do it. My computer is an imac intel with Tiger 10.4.11. I want to upgrade my Imac from tiger 10.4.11 to Mac OS 10.6 Snow Leopard or higher.  What is the best way to do this?  Appreciate any help as I am out of practice. I used to be an old hand at this, but things have moved on since I didn't upgrade or use my computer as much!

    Catherina wrote:
    ...  What is the best way to do this?
    The best way, really the only way, is to purchase Snow Leopard.
    Online (UK): http://store.apple.com/uk/product/MC573/mac-os-x-106-snow-leopard
    Elsewhere: call the phone number in the Apple Online Store.
    Apple's price is $19.99, £14.00, €18.
    Snow Leopard is not available to download from any legitimate source.
    Once you install Snow Leopard, upgrade iTunes to version 10.7 or the latest, iTunes 11.
    iTunes 10.6.3 is the last version of iTunes to support Mac computers with Mac OS X 10.5.8 with either Intel or PowerPC processors, but since you have an Intel iMac, the best solution is to purchase Snow Leopard. Leopard is no longer available from Apple and prices from aftermarket vendors can be unreasonably high.

Maybe you are looking for