cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
public void setValues(Variable v, List<String> values) throws IllegalArgumentException {
    Array data = Array.makeArray(v.getDataType(), values);

    if (data.getSize() != v.getSize())
      throw new IllegalArgumentException("Incorrect number of values specified for the Variable " + v.getFullName() +
              " needed= " + v.getSize() + " given=" + data.getSize());

    if (v.getRank() != 1) // dont have to reshape for rank 1
      data = data.reshape(v.getShape());

    v.setCachedData(data, true);
  }
public void setValues(Variable v, List<String> values) throws IllegalArgumentException {
    Array data = Array.makeArray(v.getDataType(), values);

    if (data.getSize() != v.getSize())
      throw new IllegalArgumentException("Incorrect number of values specified for the Variable " + v.getFullName() +
              " needed= " + v.getSize() + " given=" + data.getSize());

    if (v.getRank() != 1) // dont have to reshape for rank 1
      data = data.reshape(v.getShape());

    v.setCachedData(data, true);
  }
public void setValues ( Variable v , List < String > values ) throws IllegalArgumentException { Array data = Array . makeArray ( v . getDataType ( ) , values ) ; if ( data . getSize ( ) != v . getSize ( ) ) throw new IllegalArgumentException ( "Incorrect number of values specified for the Variable " + v . getFullName ( ) + " needed= " + v . getSize ( ) + " given=" + data . getSize ( ) ) ; if ( v . getRank ( ) != 1 ) // dont have to reshape for rank 1 data = data . reshape ( v . getShape ( ) ) ; v . setCachedData ( data , true ) ; }
Set the data values from a list of Strings.

@param v      for this variable
@param values list of Strings
@throws IllegalArgumentException if values array not correct size, or values wont parse to the correct type
@deprecated use Variable.setValues()
Set the data values from a list of Strings .