001/* 002 * ============================================================================ 003 * Copyright © 2002-2020 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * 007 * Licensed to the public under the agreements of the GNU Lesser General Public 008 * License, version 3.0 (the "License"). You may obtain a copy of the License at 009 * 010 * http://www.gnu.org/licenses/lgpl.html 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 015 * License for the specific language governing permissions and limitations 016 * under the License. 017 */ 018 019package org.tquadrat.foundation.function; 020 021import static org.apiguardian.api.API.Status.STABLE; 022 023import java.util.function.Supplier; 024 025import org.apiguardian.api.API; 026import org.tquadrat.foundation.annotation.ClassVersion; 027 028/** 029 * <p>{@summary Represents a supplier of 030 * {@link Number}-valued 031 * results.} This is the {@code Number}-producing specialisation of 032 * {@link java.util.function.Supplier}.</p> 033 * <p>There is no requirement that a distinct result is returned each time the 034 * supplier is invoked.</p> 035 * <p>This is a 036 * {@linkplain java.lang.FunctionalInterface functional interface} 037 * whose functional method is 038 * {@link #getAsNumber()}.</p> 039 * 040 * @see java.util.function.Supplier 041 * 042 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 043 * @version $Id: NumberSupplier.java 993 2022-01-19 22:26:20Z tquadrat $ 044 * @since 0.0.5 045 * 046 * @UMLGraph.link 047 */ 048@ClassVersion( sourceVersion = "$Id: NumberSupplier.java 993 2022-01-19 22:26:20Z tquadrat $" ) 049@FunctionalInterface 050@API( status = STABLE, since = "0.0.5" ) 051public interface NumberSupplier extends Supplier<Number> 052{ 053 /*---------*\ 054 ====** Methods **========================================================== 055 \*---------*/ 056 /** 057 * {@inheritDoc} 058 */ 059 @Override 060 public default Number get() { return getAsNumber(); } 061 062 /** 063 * Gets a result. 064 * 065 * @return The result; may be {@code null}. 066 */ 067 public Number getAsNumber(); 068} 069// interface NumberSupplier 070 071/* 072 * End of File 073 */