io.airlift.slice.Slice.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中io.airlift.slice.Slice.<init>()方法的一些代码示例,展示了Slice.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Slice.<init>()方法的具体详情如下:
包路径:io.airlift.slice.Slice
类名称:Slice
方法名:<init>

Slice.<init>介绍

[英]Creates an empty slice.
[中]创建一个空切片。

代码示例

代码示例来源:origin: stackoverflow.com

protected void newSliceArray(int n) {
  slices = new Slice[n];
}

protected Slice newSlice(float startAngle) {
  return new Slice(startAngle);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array.
 */
public static Slice wrappedBuffer(byte... array)
{
  if (array.length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedBooleanArray(boolean[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedFloatArray(float[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedIntArray(int[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedBuffer(byte[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedLongArray(long[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedLongArray(long[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: airlift/slice

/**
 * Creates a slice over the specified array.
 */
public static Slice wrappedBuffer(byte... array)
{
  if (array.length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array);
}

代码示例来源:origin: airlift/slice

public Slice newSlice(Object base, long address, int size)
  {
    return new Slice(base, address, size, size, null);
  }
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedShortArray(short[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: io.airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedIntArray(int[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: io.airlift/slice

public Slice newSlice(Object base, long address, int size)
  {
    return new Slice(base, address, size, size, null);
  }
}

代码示例来源:origin: stackoverflow.com

private void sliceGenerator(int n){
   slices = new Slice[n];
   final float sweepAngle = 360.0f/(float)n;
   float startAngle = 0;
   for (int i=0;i<n;i++){ 
     slices[i] = new Slice(startAngle);
     startAngle += sweepAngle;
   }
}

代码示例来源:origin: airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedShortArray(short[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: airlift/slice

/**
 * Creates a slice over the specified array range.
 *
 * @param offset the array position at which the slice begins
 * @param length the number of array positions to include in the slice
 */
public static Slice wrappedFloatArray(float[] array, int offset, int length)
{
  if (length == 0) {
    return EMPTY_SLICE;
  }
  return new Slice(array, offset, length);
}

代码示例来源:origin: airlift/slice

public static Slice allocate(int capacity)
{
  if (capacity == 0) {
    return EMPTY_SLICE;
  }
  if (capacity > MAX_ARRAY_SIZE) {
    throw new SliceTooLargeException(format("Cannot allocate slice larger than %s bytes", MAX_ARRAY_SIZE));
  }
  return new Slice(new byte[capacity]);
}

代码示例来源:origin: io.airlift/slice

public static Slice allocate(int capacity)
{
  if (capacity == 0) {
    return EMPTY_SLICE;
  }
  checkArgument(capacity <= MAX_ARRAY_SIZE, "Cannot allocate slice larger than " + MAX_ARRAY_SIZE + " bytes");
  return new Slice(new byte[capacity]);
}

代码示例来源:origin: stackoverflow.com

Command[] commands = {new Slice(), new Dice()};
for (Command cmd : commands) {
 if (some_string.equals(cmd.getClass().getName())) {
  cmd.run (argv);
  return;
 }
}

代码示例来源:origin: stackoverflow.com

Command[] = {new Slice(), new Dice()};
for (Command c : commands) {
  if (someString.equals(c.getClass().getName())) {
    c.run(args);
    return;
  }
}

相关文章