org.boon.Boon.len()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(160)

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

Boon.len介绍

暂无

代码示例

代码示例来源:origin: boonproject/boon

public static boolean isEmpty(Object object) {
    return len(object) == 0;
  }
}

代码示例来源:origin: boonproject/boon

public static boolean isEmpty(Object object) {
    return len(object) == 0;
  }
}

代码示例来源:origin: io.fastjson/boon

public static boolean isEmpty(Object object) {
    return len(object) == 0;
  }
}

代码示例来源:origin: boonproject/boon

@SuppressWarnings({"rawtypes", "unchecked"})
public static Set toSet(Object value) {
  if (value instanceof Set) {
    return (Set) value;
  } else if (value instanceof Collection) {
    return new HashSet((Collection) value);
  } else {
    HashSet set = new HashSet(Boon.len(value));
    Iterator<Object> iterator = iterator(Typ.object, value);
    while (iterator.hasNext()) {
      set.add(iterator.next());
    }
    return set;
  }
}

代码示例来源:origin: boonproject/boon

public static double[] darray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.doubleArray) {
    return (double[]) value;
  }
  double[] values = new double[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toFloat(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static short[] sarray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.shortArray) {
    return (short[]) value;
  }
  short[] values = new short[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toShort(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static int[] iarray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.intArray) {
    return (int[]) value;
  }
  int[] values = new int[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toInt(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static char[] carray(Object value) {
  //You could handleUnexpectedException shorts, ints, longs and chars more efficiently
  if (value.getClass() == Typ.charArray) {
    return (char[]) value;
  }
  char[] values = new char[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Typ.object, value);
  while (iterator.hasNext()) {
    values[index] = toChar(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static float[] farray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.floatArray) {
    return (float[]) value;
  }
  float[] values = new float[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toFloat(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static short[] sarray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.shortArray) {
    return (short[]) value;
  }
  short[] values = new short[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toShort(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static long[] larray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.shortArray) {
    return (long[]) value;
  }
  long[] values = new long[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toLong(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static byte[] barray(Object value) {
  //You could handleUnexpectedException shorts, ints, longs and chars more efficiently
  if (value.getClass() == Typ.byteArray) {
    return (byte[]) value;
  }
  byte[] values = new byte[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toByte(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static char[] carray(Object value) {
  //You could handleUnexpectedException shorts, ints, longs and chars more efficiently
  if (value.getClass() == Typ.charArray) {
    return (char[]) value;
  }
  char[] values = new char[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Typ.object, value);
  while (iterator.hasNext()) {
    values[index] = toChar(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static long[] larray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.shortArray) {
    return (long[]) value;
  }
  long[] values = new long[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toLong(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static double[] darray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.doubleArray) {
    return (double[]) value;
  }
  double[] values = new double[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toFloat(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static float[] farray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.floatArray) {
    return (float[]) value;
  }
  float[] values = new float[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toFloat(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static int[] iarray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.intArray) {
    return (int[]) value;
  }
  int[] values = new int[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toInt(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: boonproject/boon

public static byte[] barray(Object value) {
  //You could handleUnexpectedException shorts, ints, longs and chars more efficiently
  if (value.getClass() == Typ.byteArray) {
    return (byte[]) value;
  }
  byte[] values = new byte[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toByte(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: io.fastjson/boon

public static double[] darray(Object value) {
  //You could handleUnexpectedException shorts, bytes, longs and chars more efficiently
  if (value.getClass() == Typ.doubleArray) {
    return (double[]) value;
  }
  double[] values = new double[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toFloat(iterator.next());
    index++;
  }
  return values;
}

代码示例来源:origin: io.fastjson/boon

public static byte[] barray(Object value) {
  //You could handleUnexpectedException shorts, ints, longs and chars more efficiently
  if (value.getClass() == Typ.byteArray) {
    return (byte[]) value;
  }
  byte[] values = new byte[Boon.len(value)];
  int index = 0;
  Iterator<Object> iterator = iterator(Object.class, value);
  while (iterator.hasNext()) {
    values[index] = toByte(iterator.next());
    index++;
  }
  return values;
}

相关文章