Re: visad.TypeException: ScalarType: name already used

Great to hear you're making such good progress.  You can solve
your problem like this:
 
  RealType X = RealType.getRealTypeByName("X");
  if (X == null) X = new RealType("X",null,null);
 
Whether wisely or not, VisAD maintains a Vector of all RealTypes
constructed on a JVM and will not allow duplicate names [however,
duplicates can occur if a RealType of the same name is constructed
on another JVM and passed by copy (i.e., Serialized via RMI) to
this JVM].  RealType.getRealTypeByName will return any RealType
previously constructed on this JVM with a given name.
 
Good luck,
Bill
 
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
whibbard@xxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html
 
"kill cross-platform Java by growing the polluted Java market"
   - from an internal Microsoft planning document
 

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