Results 1 to 3 of 3
  1. #1
    kumar_gemi is offline Member
    Join Date
    Oct 2008
    Posts
    21
    Rep Power
    0

    Default how to retrieve values from a vector which contains different datatypes

    Hello,

    I have a file which contains some data where ; is the delimiter to separate each individual events.I want to store them in a vector .Right now i have some issues in knowing how to retrieve values from a vector which contains different datatypes.When i tried to retieve data,i have to specify the datatype but my dataset contains characters and integers.So please let me know how to do that.Thanks in advance

    Regards
    Kumar
    Last edited by kumar_gemi; 03-08-2009 at 09:48 AM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Your vector should contain one data type and one data type only. Perhaps your "events" need to be encapsulated into a class and your Vector (or better the more modern ArrayList) would hold objects of this class.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,574
    Rep Power
    23

    Default

    Have you read the API doc for the Vector class?
    What methods look like they would be used to "store" an element in the Vector? Hint the start with the letter a.
    What types will the elements be? String or ???
    When you define your Vector you use the Generic form: Vector<type> to allow the compiler to type check and cast the elements as they are added or removed from the Vector.

Similar Threads

  1. How to store/retrieve PNG image in/from RMS
    By jason-nexFIT-mobileXware in forum CLDC and MIDP
    Replies: 0
    Last Post: 09-10-2008, 04:01 AM
  2. Coercing DataTypes
    By barryc in forum New To Java
    Replies: 1
    Last Post: 07-09-2008, 05:59 PM
  3. Store retrieve and delete
    By on7june in forum New To Java
    Replies: 1
    Last Post: 03-08-2008, 05:57 PM
  4. How to retrieve HttpSession from axis 2.0.
    By snooze-g in forum Advanced Java
    Replies: 0
    Last Post: 10-02-2007, 07:08 AM
  5. how to retrieve the width of the column
    By katie in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 10:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •