001/** 002 * MutableShortValue.java 003 * 004 * Copyright (c) 2004-2012, Nicole C. Tedesco. All rights reserved. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at: 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 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, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019package net.sf.jaccumulator.shorts; 020 021/** 022 * A changeable {@code short} property value 023 * 024 * @param <VALUE> 025 * this value type (used to facilitate operation chaining) 026 * @since JAccumulator 4.0 027 * @author Nicole Tedesco (<a 028 * href="mailto:Nicole@NicoleTedesco.com">Nicole@NicoleTedesco.com</a>) 029 */ 030public interface MutableShortValue<VALUE extends MutableShortValue<VALUE>> 031{ 032 /** 033 * Set this property to the specified {@code short} value and answer this 034 * object (facilitates chaining) 035 * 036 * @param aValue 037 * a {@code short} value 038 * @return this object (facilitates operation chaining) 039 * @throws UnsupportedOperationException 040 * if this object's value cannot be changed 041 * @throws IllegalArgumentException 042 * if the specified value was incommensurate with this object's 043 * specification 044 * @throws ArithmeticException 045 * the numeric value provided was incompatible with with algebraic 046 * interpretation of this object 047 */ 048 public VALUE setScalar( final short aValue ) 049 throws UnsupportedOperationException, 050 IllegalArgumentException, 051 ArithmeticException; 052 053 /** 054 * Decrement the scalar value of this object then return the original value 055 * prior to decrementing 056 * 057 * @return the original value of this scalar 058 * @throws UnsupportedOperationException 059 * if this object's value cannot be changed 060 * @throws IllegalArgumentException 061 * if the new value was incommensurate with this object's 062 * specification 063 * @throws ArithmeticException 064 * the new numeric value was incompatible with with algebraic 065 * interpretation of this object 066 */ 067 public short shortPostDecrement() 068 throws UnsupportedOperationException, 069 ArithmeticException, 070 IllegalArgumentException; 071 072 /** 073 * Increment the scalar value of this object then return the original value 074 * prior to incrementing 075 * 076 * @return the original value of this scalar 077 * @throws UnsupportedOperationException 078 * if this object's value cannot be changed 079 * @throws IllegalArgumentException 080 * if the new value was incommensurate with this object's 081 * specification 082 * @throws ArithmeticException 083 * the new numeric value was incompatible with with algebraic 084 * interpretation of this object 085 */ 086 public short shortPostIncrement() 087 throws UnsupportedOperationException, 088 ArithmeticException, 089 IllegalArgumentException; 090 091}