Property definitions

core $ ListIterator :: defaultinit
# This is the iterator class of List
class ListIterator[E]
	super IndexedIterator[E]
	redef fun item do return _node.as(not null).item

	# Set item `e` at self `index`.
	fun item=(e: E) do _node.as(not null).item = e

	redef fun is_ok do return not _node == null

	redef fun next
	do
		_node = _node.as(not null).next
		_index += 1
	end

	# Build a new iterator for `list`.
	init
	do
		_node = _list._head
	end

	# The current list
	private var list: List[E]

	# The current node of the list
	private var node: nullable ListNode[E] = null

	# The index of the current node
	redef var index = 0

	# Remove the current item
	fun delete
	do
		_list.remove_node(_node.as(not null))
	end

	# Insert before the current item
	fun insert_before(element: E)
	do
		_list.insert_before(element, _node.as(not null))
	end
end
lib/core/collection/list.nit:269,1--311,3