1 55 package org.jboss.axis.types; 56 57 import org.jboss.axis.utils.Messages; 58 59 import java.math.BigInteger ; 60 import java.util.Random ; 61 62 74 public class NegativeInteger extends NonPositiveInteger 75 { 76 77 public NegativeInteger(byte[] val) 78 { 79 super(val); 80 checkValidity(); 81 } 83 public NegativeInteger(int signum, byte[] magnitude) 84 { 85 super(signum, magnitude); 86 checkValidity(); 87 } 89 public NegativeInteger(int bitLength, int certainty, Random rnd) 90 { 91 super(bitLength, certainty, rnd); 92 checkValidity(); 93 } 95 public NegativeInteger(int numBits, Random rnd) 96 { 97 super(numBits, rnd); 98 checkValidity(); 99 } 101 public NegativeInteger(String val) 102 { 103 super(val); 104 checkValidity(); 105 } 106 107 public NegativeInteger(String val, int radix) 108 { 109 super(val, radix); 110 checkValidity(); 111 } 113 116 private BigInteger zero = new BigInteger ("0"); 117 118 private void checkValidity() 119 { 120 if (compareTo(zero) >= 0) 121 { 122 throw new NumberFormatException (Messages.getMessage("badnegInt00") 123 + ": " + this); 124 } 125 } 127 } | Popular Tags |