Can a 2D array have more than one type?

Are multi-dimensional arrays limited to only one type? For example;
int[][] array = new int[2][10];
In this example, the array only holds only integers.
I would like to construct a 2D array with different types to represent data pairs. In my example, I would like the first 'column' to hold Date objects, and the second 'column' to hold Double objects (the data pair comprises a datestamp and a rainfall reading).
I don't want to use a hashmap because I want to preserve the order, and then to iterate through the array in subsequent calculations. I would prefer not to use an array of Strings because of the overhead needed to convert the Strings to Dates and Doubles. I would prefer not to have to handle two arrays - one for the Dates and one for the Doubles.
Any comments would be appreciated.

Hi,
I see you said that this question is answer, but I'm not sure you didn't just get frustrated and gave up. Anyway, if you haven't found a solution yet then you can try the following;
make a class called, for example, rfItem (which stand for rainfall item) e.g. import java.sql.Timestamp;
public class rfItem
    private Timestamp TIME;
    private Double RAINFALL;
    rfItem(Timestamp t, Double r)
         TIME = t;
         RAINFALL = r;
    public void setRainfall(Double r)
         RAINFALL = r;
    public Double getRainfall()
         return RAINFALL;
    public void setTime(Timestamp t)
         TIME = t;
    public Timestamp getTime()
         return TIME;
}Then when you are in the class where you want this double array, just create a single array with rfItem's as the elements, i.e.
         rfItem[] test = new rfItem[]you now have an array where each element of the array stores a double and a timestamp. Is this what you where looking for?

Similar Messages

  • Can an MIDP application have more than one MIDlet?

    Hi,
    in my MIDP project, i have done my 3 modules all seperately.
    i have made 3 projects in the wireless toolkit and each project has one MIDlet.
    now i want to integrate these projects.
    can my one single project have more than one MIDlet.

    You can't really call one MIDlet from another.
    If your MIDlet Suite has more than one MIDlet then the when you open the MIDlet Suite you'll get a menu so that you can choose which MIDlet to start.
    What you want to do is to separate your applications from the MIDlet class. So your "main" classes won't be ones that extend MIDlet. Instead you would just have a "skeleton" MIDlet subclass that instantiates one of the main classes and starts it. This way you can easily integrate different applications, and have them call one another.
    shmoove

  • Can a masking layer have more than one mask?

    I have a mask layer with a rectangular mask in it.
    Inder this layer I and a nasked layer with an object to be
    masked on it
    This works fine
    When I all another object to be masked in thesame layer and
    relevant mask in
    the same masking layer the sacond object does not show up at
    all.
    Does this mean that the masking layer can only have one mask?

    aa wrote:
    > I have a mask layer with a rectangular mask in it.
    > Inder this layer I and a nasked layer with an object to
    be masked on it
    > This works fine
    > When I all another object to be masked in thesame layer
    and relevant mask in
    > the same masking layer the sacond object does not show
    up at all.
    >
    > Does this mean that the masking layer can only have one
    mask?
    One mask per layer, tho the mask could be made of movie clip
    which could
    have a mask within.
    Best Regards
    Urami
    Beauty is in the eye of the beer holder...
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • A header data can have more than one lie item data !

    How can a header data have more than one line item data ?

    Hi,
    header table will have only main data where as the item data will have material delivery date other things based on the availabilty and committement
    http://help.sap.com/saphelp_srm30/helpdata/en/38/4cc5376848616ae10000009b38f889/content.htm
    Regards
    Shiva

  • Can a PC have more than one iTunes account on it?

    Can a home PC have more than one iTunes account on it?  What happens if I log into my iTunes account on someone else's PC?  I don't have access to my own PC and want to download more music onto my gear.

    1. Yes. Use separate user accounts on the computer; if desired, you can instead launch iTunes with the Shift key held down and create a new iTunes library, but this won't have separate preferences.
    2. Nothing will happen to the existing content. If you're syncing an iPhone, iPod, or iPad, click here.
    (85499)

  • How can i find out the more than one times occurance of integer in a array?

    How can i find out the more than one occurance of integer in a array. Assume i have 2,2,3,4,2,5,4,5 in a Array and i need to find out the how many times of 2, 5 and 4 is exists in that array. Please some one help me as sson as possible. thanks in advance....

    Kumar_Mohan wrote:
    How can i find out the more than one occurance of integer in a array. Assume i have 2,2,3,4,2,5,4,5 in a Array and i need to find out the how many times of 2, 5 and 4 is exists in that array. Sort the array. Then loop through it and compare each i-th element with the (i+1)-th element.
    Please some one help me as sson as possible. thanks in advance....In future postings, please refrain from telling that it is urgent, or you need help ASAP. It is rather rude to do so.

  • Can you have more than one plan at a time? i.e.: After Effects CC Single App   Photography

    I can't afford to pay for the whole CC package, but I really miss Photoshop in my workflow. In all the promotional stuff, the single app plan is offered to those who only want "one or two" apps, but I'm guessing the two only applies to PS+LR
    Paying an extra £8/mo for Photoshop would be worthwhile, but It isn't immediately clear whether or not this is doable.
    If anyone has tried this, or knows an answer I'd greatly appreciate your help!
    Thanks,
    -Mat

    Yes, you may have more than one "single" subscription, with the photography special counting as a single
    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html

  • I need to connect my iPad to a projector and USB ports. What do I need to do this and where can I get the suitable fittings? I really need to have more than one USB connection port. Help

    I need to connect my iPad to a projector and have USB ports. What do I need to do this and where can I get the suitable fittings? I really need to have more than one USB connection port. Help

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    Connect an iPad to a Television or Projector
    http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
    Connecting iPad iPhone or iPod to TV or Projector
    http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    http://support.apple.com/kb/ht4108
    If your location does’t have wifi to use with the Apple TV, use a portable router.
    Portable routers http://compnetworking.about.com/od/routers/tp/travel_routers.htm
     Cheers, Tom

  • HT6154 Can someone please just help me figure out how to update this stupid phone without losing anything? I somehow have more than one Apple ID on this,but I just want my music and my pictures to stay and I'm terrified of losing these things.

    Can someone please just help me figure out how to update this stupid phone(iPhone 4)without losing anything? I somehow have more than one Apple ID on this,but I just want my music and my pictures to stay and I'm terrified of losing these things. I have a lot of music from old CDs on here,and for some reason I can't even transfer them manually onto my computer. I'm not tech savvy whatsoever. Someone please help,having my music is the the whole reason I still have this phone.

    First read about back http://support.apple.com/kb/ht1766
    Then  read on how to transfer photos to your computer http://support.apple.com/kb/ts3195
    Then
    UPDATING iOS
    Over the air updating of iOS needs iOS 5 or later so unless you have iOS 5 or later you will not see updating in setting
    The following link explains how to update http://support.apple.com/kb/HT4972
    This link explains how to update using wireless http://support.apple.com/kb/HT4623
    This explains how to transfer purchases to your computer http://support.apple.com/kb/ht1848

  • Can i have more than one address book

    Is it possible to have more than one address book on my computer.  I would like to have 2 so I can use one for personal and use one for special projects

    Until I tunes match comes out it does not matter.  I cloud is for e mail, contacts, and calendars.  Your I cloud ID MUST be an @me.com ID.

  • Can I have more than one e-mail address attached to my apple account?

    I can't seem to create different FaceTime accounts using different e-mail addresses but with 1 Apple account. My daughter's IPod is attached to my Apple account, but I want to use her e-mail address for her FaceTime app. Any thoughts?

    Cessna007 wrote:
    how do i sign up for a new e-mail address @icloud or @me; and can I have more than one e-mail address?
    You create an @icloud.com address in the first place by signing into Settings>iCloud with your Apple ID and choosing an addres - you can only create an @icloud.com address, not @me.com.
    Then if you want further addresses on the same account you can add up to three 'email aliases' - these are additional addresses (not accounts) which deliver into the same inbox as the main account. (In fact it's a good idea to give out alias addresses, rather than the main address, because if they attract spam you can easily change them.) (New aliases can only be @icloud.com ones; @me.com addresses cannot now be created.)
    You should be aware before you start that once you've created an alias you cannot turn that address into a full iCloud account or move it to another account.
    More information on aliases here: http://help.apple.com/icloud/#mm6b1a490a

  • How do i sign up for a new e-mail address @icloud or @me; and can I have more than one e-mail address?

    how do i sign up for a new e-mail address @icloud or @me; and can I have more than one e-mail address?

    Cessna007 wrote:
    how do i sign up for a new e-mail address @icloud or @me; and can I have more than one e-mail address?
    You create an @icloud.com address in the first place by signing into Settings>iCloud with your Apple ID and choosing an addres - you can only create an @icloud.com address, not @me.com.
    Then if you want further addresses on the same account you can add up to three 'email aliases' - these are additional addresses (not accounts) which deliver into the same inbox as the main account. (In fact it's a good idea to give out alias addresses, rather than the main address, because if they attract spam you can easily change them.) (New aliases can only be @icloud.com ones; @me.com addresses cannot now be created.)
    You should be aware before you start that once you've created an alias you cannot turn that address into a full iCloud account or move it to another account.
    More information on aliases here: http://help.apple.com/icloud/#mm6b1a490a

  • Can I have more than one Apple TV in my home on one account?

    I want to buy an Apple TV for my daughter and allow it to access my iTunes account. I already have an Apple TV in use in my home.
    Can I have more than one Apple TV in my home on one account?

    yes
    they access the computers shared itunes lib all the ios devices and appletv's and other computers on your network can access your shared itunes lib and all of them can use your appleID should you so choose

  • I seem to have more than one apple ID. How can I get rid of old ones?

    I seem to have more than one apple I D. Apple keep rejecting my password so I create new one. iPhone still seemd to use original ID. Apps get attached to old IDs. Can't log into game centre on old ID or use my nickname. Says its already in use! By me!

    Roger.  Can you drop in to HT4436 Multiple iCloud accounts on OS X: Apple Support Communities and see if you can help the OP?  Thanks,
    OT

  • Can you have more than one alert at a time show up on the lock screen?

    When i recieve a new message, this shows up as an alert on the lock screen when my phone is locked, as its supposed to. However, if a new alert comes through before i open the previous one, only the most recent one will appear on the lock screen. Is there anyway to set it so multiple messages can be displayed on the lock screen at once?

    Yes, you may have more than one "single" subscription, with the photography special counting as a single
    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html

Maybe you are looking for

  • How to connect apple tv to xfinity wireless

    I am trying to connect my apple tv to xfinity wireless Internet connection. I am using my old first generation I pad going to settings> general> network don't seem to help any suggestions as to how I can connect.

  • 1.6.0_24 on XP worked now 1.6.0_29 on 7 doesn't work

    I have a question for the community. I don't know everything there is to know about java, so please forgive me. Here it is: We are upgrading from 32bit winxp sp3 to 64bit Win7. We have to access certain Cisco managers, and we used to authenticate to

  • "ERROR: Could not read block 64439 of relation 1663/16385/16658: Result too large"

    Hi, I've already archived a lot of assets in my final cut server but since one week there is a message appearing when I click on an asset and choose "Archive". The pop-up says: "ERROR: Could not read block 64439 of relation 1663/16385/16658: Result t

  • Exception condition "INVALID_POS" raised

    I have thousands of entries stuck in the outbound queue of my ERP system everyday. This is due to a failed transaction. SAP Support told me there is a problem with the P.O. associated with this transaction and that it is OK to delete the offending en

  • Workflow bug

    Ok I am having a really odd problem with a workflow I use quite a lot. Basically, I use it to duplicate and resize images that I then upload manually to a website. The workflow is saved as a finder plugin, so all I do is select the images I want and