congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ArrayLong
Code IndexAdd Tabnine to your IDE (free)

How to use
ArrayLong
in
ucar.ma2

Best Java code snippets using ucar.ma2.ArrayLong (Showing top 20 results out of 315)

origin: edu.ucar/netcdf

/** create new Array with given indexImpl and same backing store */
protected Array createView( Index index) {
 return ArrayLong.factory( index, storage);
}
origin: Unidata/thredds

 public ByteBuffer getDataAsByteBuffer(ByteOrder order) {
   ByteBuffer bb = super.getDataAsByteBuffer((int) (8 * getSize()), order);
   LongBuffer ib = bb.asLongBuffer();
   ib.put( (long[]) get1DJavaArray(getDataType())); // make sure its in canonical order
   return bb;
}
origin: edu.ucar/netcdf

public Object getObject(int index) { return getLong(index); }
public void setObject(int index, Object value) { storage[index] = ((Number)value).longValue(); }
origin: Unidata/thredds

/** create new Array with given indexImpl and same backing store */
protected Array createView( Index index) {
 return ArrayLong.factory( index, isUnsigned(), storage);
}
origin: edu.ucar/netcdf

public ByteBuffer getDataAsByteBuffer() {
 ByteBuffer bb = ByteBuffer.allocate((int)(8*getSize()));
 LongBuffer ib = bb.asLongBuffer();
 ib.put( (long[]) get1DJavaArray(long.class)); // make sure its in canonical order
 return bb;
}
origin: edu.ucar/netcdf

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

public ByteBuffer getDataAsByteBuffer() {return getDataAsByteBuffer(null);}
origin: edu.ucar/cdm

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

public ByteBuffer getDataAsByteBuffer() {
 ByteBuffer bb = ByteBuffer.allocate((int)(8*getSize()));
 LongBuffer ib = bb.asLongBuffer();
 ib.put( (long[]) get1DJavaArray(long.class)); // make sure its in canonical order
 return bb;
}
origin: Unidata/thredds

static ArrayLong factory( Index index, boolean isUnsigned, long [] storage) {
  if (index instanceof Index0D) {
    return new ArrayLong.D0(index, isUnsigned, storage);
  } else if (index instanceof Index1D) {
    return new ArrayLong.D1(index, isUnsigned, storage);
  } else if (index instanceof Index2D) {
    return new ArrayLong.D2(index, isUnsigned, storage);
  } else if (index instanceof Index3D) {
    return new ArrayLong.D3(index, isUnsigned, storage);
  } else if (index instanceof Index4D) {
    return new ArrayLong.D4(index, isUnsigned, storage);
  } else if (index instanceof Index5D) {
    return new ArrayLong.D5(index, isUnsigned, storage);
  } else if (index instanceof Index6D) {
    return new ArrayLong.D6(index, isUnsigned, storage);
  } else if (index instanceof Index7D) {
    return new ArrayLong.D7(index, isUnsigned, storage);
  } else {
    return new ArrayLong(index, isUnsigned, storage);
  }
}
origin: edu.ucar/cdm

/** package private. use Array.factory() */
static ArrayLong factory(Index index) {
 return ArrayLong.factory(index, null);
}
origin: Unidata/thredds

public Object getObject(int index) { return getLong(index); }
public void setObject(int index, Object value) { storage[index] = ((Number)value).longValue(); }
origin: edu.ucar/netcdf

/**
 * Generate new Array with given type and shape and an Index that always return 0.
 *
 * @param classType element Class type, eg double.class.
 * @param shape     shape of the array.
 * @param storage   primitive array of correct type of length 1
 * @return new Array<type> or Array<type>.D<rank> if 0 <= rank <= 7.
 */
static public Array factoryConstant(Class classType, int[] shape, Object storage) {
 Index index = new IndexConstant(shape);
 if ((classType == double.class) || (classType == Double.class))
  return new ArrayDouble(index, (double[]) storage);
 else if ((classType == float.class) || (classType == Float.class))
  return new ArrayFloat(index, (float[]) storage);
 else if ((classType == long.class) || (classType == Long.class))
  return new ArrayLong(index, (long[]) storage);
 else if ((classType == int.class) || (classType == Integer.class))
  return new ArrayInt(index, (int[]) storage);
 else if ((classType == short.class) || (classType == Short.class))
  return new ArrayShort(index, (short[]) storage);
 else if ((classType == byte.class) || (classType == Byte.class))
  return new ArrayByte(index, (byte[]) storage);
 else if ((classType == char.class) || (classType == Character.class))
  return new ArrayChar(index, (char[]) storage);
 else if ((classType == boolean.class) || (classType == Boolean.class))
  return new ArrayBoolean(index, (boolean[]) storage);
 else
  return new ArrayObject(classType, index, (Object[]) storage);
}
origin: Unidata/thredds

/** package private. use Array.factory() */
static ArrayLong factory(Index index, boolean isUnsigned) {
 return ArrayLong.factory(index, isUnsigned, null);
}
origin: edu.ucar/cdm

public Object getObject(int index) { return getLong(index); }
public void setObject(int index, Object value) { storage[index] = ((Number)value).longValue(); }
origin: Unidata/thredds

 return new ArrayInt(index, false, (int[]) storage);
case LONG:
 return new ArrayLong(index, false, (long[]) storage);
case FLOAT:
 return new ArrayFloat(index, (float[]) storage);
 return new ArrayInt(index, true, (int[]) storage);
case ULONG:
 return new ArrayLong(index, true, (long[]) storage);
origin: edu.ucar/netcdf

/** package private. use Array.factory() */
static ArrayLong factory(Index index) {
 return ArrayLong.factory(index, null);
}
origin: edu.ucar/cdm

/**
 * Generate new Array with given type and shape and an Index that always return 0.
 *
 * @param classType element Class type, eg double.class.
 * @param shape     shape of the array.
 * @param storage   primitive array of correct type of length 1
 * @return new Array<type> or Array<type>.D<rank> if 0 <= rank <= 7.
 */
static public Array factoryConstant(Class classType, int[] shape, Object storage) {
 Index index = new IndexConstant(shape);
 if ((classType == double.class) || (classType == Double.class))
  return new ArrayDouble(index, (double[]) storage);
 else if ((classType == float.class) || (classType == Float.class))
  return new ArrayFloat(index, (float[]) storage);
 else if ((classType == long.class) || (classType == Long.class))
  return new ArrayLong(index, (long[]) storage);
 else if ((classType == int.class) || (classType == Integer.class))
  return new ArrayInt(index, (int[]) storage);
 else if ((classType == short.class) || (classType == Short.class))
  return new ArrayShort(index, (short[]) storage);
 else if ((classType == byte.class) || (classType == Byte.class))
  return new ArrayByte(index, (byte[]) storage);
 else if ((classType == char.class) || (classType == Character.class))
  return new ArrayChar(index, (char[]) storage);
 else if ((classType == boolean.class) || (classType == Boolean.class))
  return new ArrayBoolean(index, (boolean[]) storage);
 else
  return new ArrayObject(classType, index, (Object[]) storage);
}
origin: edu.ucar/cdm

/** create new Array with given indexImpl and same backing store */
protected Array createView( Index index) {
 return ArrayLong.factory( index, storage);
}
origin: Unidata/thredds

 public void testConvert() {
 int [] shape = new int[1];
 shape[0] = 10;
 Array A = new ArrayDouble(shape);
 convert(A, false);
 //castObject(A);
 A = new ArrayFloat(shape);
 convert(A, false);
 //castObject(A);
 A = new ArrayLong(shape, false);
 convert(A, false);
 //castObject(A);
 A = new ArrayInt(shape, false);
 convert(A, false);
 //castObject(A);
 A = new ArrayShort(shape, false);
 convert(A, false);
 //castObject(A);
 A = new ArrayByte(shape, false);
 convert(A, false);
 //castObject(A);
 A = new ArrayChar(shape);
 convert(A, false);
 //castObject(A);
 A = new ArrayBoolean(shape);
 convert(A, true);
 //castObject(A);
}
ucar.ma2ArrayLong

Javadoc

Concrete implementation of Array specialized for longs. Data storage is with 1D java array of longs. issues: what should we do if a conversion loses accuracy? nothing ? Exception ?

Most used methods

  • <init>
    Create a new Array of type long and the given shape. dimensions.length determines the rank of the ne
  • factory
  • get1DJavaArray
  • getLong
  • getSize
  • getDataAsByteBuffer
  • getDataType
  • isUnsigned

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Join (org.hibernate.mapping)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now