001/** 002 * SealedReal.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.math.BigDecimal; 022import java.math.BigInteger; 023 024import net.sf.jaccumulator.Domain; 025import net.sf.jaccumulator.scalars.SealedScalar; 026import net.sf.jaccumulator.unlimiteds.SealedUnlimitedDecimalValue; 027import net.sf.jaccumulator.unlimiteds.SealedUnlimitedIntegerValue; 028 029/** 030 * Read behavior for any representation of {@link Domain#REAL real} numbers, 031 * either {@code boolean} vector, {@link BigDecimal unlimited} array 032 * representation or {@link String text} 033 * 034 * @param <REAL> 035 * the type of real to produce from the {@link #copy()} function 036 * @since JAccumulator 4.0 037 * @author Nicole Tedesco (<a 038 * href="mailto:Nicole@NicoleTedesco.com">Nicole@NicoleTedesco.com</a>) 039 */ 040public interface SealedReal<REAL extends SealedReal<REAL>> 041 extends 042 SealedScalar<REAL>, 043 SealedRealDomain, 044 RealReplicator<REAL>, 045 SealedUnlimitedIntegerValue, 046 SealedUnlimitedDecimalValue 047{ 048 /** 049 * Compares this object with the specified object for order 050 * 051 * @param aReal 052 * an object to be compared to 053 * @return a negative integer, zero, or a positive integer if this object is 054 * less than, equal to, or greater than the specified object. 055 * @see Comparable#compareTo(Object) 056 */ 057 public int compareToReal( final BigDecimal aReal ); 058 059 /** 060 * Compares this object with the specified object for order 061 * 062 * @param aReal 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 compareToReal( final BigInteger aReal ); 069 070 /** 071 * Compares this object with the specified object for order 072 * 073 * @param aReal 074 * an object to be compared to 075 * @return a negative integer, zero, or a positive integer if this object is 076 * less than, equal to, or greater than the specified object. 077 * @see Comparable#compareTo(Object) 078 */ 079 public int compareToReal( final SealedReal<?> aReal ); 080 081 public boolean isEqual( final BigDecimal aPrimitive ); 082 public boolean isEqual( final BigInteger aPrimitive ); 083 public boolean isEqualToReal( final SealedReal<?> aPrimitive ); 084 085 public boolean isGreater( final BigDecimal aPrimitive ); 086 public boolean isGreater( final BigInteger aPrimitive ); 087 public boolean isGreaterOrEqual( final BigDecimal aPrimitive ); 088 089 public boolean isGreaterOrEqual( final BigInteger aPrimitive ); 090 public boolean isGreaterOrEqualToReal( final SealedReal<?> aPrimitive ); 091 public boolean isGreaterThanReal( final SealedReal<?> aPrimitive ); 092 093 public boolean isLess( final BigDecimal aPrimitive ); 094 public boolean isLess( final BigInteger aPrimitive ); 095 public boolean isLessOrEqual( final BigDecimal aPrimitive ); 096 097 public boolean isLessOrEqual( final BigInteger aPrimitive ); 098 public boolean isLessOrEqualToReal( final SealedReal<?> aPrimitive ); 099 public boolean isLessThanReal( final SealedReal<?> aPrimitive ); 100 101 public boolean isNotEqual( final BigDecimal aPrimitive ); 102 public boolean isNotEqual( final BigInteger aPrimitive ); 103 public boolean isNotEqualToReal( final SealedReal<?> aPrimitive ); 104}