Results 1 to 4 of 4
  1. #1
    pavan528 is offline Member
    Join Date
    Sep 2012
    Posts
    13
    Rep Power
    0

    Default Which Class will be used here

    Hi all,
    I want to return the Range of Variables from a Function as follows.
    X will be within 3 to 5
    Y will be with in 10 to 15.
    Z will be with in 22 to 34.

    and so on...

    I have extracted the variables and their ranges. But not sure which data Structure or class should be used to return it from the Function. Will Hashmap Works? I use Key of Hashmap to denote Variable and Value field as 3 for X, But how can I indicate 5 which is the Max value X can take?

    Hope I am clear on what I want to achieve.
    Can someone direct me at this juncture?

    Thanks,

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Which Class will be used here

    Define a class to hold min and max values. The Hashmap would use the letter as key and an instance of the class as value.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    pavan528 is offline Member
    Join Date
    Sep 2012
    Posts
    13
    Rep Power
    0

    Default Re: Which Class will be used here

    Thats a Certain Option. But this Function has to output the Values to a Prolog Program which takes it as Variable, Lower Bound and Upper Bound. Thats the catch here. Can we pass the object to the Prolog Program as you have mentioned?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default Re: Which Class will be used here

    Can we pass the object
    Depends if the other method knows about the class and how to use it.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 3
    Last Post: 12-08-2013, 09:28 PM
  2. Replies: 1
    Last Post: 12-13-2012, 03:06 AM
  3. Replies: 0
    Last Post: 12-07-2011, 11:55 AM
  4. Replies: 0
    Last Post: 03-27-2011, 05:49 AM
  5. Replies: 5
    Last Post: 01-26-2011, 06:38 PM

Tags for this Thread

Posting Permissions

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