001/* 002 * ============================================================================ 003 * Copyright © 2014 by Dominic Fox. 004 * All Rights Reserved. 005 * ============================================================================ 006 * The MIT License (MIT) 007 * 008 * Permission is hereby granted, free of charge, to any person obtaining a copy 009 * of this software and associated documentation files (the "Software"), to 010 * deal in the Software without restriction, including without limitation the 011 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 012 * sell copies of the Software, and to permit persons to whom the Software is 013 * furnished to do so, subject to the following conditions: 014 * 015 * The above copyright notice and this permission notice shall be included in 016 * all copies or substantial portions of the Software. 017 * 018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 019 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 020 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 021 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 022 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 023 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 024 * IN THE SOFTWARE. 025 */ 026 027package org.tquadrat.foundation.stream; 028 029import static org.apiguardian.api.API.Status.STABLE; 030 031import java.util.function.Function; 032 033import org.apiguardian.api.API; 034import org.tquadrat.foundation.annotation.ClassVersion; 035 036/** 037 * A selector function takes an array of values and returns the respective 038 * array index for the selected value. See 039 * {@link Selectors} 040 * for some implementations of this interface. 041 * 042 * @author Dominic Fox 043 * @modified Thomas Thrien - thomas.thrien@tquadrat.org 044 * @version $Id: Selector.java 1031 2022-04-07 22:43:02Z tquadrat $ 045 * @since 0.0.7 046 * 047 * @param <T> The type of the values to select from. 048 * 049 * @UMLGraph.link 050 */ 051@FunctionalInterface 052@ClassVersion( sourceVersion = "$Id: Selector.java 1031 2022-04-07 22:43:02Z tquadrat $" ) 053@API( status = STABLE, since = "0.0.7" ) 054public interface Selector<T> extends Function<T [],Integer> 055{ 056 /*---------*\ 057 ====** Methods **========================================================== 058 \*---------*/ 059 /** 060 * {@inheritDoc} 061 */ 062 @Override 063 Integer apply( T [] t ); 064} 065// interface Selector 066 067/* 068 * End of File 069 */