001/**
002 * SealedPrimitive.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.primitives;
020
021import java.math.BigDecimal;
022import java.math.BigInteger;
023
024import net.sf.jaccumulator.reals.SealedReal;
025import net.sf.jaccumulator.scalars.SealedScalar;
026import net.sf.jaccumulator.texts.SealedText;
027
028/**
029 * Read operations for system supported primitives. "Primitives", as defined in
030 * the UML 2.1 specification, are:
031 * <ul>
032 * <li>{@code boolean}</li>
033 * <li>{@code byte}</li>
034 * <li>{@code char}</li>
035 * <li>{@code int}</li>
036 * <li>{@code long}</li>
037 * <li>{@code float}</li>
038 * <li>{@code double}</li>
039 * <li>{@code short}</li>
040 * <li>unlimited {@link BigInteger integer}</li>
041 * <li>unlimited {@link BigDecimal decimal}</li>
042 * <li>{@link String text}</li>
043 * </ul>
044 *
045 * @param <PRIMITIVE>
046 *        the type of primitive to produce from the {@link #copy()} function
047 * @since JAccumulator 4.0
048 * @author Nicole Tedesco (<a
049 *         href="mailto:Nicole@NicoleTedesco.com">Nicole@NicoleTedesco.com</a>)
050 */
051public interface SealedPrimitive<PRIMITIVE extends SealedPrimitive<PRIMITIVE>>
052    extends
053        SealedReal<PRIMITIVE>,
054        SealedScalar<PRIMITIVE>,
055        SealedText<PRIMITIVE>,
056        Comparable<SealedPrimitive<?>>,
057        PrimitiveReplicator<PRIMITIVE>
058{
059    /**
060     * Compares this object with the specified object for order
061     *
062     * @param aPrimitive
063     *        an object to be compared to
064     * @return a negative integer, zero, or a positive integer if this object is
065     *         less than, equal to, or greater than the specified object.
066     * @see Comparable#compareTo(Object)
067     */
068    public int compareToPrimitive( final SealedPrimitive<?> aPrimitive );
069
070    public boolean isEqualToPrimitive( final SealedPrimitive<?> aPrimitive );
071    public boolean isGreaterOrEqualToPrimitive( final SealedPrimitive<?> aPrimitive );
072    public boolean isGreaterThanPrimitive( final SealedPrimitive<?> aPrimitive );
073    public boolean isLessOrEqualToPrimitive( final SealedPrimitive<?> aPrimitive );
074    public boolean isLessThanPrimitive( final SealedPrimitive<?> aPrimitive );
075    public boolean isNotEqualToPrimitive( final SealedPrimitive<?> aPrimitive );
076}