If not already created, a new <code>function</code> element will be created and returned.
Otherwise, the first existing <code>function</code> element will be returned.
@return the instance defined for the element <code>function</code>
163297
public FunctionType<WebJsptaglibraryDescriptor> getOrCreateFunction()
   {
      List<Node> nodeList = model.get("function");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FunctionTypeImpl<WebJsptaglibraryDescriptor>(this, "function", model, nodeList.get(0));
      }
      return createFunction();
   }
487017
public List<T> getElements() {
		ArrayList<T> list = new ArrayList<>(nodes.size());
		for (Node<T> node : nodes)
			list.add(node.element);
		return list;
	}
	
	/** Return the number of elements. */
	public int size() { return nodes.size(); }
	
}
392442
public static <R, C, V> Function<Table.Cell<R, C, V>, R> toRowKeyFunction() {
    return new Function<Table.Cell<R, C, V>, R>() {
      @Override
      public R apply(final Table.Cell<R, C, V> input) {
        return input.getRowKey();
      }
    };
  }
904512
public static <T> Function<Object, T> throwIllegalArgumentException() {
    // It is safe to cast this function to have any return type, since it never returns a result.
    @SuppressWarnings("unchecked")
    Function<Object, T> function = (Function<Object, T>) THROW_ILLEGAL_ARGUMENT_EXCEPTION;
    return function;
  }
1184385
public static FunctionMapper newFunctionMapper() {
        ServiceLoader<FunctionMapperSpi> loader = loadFunctionMapperSpi();

        // load FunctionMapperSpi instances
        ConcurrentMap<String, FunctionMapperSpi> functionMappers = new ConcurrentHashMap<>();
        for (FunctionMapperSpi functionMapperSpi : loader) {
            String prefixName = functionMapperSpi.getPrefixName();
            FunctionMapperSpi oldFunctionMapperSpi = functionMappers.putIfAbsent(prefixName, functionMapperSpi);
            if (oldFunctionMapperSpi != null) {
                throw new ELException(String.format("Duplicate prefix function mapper: %s", prefixName));
            }
        }

        return new FunctionMapper(functionMappers);
    }
4299
public static <K, V> Function<Map.Entry<K, V>, V> entryToValueFunction() {
      return EntryToValueFunction.getInstance();
   }
1080991
@SequentialOnly
    public static <T> Function<T, Indexed<T>> indexed() {
        return new Function<T, Indexed<T>>() {
            private final MutableLong idx = new MutableLong(0);

            @Override
            public Indexed<T> apply(T t) {
                return Indexed.of(t, idx.getAndIncrement());
            }
        };
    }
18338
public static Function.Factory factory(final Function fun)
    {
        return new Function.Factory()
        {
            public Function create(String ksName, String cfName)
            {
                return fun;
            }
        };
    }
965107
public Token add( Function function ) {
        Token t = new Token(function);
        push( t );
        return t;
    }
1167804
function() {
    var
      tok = this.expect('function'),
      name = tok.val.name;

    // params
    this.state.push('function params');
    this.skipWhitespace();
    var params = this.params();
    this.skipWhitespace();
    this.expect(')');
    this.state.pop();

    // Body
    this.state.push('function');
    var fn = new nodes.Function(name, params);

    fn.column = tok.column;
    fn.lineno = tok.lineno;

    fn.block = this.block(fn);
    this.state.pop();
    return new nodes.Ident(name, fn);
  }
643230
public AnnotationType<ElementType<T>> getOrCreateAnnotation()
   {
      List<Node> nodeList = childNode.get("annotation");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new AnnotationTypeImpl<ElementType<T>>(this, "annotation", childNode, nodeList.get(0));
      }
      return createAnnotation();
   }
945168
public static Function<EREEventMention, TYPE> typeFunction() {
    return new Function<EREEventMention, TYPE>() {
      @Override
      public TYPE apply(final EREEventMention input) {
        return input.getType();
      }
    };
  }
1055794
function() {
    var target = arguments[0];
    var type = lib.type.typeOf(target);
    if (type === "object") {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        var srctype = lib.type.typeOf(source);
        if (srctype === "object") {
          var keys = Object.keys(source);
          var len = keys.length;
          for (var a = 0; a < len; a++) {
            var key = keys[a];
            target[key] = source[key];
          }
        }
      }
    } else if (type == "function") {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        var srctype = lib.type.typeOf(source);
        if (srctype === "object") {
          var keys = Object.keys(source);
          var len = keys.length;
          for (var a = 0; a < len; a++) {
            var key = keys[a];
            target.prototype[key] = lib.method.createMethod(source[key]);
          }
        }
      }
    }
    return target;
  }
794094
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new ClassWithVarintProperty();
			case 1:
				return new ClassWithVarintProperty(func_get_arg(0));
			case 2:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1));
			case 3:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
34352
function(element, options) {
      var options = options || {}
      if (element.length) {
        return this.createAll(options, element);
      } else {
        return this.newInstance(element, options);
      }
    }
1093548
public B error() {
    ErrorEventDefinition errorEventDefinition = createInstance(ErrorEventDefinition.class);
    element.getEventDefinitions().add(errorEventDefinition);

    return myself;
  }
662684
public static <T extends WebElement> Function<SearchContext, T> byToFunction(By by) {
        Function<SearchContext, T> function;
        if (by instanceof SingleElementOrNullBy) {
            // will not throw exception, but return null when no element is found
            function = sc -> (T) by.findElement(sc);
        } else {
            function = sc -> {
                // single element case will throw exception when no element is found
                List elements = by.findElements(sc);
                return (elements != null && !elements.isEmpty())? (T) elements.get(0) : null;
            };
        }
        return function;
    }