001/** 002 * TextInductor.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.texts; 020 021import java.util.NoSuchElementException; 022 023import net.sf.jaccumulator.scalars.Scalar; 024 025/** 026 * Imparts text values into other text 027 * 028 * @since JAccumulator 4.0 029 * @author Nicole Tedesco (<a 030 * href="mailto:Nicole@NicoleTedesco.com">Nicole@NicoleTedesco.com</a>) 031 */ 032public interface TextInductor 033{ 034 /** 035 * Induce the current value of this text into the {@link Scalar scalar} 036 * target 037 * 038 * @param <SCALAR> 039 * the scalar target type 040 * @param aTarget 041 * a {@link Scalar scalar} target into which the current size of this 042 * text will be induced 043 * @return the target 044 * @throws UnsupportedOperationException 045 * this target primitive cannot be changed 046 * @throws IllegalStateException 047 * this target primitive cannot be changed at this time 048 * @throws NullPointerException 049 * a {@code null} value was provided when none was expected 050 * @throws NoSuchElementException 051 * an expected parameter was not found in the parameter source 052 */ 053 public <SCALAR extends Scalar<?>> SCALAR induceTextSize( 054 final SCALAR aTarget ) 055 throws NullPointerException, 056 NoSuchElementException, 057 UnsupportedOperationException, 058 IllegalStateException; 059 060 /** 061 * Induce the current value of this text into the specified target 062 * 063 * @param <TEXT> 064 * the target type 065 * @param aTarget 066 * a target into which the current value of this text will be 067 * induced 068 * @return the target 069 * @throws UnsupportedOperationException 070 * this target primitive cannot be changed 071 * @throws IllegalStateException 072 * this target primitive cannot be changed at this time 073 * @throws NullPointerException 074 * a {@code null} value was provided when none was expected 075 * @throws NoSuchElementException 076 * an expected parameter was not found in the parameter source 077 */ 078 public <TEXT extends Text<?>> TEXT induceTextValue( 079 final TEXT aTarget ) 080 throws NullPointerException, 081 NoSuchElementException, 082 UnsupportedOperationException, 083 IllegalStateException; 084}