All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arcadedb.query.sql.parser.JsonArray Maven / Gradle / Ivy

There is a newer version: 24.11.1
Show newest version
/* Generated By:JJTree: Do not edit this line. JsonArray.java Version 7.0 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.arcadedb.query.sql.parser;

import java.util.*;
import java.util.stream.*;

public class JsonArray extends SimpleNode {
  public List items = new ArrayList<>();

  public JsonArray(int id) {
    super(id);
  }

  public void toString(final Map params, final StringBuilder builder) {
    builder.append("[");
    boolean first = true;
    for (final Json item : items) {
      if (!first) {
        builder.append(", ");
      }
      item.toString(params, builder);

      first = false;
    }
    builder.append("]");
  }

  public JsonArray copy() {
    final JsonArray result = new JsonArray(-1);
    result.items = items.stream().map(x -> x.copy()).collect(Collectors.toList());
    return result;
  }

  @Override
  protected Object[] getIdentityElements() {
    return new Object[] { items };
  }

}
/* JavaCC - OriginalChecksum=beafb9a5a435d346cad52bf835b7a2df (do not edit this line) */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy