Codota Logo
ArrayChar$D1
Code IndexAdd Codota to your IDE (free)

How to use
ArrayChar$D1
in
ucar.ma2

Best Java code snippets using ucar.ma2.ArrayChar$D1 (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: edu.ucar/cdm

/**
 * Create an ArrayChar from a String
 *
 * @param s String
 * @param max maximum length
 * @return equivilent ArrayChar
 */
public static ArrayChar makeFromString(String s, int max) {
 ArrayChar result = new ArrayChar.D1( max);
 for (int i=0; i<max && i<s.length(); i++)
  result.setChar( i, s.charAt(i));
 return result;
}
origin: edu.ucar/netcdf

/**
 * Create an ArrayChar from a String
 *
 * @param s String
 * @param max maximum length
 * @return equivilent ArrayChar
 */
public static ArrayChar makeFromString(String s, int max) {
 ArrayChar result = new ArrayChar.D1( max);
 for (int i=0; i<max && i<s.length(); i++)
  result.setChar( i, s.charAt(i));
 return result;
}
origin: Unidata/thredds

@Test
public void testWriteBigString() throws IOException {
 String filename = tempFolder.newFile().getAbsolutePath();
 try (NetcdfFileWriter ncfile = NetcdfFileWriter.createNew(filename, false)) {
  int len = 120000;
  ArrayChar.D1 arrayCharD1 = new ArrayChar.D1(len);
  for (int i = 0; i < len; i++)
   arrayCharD1.set(i, '1');
  ncfile.addGlobalAttribute( new Attribute("tooLongChar", arrayCharD1));
  char[] carray = new char[len];
  for (int i = 0; i < len; i++)
   carray[i] = '2';
  String val = new String(carray);
  ncfile.addGlobalAttribute("tooLongString", val);
  ncfile.create();
 }
}
origin: edu.ucar/cdm

static ArrayChar factory(Index index, char[] storage) {
 switch (index.getRank()) {
  case 0:
   return new ArrayChar.D0(index, storage);
  case 1:
   return new ArrayChar.D1(index, storage);
  case 2:
   return new ArrayChar.D2(index, storage);
  case 3:
   return new ArrayChar.D3(index, storage);
  case 4:
   return new ArrayChar.D4(index, storage);
  case 5:
   return new ArrayChar.D5(index, storage);
  case 6:
   return new ArrayChar.D6(index, storage);
  case 7:
   return new ArrayChar.D7(index, storage);
  default:
   return new ArrayChar(index, storage);
 }
}
origin: Unidata/thredds

/**
 * Create an ArrayChar from a String
 *
 * @param s String
 * @param max maximum length
 * @return equivilent ArrayChar
 */
public static ArrayChar makeFromString(String s, int max) {
 ArrayChar result = new ArrayChar.D1( max);
 for (int i=0; i<max && i<s.length(); i++)
  result.setChar( i, s.charAt(i));
 return result;
}
origin: edu.ucar/netcdf

static ArrayChar factory(Index index, char[] storage) {
 switch (index.getRank()) {
  case 0:
   return new ArrayChar.D0(index, storage);
  case 1:
   return new ArrayChar.D1(index, storage);
  case 2:
   return new ArrayChar.D2(index, storage);
  case 3:
   return new ArrayChar.D3(index, storage);
  case 4:
   return new ArrayChar.D4(index, storage);
  case 5:
   return new ArrayChar.D5(index, storage);
  case 6:
   return new ArrayChar.D6(index, storage);
  case 7:
   return new ArrayChar.D7(index, storage);
  default:
   return new ArrayChar(index, storage);
 }
}
origin: Unidata/thredds

public void makeNetCDF() throws IOException, InvalidRangeException {
 String helloGreek = makeString(helloGreekCode, true);
 helloGreek = ""; //Normalizer.normalize(helloGreek, Normalizer.Form.NFC);
 System.out.println("normalized= "+showString(helloGreek));
 String filename = "C:/data/unicode/helloNorm.nc";
 NetcdfFileWriter ncfile = NetcdfFileWriter.createNew(filename, true);
 ucar.nc2.Dimension dim = ncfile.addDimension(helloGreek, 20);
 ncfile.addVariable(helloGreek, DataType.CHAR, helloGreek);
 ncfile.addVariableAttribute(helloGreek, "units", helloGreek);
 ncfile.create();
 ArrayChar.D1 data = new ArrayChar.D1(dim.getLength());
 data.setString(helloGreek);
 ncfile.write(helloGreek, data);
 ncfile.close();
 NetcdfFile nc = NetcdfFile.open(filename);
 Variable v = ncfile.findVariable(helloGreek);
 assert v != null;
 assert v.getShortName().equals(helloGreek);
 Attribute att = v.findAttribute("units");
 assert att != null;
 assert att.isString();
 assert(helloGreek.equals(att.getStringValue()));
 nc.close();    
}
origin: Unidata/thredds

shape = v.getShape();
int[] origin1 = new int[1];
ArrayChar ac = new ArrayChar.D1(shape[0]);
ima = ac.getIndex();
String val = "Testing 1-2-3";
len = shape[0];
try {
 ArrayChar ac2 = new ArrayChar.D1(len);
 ac2.setString("Two pairs of ladies stockings!");
 writer.write(v, ac2);
origin: Unidata/thredds

ArrayChar ac = new ArrayChar.D1(svar_len.getLength());
ima = ac.getIndex();
String val = "Testing 1-2-3";
 ArrayChar ac2 = new ArrayChar.D1(svar_len.getLength());
 ac2.setString("Two pairs of ladies stockings!");
 ncfile.write(sVar2, origin1, ac2);
origin: Unidata/thredds

ArrayChar ac = new ArrayChar.D1(svar_len.getLength());
ima = ac.getIndex();
String val = "Testing 1-2-3";
 ArrayChar ac2 = new ArrayChar.D1(svar_len.getLength());
 ac2.setString("Two pairs of ladies stockings!");
 v = writer.findVariable("svar2");
origin: Unidata/thredds

static ArrayChar factory(Index index, char[] storage) {
 if (index instanceof Index0D) {
  return new ArrayChar.D0(index, storage);
 } else if (index instanceof Index1D) {
  return new ArrayChar.D1(index, storage);
 } else if (index instanceof Index2D) {
  return new ArrayChar.D2(index, storage);
 } else if (index instanceof Index3D) {
  return new ArrayChar.D3(index, storage);
 } else if (index instanceof Index4D) {
  return new ArrayChar.D4(index, storage);
 } else if (index instanceof Index5D) {
  return new ArrayChar.D5(index, storage);
 } else if (index instanceof Index6D) {
  return new ArrayChar.D6(index, storage);
 } else if (index instanceof Index7D) {
  return new ArrayChar.D7(index, storage);
 } else {
  return new ArrayChar(index, storage);
 }
}
ucar.ma2ArrayChar$D1

Javadoc

Concrete implementation of Array specialized for char, rank 1.

Most used methods

  • <init>
  • set
    set the value.
  • setString

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • startActivity (Activity)
  • putExtra (Intent)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now