001/**
002 * Primitive.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"); you may not
007 * use this file except in compliance with the License. You may obtain a copy of
008 * 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, WITHOUT
014 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
015 * License for the specific language governing permissions and limitations under
016 * the License.
017 */
018
019package net.sf.jaccumulator.primitives;
020
021import java.math.BigDecimal;
022import java.math.BigInteger;
023
024import net.sf.jaccumulator.reals.Real;
025import net.sf.jaccumulator.texts.Text;
026
027/**
028 * Read and write operations for system supported primitives. "Primitives", as
029 * defined in the UML 2.1 specification, are:
030 * <ul>
031 * <li>{@code boolean}</li>
032 * <li>{@code byte}</li>
033 * <li>{@code char}</li>
034 * <li>{@code int}</li>
035 * <li>{@code long}</li>
036 * <li>{@code float}</li>
037 * <li>{@code double}</li>
038 * <li>{@code short}</li>
039 * <li>unlimited {@link BigInteger integer}</li>
040 * <li>unlimited {@link BigDecimal decimal}</li>
041 * <li>{@link String text}</li>
042 * </ul>
043 * 
044 * @param <PRIMITIVE>
045 *        this primitive type (used to facilitate operation chaining on write
046 *        operations)
047 * @since JAccumulator 4.0
048 * @author Nicole Tedesco (<a
049 *         href="mailto:Nicole@NicoleTedesco.com">Nicole@NicoleTedesco.com</a>)
050 */
051public interface Primitive<PRIMITIVE extends Primitive<PRIMITIVE>>
052    extends
053        PrimitiveInductor<PRIMITIVE>,
054        SealedPrimitive<PRIMITIVE>,
055        MutablePrimitive<PRIMITIVE>,
056        Real<PRIMITIVE>,
057        Text<PRIMITIVE>
058{
059    /**
060     * Swap the value of this primitive for the specified one and set the
061     * specified primitive's value to the current value of this primitive
062     * 
063     * @param aPrimitive
064     *        the primitive to swap with
065     * @return this primitive
066     */
067    public PRIMITIVE swapPrimitives( final Primitive<?> aPrimitive );
068}