cdm/src/main/java/ucar/ma2/StructureDataFactory.java
static public StructureData make(String name, Object value) {
    StructureMembers members = new StructureMembers("");
    DataType dtype = DataType.getType(value.getClass(), false);  // LOOK unsigned
    StructureMembers.Member m = members.addMember(name, null, null, dtype, new int[]{1});
    StructureDataW sw = new StructureDataW(members);
    Array dataArray = Array.factory(dtype, new int[]{1});
    dataArray.setObject(dataArray.getIndex(), value);
    sw.setMemberData(m, dataArray);
    return sw;
  }
static public StructureData make(String name, Object value) {
    StructureMembers members = new StructureMembers("");
    DataType dtype = DataType.getType(value.getClass(), false);  // LOOK unsigned
    StructureMembers.Member m = members.addMember(name, null, null, dtype, new int[]{1});
    StructureDataW sw = new StructureDataW(members);
    Array dataArray = Array.factory(dtype, new int[]{1});
    dataArray.setObject(dataArray.getIndex(), value);
    sw.setMemberData(m, dataArray);
    return sw;
  }
static public StructureData make ( String name , Object value ) { StructureMembers members = new StructureMembers ( "" ) ; DataType dtype = DataType . getType ( value . getClass ( ) , false ) ; // LOOK unsigned StructureMembers . Member m = members . addMember ( name , null , null , dtype , new int [ ] { 1 } ) ; StructureDataW sw = new StructureDataW ( members ) ; Array dataArray = Array . factory ( dtype , new int [ ] { 1 } ) ; dataArray . setObject ( dataArray . getIndex ( ) , value ) ; sw . setMemberData ( m , dataArray ) ; return sw ; }
/* static public StructureData make(String name, String value) {
StructureMembers members = new StructureMembers("");
StructureMembers.Member m = members.addMember(name, null, null, DataType.STRING, new int[]{1});
StructureDataW sw = new StructureDataW(members);
Array dataArray = Array.factory(DataType.STRING, new int[]{1});
dataArray.setObject(dataArray.getIndex(), value);
sw.setMemberData(m, dataArray);
return sw;
}
/ * static public StructureData make ( String name String value ) { StructureMembers members = new StructureMembers ( ) ; StructureMembers . Member m = members . addMember ( name null null DataType . STRING new int [] { 1 } ) ; StructureDataW sw = new StructureDataW ( members ) ; Array dataArray = Array . factory ( DataType . STRING new int [] { 1 } ) ; dataArray . setObject ( dataArray . getIndex () value ) ; sw . setMemberData ( m dataArray ) ; return sw ; }