Copyright (c) 2015, Emir Pasic. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package arraylist

import 

func () {
	var  containers.EnumerableWithIndex = (*List)(nil)
}
Each calls the given function once for each element, passing that element's index and value.
func ( *List) ( func( int,  interface{})) {
	 := .Iterator()
	for .Next() {
		(.Index(), .Value())
	}
}
Map invokes the given function once for each element and returns a container containing the values returned by the given function.
func ( *List) ( func( int,  interface{}) interface{}) *List {
	 := &List{}
	 := .Iterator()
	for .Next() {
		.Add((.Index(), .Value()))
	}
	return 
}
Select returns a new container containing all elements for which the given function returns a true value.
func ( *List) ( func( int,  interface{}) bool) *List {
	 := &List{}
	 := .Iterator()
	for .Next() {
		if (.Index(), .Value()) {
			.Add(.Value())
		}
	}
	return 
}
Any passes each element of the collection to the given function and returns true if the function ever returns true for any element.
func ( *List) ( func( int,  interface{}) bool) bool {
	 := .Iterator()
	for .Next() {
		if (.Index(), .Value()) {
			return true
		}
	}
	return false
}
All passes each element of the collection to the given function and returns true if the function returns true for all elements.
func ( *List) ( func( int,  interface{}) bool) bool {
	 := .Iterator()
	for .Next() {
		if !(.Index(), .Value()) {
			return false
		}
	}
	return true
}
Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.
func ( *List) ( func( int,  interface{}) bool) (int, interface{}) {
	 := .Iterator()
	for .Next() {
		if (.Index(), .Value()) {
			return .Index(), .Value()
		}
	}
	return -1, nil