Object List (help please)

Hey, I was wondering how I could add objects to an array list as they are created. I have a class that consists of a method that creates "Room" objects and as each one is created I need to add it to an array list:
public static void createRooms()
        Room
                            a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,
                            a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,
                            a3,b3,c3,d3,e3,f3,g3,h3,i3,j3,
                            a4,b4,c4,d4,e4,f4,g4,h4,i4,j4,
                            a5,b5,c5,d5,e5,f5,g5,h5,i5,j5,
                            a6,b6,c6,d6,e6,f6,g6,h6,i6,j6,
                            a7,b7,c7,d7,e7,f7,g7,h7,i7,j7;
        a1=new Room("a1");
        a2=new Room("a2");
        a3=new Room("a3");
        a4=new Room("a4");
        a5=new Room("a5");
        a6=new Room("a6");
        a7=new Room("a7");
        b1=new Room("b1");
        b2=new Room("b2");
        b3=new Room("b3");
//etc.....
//and the room class:
public class Room
    private String description;
    private HashMap<String, Room> exits;
    public static Room currentRoom;
    public ArrayList roomList = new ArrayList();
    public Random numGEN = new Random();
    public Room(String description)
        this.description = description;
        exits = new HashMap<String, Room>();
        roomList.add(this);
    }What I need is for each room object's name to be added into the array list as a room object, so, roomList(0) = a1, roomList(1) = a2, etc...
Thanks

I already know how to
do arrays and array listsBased on this, I am included to disagree:
Room
                            a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,
                            a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,
                            a3,b3,c3,d3,e3,f3,g3,h3,i3,j3,
                            a4,b4,c4,d4,e4,f4,g4,h4,i4,j4,
                            a5,b5,c5,d5,e5,f5,g5,h5,i5,j5,
                            a6,b6,c6,d6,e6,f6,g6,h6,i6,j6,
                            a7,b7,c7,d7,e7,f7,g7,h7,i7,j7;
        a1=new Room("a1");
        a2=new Room("a2");
        a3=new Room("a3");
        a4=new Room("a4");
        ... etc. ...

Similar Messages

  • Clean up the database (Lists) help please

    Hello everyone
    I have been fudging my way through BC for a few years now, I am a business owner who is a graphic designer but does not know a lot about code.
    So, i have sent loads of email campaigns to many different lists over the years with just the standard system generated "unsubscribe" button at the bottom.
    So as a result, i have had people unsubscribe from some lists and not from others, and then getting very cranky at me if i email them from another list.
    I want to remove anyone who has unsubscribed as I have no use for them in my system as all we do is use it for emails.
    I have run a report and it seems there is about 500 people who need to be removed, my question to you all is:
    Do I have to do this one by one, or is there a way of mass removing anyone who has opted out or unsubscribed in the past?
    I want to clean up the data base so that only people who want to receive my emails will do so from now on and also from now on, I have inserted the tag "unsubscribe from all lists" so I dont have to do this again.
    Thanks so much for your help.
    Rebecca

    Hi dear,
             Do you mean   Performance data purge settings?
             I do this but the db is no change ,it still to big

  • I keep being asked to update my Safari but when I do a Software update it scans but never gives me a list and just says no new updates. Help please!

    I keep being asked to update my Safari but when I do a Software update it scans but never gives me a list and just says no new updates. Help please!

    There are no updates to either OS 10.5.8 or Safari 5.0.6.
    If you need a later version of Safari you must first upgrade your operating system to a later version of OS X.

  • How do I delete stored email addresses in my iphone? When sending photos, I don't want to have certain email addresses  "popping up" from the internal memory, I've deleted my entire "Contact" list but they still appear.  Help please!

    How do I delete stored email addresses in my iphone? When sending photos, I don't want to have certain email addresses  "popping up" from the internal memory, I've deleted my entire "Contact" list but they still appear.  Help please!

    As with the Mail app on a Mac, the iPhone's Mail app stores all email recipients in a list of previous recipients which is separate from the address book or contacts. The email address autofill feature when addressing an message pulls from Contacts and from the list of previous recipients.
    Different from the Mail app on a Mac, there is no access to the list of previous recipients with iOS on an iPhone, iPod Touch, or iPad to remove a previous recipient from the list, or to add a previous recipient to the address book or contacts that is not already entered - not at the present time anyway.
    The only way to purge the list of previous recipients at the present time is by restoring your iPhone with iTunes as a new iPhone or not from your iPhone's backup, which will start being re-populated again with every sent message.

  • HT2486 I am sending an email to a group which I have created in my contacts.  I would like to hide the list of people's emails but cannot see how I can do that.  Can anyone help please?

    I am trying to send an email to a group which I have created in my contacts.  I would like to hide the list of email addresses but cannot see how to do this.  Can anyone help please?

    Thank you for your message.  
    I can see how you do that when using the 'normal' emailing system from my mailing box, but not when working from the contact application (the 'book' on the bottom icon bar with the @ on it)....

  • Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Your feed is at http://blacktribbles.podomatic.com/rss2.xml
    When subscribed to in iTunes the recent episodes show, but the Store hasn't updated for some time.
    There appears to be an issue with the feed. In the episode 'WRESTLING MARCH MADNESS: Final Bracket & Championship' of 31st March you will find in the 'description' tag the following line:
    4. KURT ANGLE
    At the end of this line is an invisible character which seems to be wrecking the feed - although it works OK when suscribing in iTunes it won't load in a browser (and I also found the feed very slow to load, which won't help matters with the Store)
    This sort of thing usually happens when you paste text in from a word processing application and manage to include one of the invisible control characters. I don't know how easy it will be do do it in Podomatic but you should delete that entire line and retype it to remove this charter.
    You should keep an eye on the time it takes the feed to be accessed - if there is a long enough delay (and it was quite some seconds when I tried) the Store may well timeout and fail to read it. At the moment it's showing a cached version from the last time it was able to read it.

  • Safari 5.1 in iMac OS X 10.6.8.Adding Bookmarks to "unsorted Bookmarks" folder puts them in a black hole.  I can't find the "UB" folder.  Where is it? Should I add it to the folder list somewhere on the left pane? OR? Help, please!

    Safari 5.1 in iMac OS X 10.6.8.Adding Bookmarks to "unsorted Bookmarks" folder puts them in a black hole.  I can't find the "UB" folder.  Where is it? Should I add it to the folder list somewhere on the left pane? OR? Help, please!

    It looks like that the installation process of one of the applications have caused some trouble. One of them may have changed or added kext files.
    For that, the Window server crashed if you try to open a non Apple application like Firefox
    Start the system in safe mode by holding the shift key on power on.
    If save mode is reached, perform a permissions repair with the Disk Utility.
    Don't bother about upcoming warnings like "could not repair file xy" as that occur cause you use the tool on a running system and opened files can not get touched by the tool.
    After repair is done reboot system to normal and try to open Firefox.
    If the problem persits, please report back here.
    Lupunus

  • My iPhone 6 can't find my macbook pro on the airdrop list, although everything is in place, bluetooth, wi fi gets, need help please ?

    My iPhone 6 can't find my macbook pro on the airdrop list, although everything is in place, bluetooth, wi fi gets, need help please ?

    Dear Niel, thank you but my mac is (MacBook Pro (Retina, 15-inch, Early 2013).
    and i can send from it to my iPhone , but not vice versa

  • When I download PDFs on my macbook I am given the option of saving them to iCloud and in Preview they are listed under iCloud. How can I then view them on my iOS devices? Help please.

    When I download PDFs on my macbook I am given the option of saving them to iCloud and in Preview they are listed under iCloud. How can I then view them on my iOS devices? Help please.

    Welcome to the Apple Community.
    You can't share preview files to an iOS device. There are several other options for pdf's such as Adobe Reader or iBooks.

  • I bought a used iphone 4 (gsm) and it was locked on an icloud account i asked the old owner to remove the device from his devices list on icloud and he did but the iphone is still asking to be activated on his icloud account. any help please???

    i bought a used iphone 4 (gsm) and it was locked on an icloud account i asked the old owner to remove the device from his devices list on icloud and he did but the iphone is still asking to be activated on his icloud account. any help please???

    If it's still asking for the seller's Apple ID and password, then he most likely did not actually remove the iPhone from iCloud. If the problem persists, return the iPhone and get your money back. The seller can figure out the problem and resell the iPhone later.
    Regards.

  • I just got my iphone and i want to get all my apps and music from my ipod onto my iphone. the only problem is that my itunes is not recognizing my iphone in the devices. in fact there are no devices at all listed. Please help!

    I just got my iphone and i want to get all my apps and music from my ipod onto my iphone. the only problem is that my itunes is not recognizing my iphone in the devices. in fact there are no devices at all listed. Please help!

    See either:
    iPhone not recognized in iTunes for Mac
    iPhone not recognized in iTunes for Windows

  • HT204150 Following problem: I have around 600 contacts on my iphone and Ipad and would like to sync with contact list on my mac book air but its not working and whatever I do I get stuck on the 44 contacts I have on my mac  contact-list. Please Help!!!! 

    ollowing problem: I have around 600 contacts on my iphone and Ipad and would like to sync with contact list on my mac book air but its not working and whatever I do I get stuck on the 44 contacts I have on my mac  contact-list. Please Help!!!!  thanks

    First, be sure that the contacts on the devices are in the "icloud" section and not the "On my iPhone" (or iPad) section of the contact listings/groups.
    Missing contacts:
    Here's a test to perform - using a computer's browser, log into icloud.com and go to the Contacts page.  If most of them are gone, then they are gone. 
    If they show up, then the problem is that your device is not connecting to the Contacts database on icloud. 
    On the device, go to Settings>icloud.  Be sure icloud is on and using the right ID.  If not, scroll to the bottom of the page and tap Delete Account - this just disconnects the device from that account, no data is lost.  Then log back in using the correct ID.  ALSO - be sure the Contacts are turned on (on the same screen).
    Note:  Contacts are not part of an iCloud backup, since they are part of contacts database on iCloud's servers.   So performing a restore will not help.
    Contacts are gone from icloud.com.
    Then they have been deleted.  There are many reasons for this.  One possibility is that someone else is using the same iCloud account (family member, etc.) and they deleted contacts, thinking they did want them on THEIR device.  How to get them back?  Unfortunately, an iCloud backup does not include any of the sync databases, like contacts, notes, calendars, reminders, etc. because the data is already stored in these databases.  Your only hope for restoring the data is if you had that data on a computer (like a mac's Contacts, Calendars, etc.) and that data was backed up using whatever backup software you typically use (e.g. Time Machine on a mac).  Just restore the data files back to the computer.  Other than that, I'm afraid the data is gone.

  • Please check the order's object list (inconsistency SOBJ)

    Hi Friends;
    I am facing a strange issue where I have copied a custom task from SAP standard decision task 00008267 caz I needed to perform some custom requirement on it.
    I have done evry thing but then I have observed that Agent assignment is not coming at testing client which is on same server.
    I also can not modify any thing at testing client.
    So I performed SCC1 from testing client and check but still same issue.
    Then I thought of re assigning agent at development client but while making it general task it pop up the message "Please check the order's object list (inconsistency SOBJ)".
    And after again performing the SCC1 still the issue exist.
    Can any one suggest their inputs where the problem could be and how should I fix it.
    Regards
    Devraj

    Hi Dev,
    Can you please share more details? Agent assignment not coming means?
    Have you set the task as General in testing client?
    Thanks,
    Viji.

  • I have a wish list on i tunes and want to transfere  the songs so I can burn them to a cd..can anyone help please

    I have a wish list on I tunes that I want to download and burn to a cd...I dont know how to transfere  from wish list to be able to download and burn...can anyone help please 

    Philippa18 wrote:
    Cant get the songs to transfere from the wish list !
    You do not need to transfer anything.  Open the wishlist, and click on the price of any song(s) that you want to buy. 
    Once you have purchased them and have them in your library, simply put them into an iTunes playlist and burn in the normal way.

  • HT204406 I have a lenovo tablet running windows 8 - only 4 of my albums are showing in my list - this is my 4th device and I subscribe to the cloud HELP  please I want to see my music

    have a lenovo tablet running windows 8 - only 4 of my albums are showing in my list - this is my 4th device and I subscribe to the cloud HELP  please I want to see my music

    See the futher information area of Troubleshooting issues with iTunes for Windows updates for download advice and direct links if required.
    See this migrate iTunes library post for advice on moving the library over from a previous computer and this post on deduplication.
    tt2

Maybe you are looking for

  • Ovi maps and Nokia Maps

    I have recently downloaded the ovi maps update for free navigation on my 5800 however now I seem to have 2 programs in my installed apps menu, Ovi maps and Nokia maps. This is causing me some problems as my phones built in memory is now completely fu

  • Change view of the Calendar

    Hi, I search for the possibility to change the standard "day" view in the calendar iView to weekly or monthly view like in MS- outlook or other. Is there a possibility to change this ?? Can somebody provide me with documentations ?  Also is there any

  • How Do You Change the Remote Desktop Listening Port in Win 8.1 Pro

    I am trying to setup two Win 8.1 Pro computers for Remote Desktop access on my local network. I can get Remote Desktop working fine on both when they are using the default RD port 3389. I am unable to change the listening port on one of the computers

  • Photoshop Elements 12 installation error on windows causing rollback-help needed please

    I am installing Photoshop Elements 12 on my windows laptop. When almost done an error occurs and it starts rollback and the installation fails. I consulted the troubleshooting guide which suggests to go to C://Program Files(x86)/Common Files/Adobe/OO

  • ATP with stock in transit

    Hi frieds, When we are doing a stock transfer with 641, the receiving plant ATP checks not including the incoming transit stock. How can i include Stock in transit stock in ATP? I checked OVZ9, It's supports only for 303 and 313 movement types? any i