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 72 public class PositiveInteger extends NonNegativeInteger 73 { 74 75 public PositiveInteger(byte[] val) 76 { 77 super(val); 78 checkValidity(); 79 } 81 public PositiveInteger(int signum, byte[] magnitude) 82 { 83 super(signum, magnitude); 84 checkValidity(); 85 } 87 public PositiveInteger(int bitLength, int certainty, Random rnd) 88 { 89 super(bitLength, certainty, rnd); 90 checkValidity(); 91 } 93 public PositiveInteger(int numBits, Random rnd) 94 { 95 super(numBits, rnd); 96 checkValidity(); 97 } 99 public PositiveInteger(String val) 100 { 101 super(val); 102 checkValidity(); 103 } 104 105 public PositiveInteger(String val, int radix) 106 { 107 super(val, radix); 108 checkValidity(); 109 } 111 114 private BigInteger iMinInclusive = new BigInteger ("1"); 115 116 private void checkValidity() 117 { 118 if (compareTo(iMinInclusive) < 0) 119 { 120 throw new NumberFormatException (Messages.getMessage("badposInt00") 121 + ": " + this); 122 } 123 } 125 } | Popular Tags |