Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

DefaultFamily and comparing RealTypes

Hi Bill and others,

I've been comparing RealTypes a bit, and it has just stopped working.
I'm assuming that it's ok to use == on RealTypes as they seem to be
a global sort of thing.  I am interested in testing the equality
of the name and units etc, so I'm not using RealType.equals().

The problem is that the comparison's behaviour changes after
I create a DefaultFamily.

The code below shows this (at least for me!), remove the commented
out line to change what it prints.

Is my assumption bad, or is DefaultFamily doing something bad?

thanks,

Andrew.

--

import visad.*;
import visad.data.DefaultFamily;


public class T
{
        public static void main(String[] args)
        {
                System.out.println("Hello");

//DefaultFamily defaultFamily = new DefaultFamily("default");

                RealType lat = RealType.Latitude;
                RealType lat2 = RealType.getRealType("Latitude");

                System.out.println("( " +
                        lat + " = " +
                        lat2 + " )= " +
                        (lat == lat2));
        }
}


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690