RE: determining if field is "index"

Hi Michelle,

Let me get this straight: you have an array of ScalarMaps, and you want to
know which ScalarMap in the array is a mapping from "index" to something?

What is wrong with iterating through your array, looking for the correct
map?  This is only O(N) complexity where N is the number of mappings, and
I highly doubt you have more than 10-15 mappings at most!

If you *must* determine the index in advance, then when you are creating
the mappings, save an integer indicating where the index mapping is.

Unless I am misunderstanding your question, this is a basic programming
problem with a very simple solution; not a VisAD problem.

-Curtis

At 12:52 PM 7/30/2003, Kam, Michelle C wrote:
>I setup an array of mappings of input fields like q1, q2, x, to a
>corresponding integer value for a Visad parameter like flow1azimuth,
>xoffset, etc. Do you know of a way to determine which array index in my
>array of mappings the "index" field would be? This may not be possible,
>but is there a way to extract the MathType of the input field "index" in
>VisadAPI before my other method in a different class is called? If I can
>somehow determine that integer number, I can then index into that spot
>in my array of mappings and check if the value there matches the integer
>value for "iso-contour".
>
>Thanks,
>Michelle


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: