Results 1 to 5 of 5

Thread: Virtual table?

  1. #1
    kblackwell is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default Virtual table?

    Hi
    I'd like to take an array of a custom type (intA, string, intB, intC) and use it as a virtual table...
    For example, I'd like to be able to select intC from <whatever> where intA=something.
    How would I best go about doing this?
    I'd realy like to do this without having to store the data in a database, just have it loaded into memory.
    Thanks!

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

    Default

    Can you elaborate a little further? I'm having a tough time fully grokking your question.

  3. #3
    kblackwell is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default

    Sure.
    I make a custom data type kinda like this

    public myDataType{
    int intA
    String strX
    int intB
    int intC
    }

    So, one of these might contain data like {1, Fish, 39, 23}

    I have a set of these - aka an array - say 30 of them.

    I want to load them into some sort of virtual table so that I could easily get a value out.
    Say for example I want to get the value of intC where strX=Fish and intB=20.
    If it were in a database table I would just execute an sql statement like SELECT intC FROM tablename WHERE strX='Fish' and intB=20.
    But I don't want to have it in a database that I would have to call... I just want to use the array as a virtual table somehow... without writing a function to loop through the array.
    make sense?

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

    Default

    Hm, perhaps what you want is a Map such as a HashMap

  5. #5
    kblackwell is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

Similar Threads

  1. Virtual Battle Programmer
    By ALATECjobs in forum Jobs Offered
    Replies: 2
    Last Post: 08-28-2008, 04:52 PM
  2. Too many virtual Machine
    By davantmay in forum Java Applets
    Replies: 1
    Last Post: 07-06-2007, 10:53 PM
  3. Virtual machine of java.
    By Albert in forum Advanced Java
    Replies: 1
    Last Post: 07-05-2007, 08:48 PM
  4. Virtual Machine To Pda
    By Heather in forum Advanced Java
    Replies: 2
    Last Post: 06-30-2007, 03:11 PM
  5. C# Java Virtual Machine 1.0.1
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-25-2007, 07:47 AM

Posting Permissions

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