001/** 002 * MutableIntegerValue.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.integers; 020 021/** 022 * A changeable {@code int} 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 MutableIntegerValue<VALUE extends MutableIntegerValue<VALUE>> 031{ 032 /** 033 * Decrement the scalar value of this object then return the original value 034 * prior to decrementing 035 * 036 * @return the original value of this scalar 037 * @throws UnsupportedOperationException 038 * if this object's value cannot be changed 039 * @throws IllegalArgumentException 040 * if the new value was incommensurate with this object's 041 * specification 042 * @throws ArithmeticException 043 * the new numeric value was incompatible with with algebraic 044 * interpretation of this object 045 */ 046 public int intPostDecrement() 047 throws UnsupportedOperationException, 048 ArithmeticException, 049 IllegalArgumentException; 050 051 /** 052 * Increment the scalar value of this object then return the original value 053 * prior to incrementing 054 * 055 * @return the original value of this scalar 056 * @throws UnsupportedOperationException 057 * if this object's value cannot be changed 058 * @throws IllegalArgumentException 059 * if the new value was incommensurate with this object's 060 * specification 061 * @throws ArithmeticException 062 * the new numeric value was incompatible with with algebraic 063 * interpretation of this object 064 */ 065 public int intPostIncrement() 066 throws UnsupportedOperationException, 067 ArithmeticException, 068 IllegalArgumentException; 069 070 /** 071 * Set this property to the specified {@code int} value and answer this 072 * object (facilitates chaining) 073 * 074 * @param aValue 075 * an {@code int} value 076 * @return this object (facilitates operation chaining) 077 * @throws UnsupportedOperationException 078 * if this object's value cannot be changed 079 * @throws IllegalArgumentException 080 * if the specified value was incommensurate with this object's 081 * specification 082 * @throws ArithmeticException 083 * the numeric value provided was incompatible with with algebraic 084 * interpretation of this object 085 */ 086 public VALUE setScalar( final int aValue ) 087 throws UnsupportedOperationException, 088 IllegalArgumentException, 089 ArithmeticException; 090}