Results 1 to 3 of 3
  1. #1
    lukeirves is offline Member
    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Default store and recall string and integer data when a boolean is set to true

    i am trying to figure out how to program In java an arraylist of sorts that stores and recall data I command.

    I have 3 data sources
    1 is a string
    1 is a number anywhere from 0 - 30000
    and the last is a boolean

    when the Boolean is "true" I need the array to store the data from the string and the number.
    when the Boolean is false the array looks at the string input and if it matches any of the strings in the array then it outputs the corresponding number that was stored.

    the array needs to be able to store and recall about 50 strings and numbers in total.

    also if the same string is encountered on a Boolean true the number value should be replaced with the new number received.

    does anyone have any bright ideas?

    it's for a quartz composer plugin.

    thanks
    Last edited by lukeirves; 06-16-2012 at 03:33 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: store and recall string and integer data when a boolean is set to true

    Quote Originally Posted by lukeirves View Post
    does anyone have any bright ideas?
    Start by learning Java?
    The Java™ Tutorials

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: store and recall string and integer data when a boolean is set to true

    I'd use a Map<String, Integer> and do as you described given a value for a triple b, s, n.

    kind regards,

    Jo
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 3
    Last Post: 02-14-2012, 01:05 AM
  2. Replies: 3
    Last Post: 09-13-2011, 01:01 AM
  3. my simple boolean code keeps saying true
    By shazakala in forum New To Java
    Replies: 8
    Last Post: 03-27-2011, 11:30 AM
  4. Boolean always true?? What am I doing wrong?
    By Forty0ztoFreedom in forum New To Java
    Replies: 4
    Last Post: 03-02-2011, 07:13 PM
  5. how to Store and recall numbers in java ?
    By Ak-Emm in forum New To Java
    Replies: 16
    Last Post: 09-28-2008, 12:49 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
  •