org.codehaus.jackson.node.ArrayNode.size()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(25)

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

ArrayNode.size介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

public JsonNode _set(int index, JsonNode value)
{
  if (_children == null || index < 0 || index >= _children.size()) {
    throw new IndexOutOfBoundsException("Illegal index "+index+", array size "+size());
  }
  return _children.set(index, value);
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) { // final class, can do this
    return false;
  }
  ArrayNode other = (ArrayNode) o;
  if (_children == null || _children.size() == 0) {
    return other.size() == 0;
  }
  return other._sameChildren(_children);
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(16 + (size() << 4));
  sb.append('[');
  if (_children != null) {
    for (int i = 0, len = _children.size(); i < len; ++i) {
      if (i > 0) {
        sb.append(',');
      }
      sb.append(_children.get(i).toString());
    }
  }
  sb.append(']');
  return sb.toString();
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

/**
   * Note: this method gets called iff <code>otherChildren</code>
   * is non-empty
   */
  private boolean _sameChildren(ArrayList<JsonNode> otherChildren)
  {
    int len = otherChildren.size();
    if (this.size() != len) { // important: call size() to handle case of null list...
      return false;
    }
    for (int i = 0; i < len; ++i) {
      if (!_children.get(i).equals(otherChildren.get(i))) {
        return false;
      }
    }
    return true;
  }
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

/**
 * Method for adding all child nodes of given Array, appending to
 * child nodes this array contains
 * 
 * @param other Array to add contents from
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode addAll(ArrayNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new ArrayList<JsonNode>(len+2);
    }
    other.addContentsTo(_children);
  }
  return this;
}

代码示例来源:origin: apache/nifi

final int numElements = arrayNode.size();
final Object[] arrayElements = new Object[numElements];
int count = 0;

代码示例来源:origin: apache/nifi

final int numElements = arrayNode.size();
final Object[] arrayElements = new Object[numElements];
int count = 0;

代码示例来源:origin: apache/nifi

final int numElements = arrayNode.size();
final Object[] arrayElements = new Object[numElements];
int count = 0;

代码示例来源:origin: apache/nifi

final int numElements = arrayNode.size();
final Object[] arrayElements = new Object[numElements];
int count = 0;

代码示例来源:origin: apache/nifi

for (int i=0; i < arrayNode.size(); i++) {
  final JsonNode jsonNode = arrayNode.get(i);
  attributes.put(attributePrefix + ".table", tableName);
  attributes.put(FRAGMENT_ID.key(), fragmentIdentifier);
  attributes.put(FRAGMENT_COUNT.key(), String.valueOf(arrayNode.size()));
  attributes.put(FRAGMENT_INDEX.key(), String.valueOf(i));
FlowFile newFlowFile = copyAttributesToOriginal(session, flowFile, fragmentIdentifier, arrayNode.size());
session.transfer(newFlowFile, REL_ORIGINAL);

代码示例来源:origin: camunda/camunda-bpm-platform

public JsonNode _set(int index, JsonNode value)
{
  if (_children == null || index < 0 || index >= _children.size()) {
    throw new IndexOutOfBoundsException("Illegal index "+index+", array size "+size());
  }
  return _children.set(index, value);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public boolean equals(Object o)
{
  if (o == this) return true;
  if (o == null) return false;
  if (o.getClass() != getClass()) { // final class, can do this
    return false;
  }
  ArrayNode other = (ArrayNode) o;
  if (_children == null || _children.size() == 0) {
    return other.size() == 0;
  }
  return other._sameChildren(_children);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public String toString()
{
  StringBuilder sb = new StringBuilder(16 + (size() << 4));
  sb.append('[');
  if (_children != null) {
    for (int i = 0, len = _children.size(); i < len; ++i) {
      if (i > 0) {
        sb.append(',');
      }
      sb.append(_children.get(i).toString());
    }
  }
  sb.append(']');
  return sb.toString();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
   * Note: this method gets called iff <code>otherChildren</code>
   * is non-empty
   */
  private boolean _sameChildren(ArrayList<JsonNode> otherChildren)
  {
    int len = otherChildren.size();
    if (this.size() != len) { // important: call size() to handle case of null list...
      return false;
    }
    for (int i = 0; i < len; ++i) {
      if (!_children.get(i).equals(otherChildren.get(i))) {
        return false;
      }
    }
    return true;
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Method for adding all child nodes of given Array, appending to
 * child nodes this array contains
 * 
 * @param other Array to add contents from
 * 
 * @return This node (to allow chaining)
 * 
 * @since 1.3
 */
public JsonNode addAll(ArrayNode other)
{
  int len = other.size();
  if (len > 0) {
    if (_children == null) {
      _children = new ArrayList<JsonNode>(len+2);
    }
    other.addContentsTo(_children);
  }
  return this;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

public JsonNode _set(int index, JsonNode value)
{
  if (_children == null || index < 0 || index >= _children.size()) {
    throw new IndexOutOfBoundsException("Illegal index "+index+", array size "+size());
  }
  return _children.set(index, value);
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

public JsonNode _set(int index, JsonNode value)
{
  if (_children == null || index < 0 || index >= _children.size()) {
    throw new IndexOutOfBoundsException("Illegal index "+index+", array size "+size());
  }
  return _children.set(index, value);
}

代码示例来源:origin: io.snamp/json-helpers

@Override
  protected CharBuffer deserialize(final ArrayNode input) throws JsonProcessingException {
    final CharBuffer result = CharBuffer.allocate(input.size());
    for (final JsonNode node : input)
      result.put(node.asText());
    return result;
  }
}

代码示例来源:origin: com.netflix.eureka/eureka2-core

private Object handleArray(JsonParser jp, ArrayNode arrayNode) throws IOException {
    Object[] arrayInstance = (Object[]) Array.newInstance(rawClass.getComponentType(), arrayNode.size());
    for (int i = 0; i < arrayInstance.length; i++) {
      Object value = handleObject(jp, arrayNode.get(i));
      arrayInstance[i] = value;
    }
    return arrayInstance;
  }
}

代码示例来源:origin: io.snamp/json-helpers

@Override
  protected DoubleBuffer deserialize(final ArrayNode input) throws JsonProcessingException {
    final DoubleBuffer result = DoubleBuffer.allocate(input.size());
    for(final JsonNode node: input)
      result.put(node.asDouble());
    return result;
  }
}

相关文章