RE: null scalary type in ScalarMap

>If you know of a better way to do this, let me know.

Try this:

   Vector myMaps = new Vector();
   for (int i = 0; i < fields; i++) {
      int assignment = theJgapAPI.getMappingForCell(cell_number, i);
      DisplayRealType mapTo = mappings[assignment];
      RealType mapFrom = (RealType) myVector.get(i);                        
      if (mapTo != null && mapFrom != null) {
         myMaps.add(new ScalarMap(mapFrom, mapTo));
      }
   }
   ScalarMap[] theMaps = new ScalarMap[myMaps.size()];
   myMaps.copyInto(theMaps);
   mySS.DisplayCells[width][height].setMaps(theMaps);              

This type of problem is exactly what java.util.Vector is designed to solve.

-Curtis


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