示例#1
0
  public void add(String type) {
    log.info("addRow");
    Cell cell1 = new Cell();
    cell1.setValue(0);

    Coll coll1 = new Coll();
    coll1.setIndex(0);
    coll1.setCell(cell1);

    ArrayList<Coll> aColl = new ArrayList<Coll>();
    aColl.add(coll1);

    Row row1 = new Row();
    row1.setIndex(0);
    row1.setColl(aColl);

    ArrayList<Row> aRow = new ArrayList<Row>();
    aRow.add(row1);

    Function f = new Function();
    f.setRow(aRow);
    f.setDescription("newFunction");
    f.setNameFirstArgument("x");
    f.setName("y");
    f.setType(type);
    getFunctions().add(f);
  }
 @Override
 public long save(Coll<?> coll, String id, JsonElement data) {
   File file = fileFromId(coll, id);
   String content = coll.getGson().toJson(data);
   if (DiscUtil.writeCatch(file, content) == false) return 0;
   return file.lastModified();
 }
示例#3
0
 @Override
 public Coll via(def<R> method) {
   $(iterable)
       .forEach(
           e -> {
             collection.add(method.apply(e));
           });
   return collection;
 }
示例#4
0
 @Override
 public <Coll extends Collection<T>> Coll findAll(def<Boolean> filter, Coll toColl, int limit) {
   return $(iterable)
       .to(toColl)
       .via(
           e -> {
             Boolean ret = filter.apply(e);
             if (null == ret || ret.equals(false)) Continue();
             if (limit > 0 && limit <= toColl.size()) {
               Break();
             }
             return e;
           });
 }
示例#5
0
 protected static DBCollection fixColl(Coll<?> coll) {
   return (DBCollection) coll.getCollDriverObject();
 }
 public static File getDirectory(Coll<?> coll) {
   return (File) coll.getCollDriverObject();
 }