Re: Import data in SpreadSheet

"Peter X. Cao" wrote:
> Bill, et al.,
> 
> I have two questions.

I have one answer (I'll let Curtis answer #2, though I think the answer
*may* be "It just opens the first object".  I'd be happy to be wrong,
though)

> 1)
> 
> I was trying to figure out how the "Import data" works in SpreadSheet.
> I traced all the way down to the call
>  
>   public synchronized DataImpl open(String id)
>       throws BadFormException,
> IOException, VisADException
>   {
>     OpenStringForm o = new OpenStringForm(id);
>     if (!o.run()) {
>       throw new > BadFormException("Data object \"" + id +
>                                "\" not compatible with \"" + getName() +
>                                "\" data family");
>     }
> 
>     return o.getData();
>   }
> 
> at DefaultFamily.java.  
> 
> I am now stuck at OpenStringForm. I cannot find that class anywhere in the
> visad classes.

OpenStringForm is an internal class in DefaultFamily.  It is an extension
of FileFunction which extends FormFunction (two more internal DefaultFamily
classes).

About all OpenStringForm does is invoke FormFunction.run(), which goes
through all the file adapters known in DefaultFamily and calls each one's
open() method with the given filename until one successfully opens that
file, or until it runs out of file adapters.

Sorry the code's so convoluted...