示例#1
0
  // <editor-fold defaultstate="collapsed" desc="named()">
  public FunctionSetHelper named(final String name) {
    if (name == null) throw new IllegalArgumentException("name==null");
    if (mem == null) return new FunctionSetHelper(Iterators.<Function>empty());

    Object o = mem.get(name);
    if (o instanceof Function) {
      FunctionSetHelper fs = new FunctionSetHelper(Iterators.<Function>single((Function) o));
      fs.mem = mem;
      return fs;
    }

    if (o instanceof FunctionSet) {
      FunctionSetHelper fs = new FunctionSetHelper(((FunctionSet) o).getFunctions());
      fs.mem = mem;
      return fs;
    }

    return new FunctionSetHelper(Iterators.<Function>empty());
  }
示例#2
0
 // <editor-fold defaultstate="collapsed" desc="functions()">
 public Iterable<Function> functions() {
   if (fset != null) return fset.getFunctions();
   if (funitr != null) return funitr;
   return Iterators.empty();
 }