NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Get Set Type

Hi Kevin,

> If I print a Set (Irregular1DSet, Linear3DSet, Gridded2DSet, etc.) to
> standard output, I get output that resmbles the following:
>
>  > visad.Irregular1DSet: Dimension = ........
>
> How can I ask a Set which kind of set it is?  Typically, I already know
> the set and just cast it, but I'm trying to make my code a bit more
> "generic"

For any Java object obj, you can do:

  String class_name = obj.getClass().getName();

Good luck,
Bill


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