/** * CDL representation, may be strict * @param strict if true, create strict CDL, escaping names * @return CDL representation */ public String toString( boolean strict) { Formatter f = new Formatter(); writeCDL(f, strict); return f.toString(); }
/** * CDL representation, may be strict * @param strict if true, create strict CDL, escaping names * @return CDL representation */ public String toString(boolean strict) { Formatter f = new Formatter(); writeCDL(f, strict, null); return f.toString(); }
/** * CDL representation, may be strict * @param strict if true, create strict CDL, escaping names * @return CDL representation */ public String toString( boolean strict) { Formatter f = new Formatter(); writeCDL(f, strict); return f.toString(); }
@Override protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%n%s%s {%n", indent, dataType); indent.incr(); for (Variable v : members) v.writeCDL(buf, indent, useFullName, strict); indent.decr(); buf.format("%s} ", indent); getNameAndDimensions(buf, useFullName, strict); buf.format(";%s%n", extraInfo()); for (Attribute att : getAttributes()) { buf.format("%s ", indent); if (strict) buf.format( NetcdfFile.makeValidCDLName(getShortName())); buf.format(":"); att.writeCDL(buf, strict); buf.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("\n"); } buf.format("\n"); }
@Override protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%n%s%s {%n", indent, dataType); indent.incr(); for (Variable v : members) v.writeCDL(buf, indent, useFullName, strict); indent.decr(); buf.format("%s} ", indent); getNameAndDimensions(buf, useFullName, strict); buf.format(";%s%n", extraInfo()); for (Attribute att : getAttributes()) { buf.format("%s ", indent); if (strict) buf.format( NetcdfFile.makeValidCDLName(getShortName())); buf.format(":"); att.writeCDL(buf, strict); buf.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("%n"); } buf.format("%n"); }
@Override protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%n%s%s {%n", indent, dataType); indent.incr(); for (Variable v : members) v.writeCDL(buf, indent, useFullName, strict); indent.decr(); buf.format("%s} ", indent); getNameAndDimensions(buf, useFullName, strict); buf.format(";%s%n", extraInfo()); for (Attribute att : getAttributes()) { if(Attribute.isspecial(att)) continue; buf.format(" ", indent); att.writeCDL(buf, strict, getShortName()); buf.format(";"); if(!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("%n"); } buf.format("%n"); }
protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%s", indent); if (dataType == null) buf.format("Unknown"); else if (dataType.isEnum()) { if (enumTypedef == null) buf.format("enum UNKNOWN"); else buf.format("enum %s", NetcdfFile.makeValidCDLName(enumTypedef.getShortName())); } else buf.format("%s", dataType.toString()); //if (isVariableLength) buf.append("(*)"); // LOOK buf.format(" "); getNameAndDimensions(buf, useFullName, strict); buf.format(";"); if (!strict) buf.format(extraInfo()); buf.format("%n"); indent.incr(); for (Attribute att : getAttributes()) { buf.format("%s", indent); if (strict) buf.format(NetcdfFile.makeValidCDLName(getShortName())); buf.format(":"); att.writeCDL(buf, strict); buf.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("%n"); } indent.decr(); }
protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%s", indent); if (dataType == null) buf.format("Unknown"); else if (dataType.isEnum()) { if (enumTypedef == null) buf.format("enum UNKNOWN"); else buf.format("enum %s", NetcdfFile.makeValidCDLName(enumTypedef.getShortName())); } else buf.format("%s", dataType.toString()); //if (isVariableLength) buf.append("(*)"); // LOOK buf.format(" "); getNameAndDimensions(buf, useFullName, strict); buf.format(";"); if (!strict) buf.format(extraInfo()); buf.format("%n"); indent.incr(); for (Attribute att : getAttributes()) { buf.format("%s", indent); if (strict) buf.format(NetcdfFile.makeValidCDLName(getShortName())); buf.format(":"); att.writeCDL(buf, strict); buf.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("%n"); } indent.decr(); }
protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boolean strict) { buf.format("%s", indent); if (dataType == null) buf.format("Unknown"); else if (dataType.isEnum()) { if (enumTypedef == null) buf.format("enum UNKNOWN"); else buf.format("enum %s", NetcdfFile.makeValidCDLName(enumTypedef.getShortName())); } else buf.format("%s", dataType.toString()); //if (isVariableLength) buf.append("(*)"); // LOOK buf.format(" "); getNameAndDimensions(buf, useFullName, strict); buf.format(";"); if (!strict) buf.format(extraInfo()); buf.format("%n"); indent.incr(); for (Attribute att : getAttributes()) { if(Attribute.isspecial(att)) continue; buf.format("%s", indent); att.writeCDL(buf, strict, getShortName()); buf.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) buf.format(" // %s", att.getDataType()); buf.format("%n"); } indent.decr(); }
att.writeCDL(out, strict); out.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) out.format(" // %s", att.getDataType());
att.writeCDL(out, strict); out.format(";"); if (!strict && (att.getDataType() != DataType.STRING)) out.format(" // %s", att.getDataType());
att.writeCDL(out, strict, null); out.format(";"); if(!strict && (att.getDataType() != DataType.STRING)) out.format(" // %s", att.getDataType());