public byte[] getAsByteArrayFixed(final int iSize) throws IOException { if (position >= length) return null; final byte[] portion = OArrays.copyOfRange(buffer, position, position + iSize); position += iSize; return portion; }
/** * Delete the index. * * @return The index instance itself to allow in chain calls */ @OApi(enduser = false) OIndex<T> delete();
/** * This method is missing from jdk 1.0.x and below. JDK 1.1 includes this for us, but what the heck. */ public boolean nextBoolean() { return next(1) != 0; }
public void setColumnSorting(final String column, final boolean ascending) { columnSorting = new OPair<String, Boolean>(column, ascending); }
public int size() { if (size > -1) return size; if (iterator instanceof OSizeable) return ((OSizeable) iterator).size(); return 0; }
@Override public void reset() { if (iterator instanceof OResettable) // RESET IT FOR MULTIPLE ITERATIONS ((OResettable) iterator).reset(); nextElement = null; }
public OTriple(final K iKey, final V iValue, final SV iSubValue) { init(iKey, iValue, iSubValue); }
/** * Constructor using an array of integers as seed. Your array must have a non-zero length. Only the first 624 integers in the * array are used; if the array is shorter than this then integers are repeatedly used in a wrap-around fashion. */ public MersenneTwisterFast(final int[] array) { setSeed(array); }
public static void executeIgnoringAnyExceptions(final OCallableNoParamNoReturn callback) { try { callback.call(); } catch (Exception ignore) { // IGNORE IT ON PURPOSE } } }
/** * Constructor using a given seed. Though you pass this seed in as a long, it's best to make sure it's actually an integer. */ public MersenneTwister(final long seed) { super(seed); /* just in case */ setSeed(seed); }
public byte[] getAsByteArrayFixed(final int iSize) { if (position >= buffer.length) return null; final byte[] portion = OArrays.copyOfRange(buffer, position, position + iSize); position += iSize; return portion; }
/** * Drop index with specified name. Do nothing if such index does not exists. * * @param iIndexName the name of index to drop * * @return this */ @OApi(maturity = OApi.MATURITY.STABLE) OIndexManager dropIndex(final String iIndexName);
/** * Constructor using a given seed. Though you pass this seed in as a long, it's best to make sure it's actually an integer. * */ public MersenneTwisterFast(final long seed) { setSeed(seed); }
/** * A bug fix for all versions of the JDK. The JDK appears to use all four bytes in an integer as independent byte values! Totally * wrong. I've submitted a bug report. */ public void nextBytes(final byte[] bytes) { for (int x = 0; x < bytes.length; x++) bytes[x] = (byte) next(8); }
@OApi public abstract long reset();
/** For completeness' sake, though it's not in java.util.Random. */ public char nextChar() { // chars are 16-bit UniCode values return (char) (next(16)); }
/** * A bug fix for versions of JDK 1.1 and below. JDK 1.2 fixes this for us, but what the heck. */ public float nextFloat() { return next(24) / ((float) (1 << 24)); }
/** For completeness' sake, though it's not in java.util.Random. */ public short nextShort() { return (short) (next(16)); }
/** For completeness' sake, though it's not in java.util.Random. */ public byte nextByte() { return (byte) (next(8)); }