001/* 002 * ============================================================================ 003 * Copyright © 2002-2023 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.util.internal; 019 020import static org.apiguardian.api.API.Status.STABLE; 021 022import java.io.Serial; 023 024import org.apiguardian.api.API; 025import org.tquadrat.foundation.annotation.ClassVersion; 026import org.tquadrat.foundation.util.RangeMap; 027 028/** 029 * An implementation of {@code RangeMap} that does not allow changes. 030 * 031 * @param <T> The type of the mapped value. 032 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 033 * @version $Id: FinalRangeMap.java 1060 2023-09-24 19:21:40Z tquadrat $ 034 * @UMLGraph.link 035 * @since 0.0.7 036 */ 037@ClassVersion( sourceVersion = "$Id: FinalRangeMap.java 1060 2023-09-24 19:21:40Z tquadrat $" ) 038@API( status = STABLE, since = "0.0.7" ) 039public final class FinalRangeMap<T> extends RangeMapImpl<T> 040{ 041 /*------------------------*\ 042 ====** Static Initialisations **======================================= 043 \*------------------------*/ 044 /** 045 * The serial version UID for objects of this class: {@value}. 046 * 047 * @hidden 048 */ 049 @Serial 050 private static final long serialVersionUID = 1; 051 052 /*--------------*\ 053 ====** Constructors **================================================= 054 \*--------------*/ 055 /** 056 * Creates a new {@code FinalRangeMap} instance from the given 057 * instance of {@code RangeMap}. 058 * 059 * @param other The other 060 * {@link RangeMapImpl}. 061 */ 062 @SuppressWarnings( "UseOfConcreteClass" ) 063 public FinalRangeMap( final RangeMapImpl<? extends T> other ) 064 { 065 super( other ); 066 } // FinalRangeMap() 067 068 /*---------*\ 069 ====** Methods **====================================================== 070 \*---------*/ 071 072 /** 073 * This method will always throw an 074 * {@link UnsupportedOperationException}. 075 * 076 * @return {@inheritDoc} 077 */ 078 @Override 079 public final FinalRangeMap<T> addRange( final double key, final T value ) {throw new UnsupportedOperationException( "addRange" );} 080 081 /** 082 * This method will always throw an 083 * {@link UnsupportedOperationException}. 084 */ 085 @Override 086 public final void clear() {throw new UnsupportedOperationException( "clear" );} 087 088 /** 089 * This method will always throw an 090 * {@link UnsupportedOperationException}. 091 */ 092 @Override 093 public final RangeMap<T> removeRange( final double key ) {throw new UnsupportedOperationException( "removeRange" );} 094 095 /** 096 * This method will always throw an 097 * {@link UnsupportedOperationException}. 098 * 099 * @return {@inheritDoc} 100 */ 101 @Override 102 public final FinalRangeMap<T> setDefault( final T value ) {throw new UnsupportedOperationException( "setDefault" );} 103} 104// class FinalRangeMap 105 106/* 107 * End of File 108 */