Re: [netcdf-java] ArrayString

Hi Rodrigo,

I think the problem is that when ArrayString was added a few years back the
Array.factory() method was not modified to handle it. I have added an issue
for this [1] to our issue tracking system. You can "watch" this issue if
you wish to follow our progress. I don't think a fix for this issue will
make it into netCDF-Java/CDM 4.5.4 which is already in the process of being

The ArrayString.factory() method is what should get called when
Array.factory(DataType.STRING, ...) is called. So, the only risk in calling
it directly is that it isn't a public method which means you'll have to
kludge things a bit to call it. And, as a non-public method we don't really
guarantee its existence like we do public methods.




On Fri, Dec 12, 2014 at 8:38 AM, Rodrigo Botafogo <
rodrigo@xxxxxxxxxxxxxxxxxxx> wrote:
> Hello,
> I´m using netcdfAll version 4.5 (I think that it is actually 4.5.0).  This
> is not the latest version.  I cannot use the newer version as I´m also
> using Renjin and it has an old version of Guava.  It seems that this is not
> the problem, but just in case.
> My problem:  I´m trying to create an ArrayString by calling Array.factory
> giving it a dtype, a shape and a java string array.  I´m getting back an
> ArrayObject and not an ArrayString.  Looking at netcdf code on github I see
> that factory calls:
> return ArrayObject.factory(classType, indexCalc, (Object[]) storage);
> So, it seems that it is actually building an ArrayObject and not an
> ArrayString.  In my case, I think I really need an ArrayString.  I was able
> to create an ArrayString with a given storage by using what seems to be a
> non public interface:
> index = Index.factory(int[])
> ArrayString.factory(index, <shape>, <storage>)
> Can you tell me the risk of doing this?  Did I do something wrong?
> Thanks,
> --
> Rodrigo Botafogo
> _______________________________________________
> netcdf-java mailing list
> netcdf-java@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe, visit:
  • 2014 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: