VCollections.src.org.violetlib.collections.Visitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vcollections Show documentation
Show all versions of vcollections Show documentation
Java Immutable Collections
The newest version!
/*
* Copyright (c) 2023 Alan Snyder.
* All rights reserved.
*
* You may not use, copy or modify this file, except in compliance with the license agreement. For details see
* accompanying license terms.
*/
package org.violetlib.collections;
import org.violetlib.collections.impl.ListImplSupport;
import org.jetbrains.annotations.*;
/**
A visitor of elements in a collection.
@param The type of the elements.
*/
public interface Visitor
{
/**
Return a visitor that calls an indexed visitor.
The indexed visitor receives indexes in increasing order.
*/
static @NotNull Visitor fromIndexedVisitor(@NotNull IndexedVisitor v)
{
return ListImplSupport.fromIndexedVisitor(v);
}
void visit(@NotNull E element);
}