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

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

本文整理了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

  1. protected void newSliceArray(int n) {
  2. slices = new Slice[n];
  3. }
  4. protected Slice newSlice(float startAngle) {
  5. return new Slice(startAngle);
  6. }

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

  1. /**
  2. * Creates a slice over the specified array.
  3. */
  4. public static Slice wrappedBuffer(byte... array)
  5. {
  6. if (array.length == 0) {
  7. return EMPTY_SLICE;
  8. }
  9. return new Slice(array);
  10. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedBooleanArray(boolean[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedFloatArray(float[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedIntArray(int[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedBuffer(byte[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedLongArray(long[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedLongArray(long[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array.
  3. */
  4. public static Slice wrappedBuffer(byte... array)
  5. {
  6. if (array.length == 0) {
  7. return EMPTY_SLICE;
  8. }
  9. return new Slice(array);
  10. }

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

  1. public Slice newSlice(Object base, long address, int size)
  2. {
  3. return new Slice(base, address, size, size, null);
  4. }
  5. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedShortArray(short[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedIntArray(int[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. public Slice newSlice(Object base, long address, int size)
  2. {
  3. return new Slice(base, address, size, size, null);
  4. }
  5. }

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

  1. private void sliceGenerator(int n){
  2. slices = new Slice[n];
  3. final float sweepAngle = 360.0f/(float)n;
  4. float startAngle = 0;
  5. for (int i=0;i<n;i++){
  6. slices[i] = new Slice(startAngle);
  7. startAngle += sweepAngle;
  8. }
  9. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedShortArray(short[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. /**
  2. * Creates a slice over the specified array range.
  3. *
  4. * @param offset the array position at which the slice begins
  5. * @param length the number of array positions to include in the slice
  6. */
  7. public static Slice wrappedFloatArray(float[] array, int offset, int length)
  8. {
  9. if (length == 0) {
  10. return EMPTY_SLICE;
  11. }
  12. return new Slice(array, offset, length);
  13. }

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

  1. public static Slice allocate(int capacity)
  2. {
  3. if (capacity == 0) {
  4. return EMPTY_SLICE;
  5. }
  6. if (capacity > MAX_ARRAY_SIZE) {
  7. throw new SliceTooLargeException(format("Cannot allocate slice larger than %s bytes", MAX_ARRAY_SIZE));
  8. }
  9. return new Slice(new byte[capacity]);
  10. }

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

  1. public static Slice allocate(int capacity)
  2. {
  3. if (capacity == 0) {
  4. return EMPTY_SLICE;
  5. }
  6. checkArgument(capacity <= MAX_ARRAY_SIZE, "Cannot allocate slice larger than " + MAX_ARRAY_SIZE + " bytes");
  7. return new Slice(new byte[capacity]);
  8. }

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

  1. Command[] commands = {new Slice(), new Dice()};
  2. for (Command cmd : commands) {
  3. if (some_string.equals(cmd.getClass().getName())) {
  4. cmd.run (argv);
  5. return;
  6. }
  7. }

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

  1. Command[] = {new Slice(), new Dice()};
  2. for (Command c : commands) {
  3. if (someString.equals(c.getClass().getName())) {
  4. c.run(args);
  5. return;
  6. }
  7. }

相关文章