package miningmart.storedProcedures;
public class M4Random {

    private static java.util.Random randSeq = new java.util.Random();
    
    public static java.lang.Integer RandomNr
	(java.lang.Long seed, java.lang.Integer rownum, java.lang.Integer maxNr) {
	if (rownum.intValue() == 1)
	    randSeq.setSeed(seed.longValue());
	return new java.lang.Integer(1 + randSeq.nextInt(maxNr.intValue()));
    }

    public static java.lang.Integer RandomSelect
	(java.lang.Long seed, java.lang.Integer rownum, java.lang.Integer perMillion) {
	if (rownum.intValue() == 1)
	    randSeq.setSeed(seed.longValue());
	int ret = 0;
	if ( randSeq.nextInt(1000000) < perMillion.intValue())
	    ret = 1;
	return new java.lang.Integer(ret);
    }
};
