001/**
002 * SealedRealBag.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.reals;
020
021import java.util.NoSuchElementException;
022
023import net.sf.jaccumulator.AlgebraicStructure;
024import net.sf.jaccumulator.scalars.SealedScalarBag;
025
026/**
027 * A read-only {@link AlgebraicStructure algebraic} structure with a
028 * {@link Real real} ordinality (element count)
029 *
030 * @since JAccumulator 4.0
031 * @author Nicole Tedesco (<a
032 *         href="mailto:nicole@tedesco.name">nicole@tedesco.name</a>)
033 */
034public interface SealedRealBag
035    extends
036        SealedScalarBag
037{
038    /**
039     * Update the target {@link Real scalar} with the element count in this
040     * structure
041     *
042     * @param <R>
043     *        the target type
044     * @param aTarget
045     *        the target to update
046     * @return the <i>target</i> scalar (facilitates operation chaining)
047     * @throws UnsupportedOperationException
048     *         this target cannot be changed
049     * @throws IllegalStateException
050     *         this target cannot be changed at this time
051     * @throws NullPointerException
052     *         a {@code null} value was provided when none was expected
053     * @throws NoSuchElementException
054     *         an expected parameter was not found in the parameter source
055     */
056    public <R extends Real<?>> R induceRealSize(
057        final R aTarget )
058        throws NullPointerException,
059            NoSuchElementException,
060            UnsupportedOperationException,
061            IllegalStateException;
062}