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 73 public class NonPositiveInteger extends BigInteger 74 { 75 76 public NonPositiveInteger(byte[] val) 77 { 78 super(val); 79 checkValidity(); 80 } 82 public NonPositiveInteger(int signum, byte[] magnitude) 83 { 84 super(signum, magnitude); 85 checkValidity(); 86 } 88 public NonPositiveInteger(int bitLength, int certainty, Random rnd) 89 { 90 super(bitLength, certainty, rnd); 91 checkValidity(); 92 } 94 public NonPositiveInteger(int numBits, Random rnd) 95 { 96 super(numBits, rnd); 97 checkValidity(); 98 } 100 public NonPositiveInteger(String val) 101 { 102 super(val); 103 checkValidity(); 104 } 105 106 public NonPositiveInteger(String val, int radix) 107 { 108 super(val, radix); 109 checkValidity(); 110 } 112 115 private BigInteger zero = new BigInteger ("0"); 116 117 private void checkValidity() 118 { 119 if (compareTo(zero) > 0) 120 { 121 throw new NumberFormatException (Messages.getMessage("badNonPosInt00") 122 + ": " + this); 123 } 124 } 126 } | Popular Tags |