public static Hash combine(final Hash... hashes) { if (hashes.length == 1) { return hashes[0]; } long hi = 0; long lo = 0; for (final Hash hash : hashes) { hi ^= hash.getHigh() + 0x9e3779b9 + (hi << 6) + (hi >> 2); lo ^= hash.getLow() + 0x9e3779b9 + (lo << 6) + (lo >> 2); } return fromLongs(hi, lo); }
@Override Graph<V, E> doFilter(final Predicate<V> vertexFilter, final Predicate<Edge<V, E>> edgeFilter) { return new FilteredGraph<V, E>(this, vertexFilter, edgeFilter); }
public static String getName() { if (frozenName == null) { frozenName = getProperty("utils.environment.name", "application"); } return frozenName; }
public void addAll(Collection<K> collection) { for (K el : collection) { add(el); } }
public boolean containedIn(final Iterable<Range> ranges) { for (final Range range : ranges) { if (range.contains(this)) { return true; } } return false; }
@Override public int read() throws IOException { if (this.pos >= this.count) { fill(); if (this.pos >= this.count) { return -1; } } return this.buffer[this.pos++] & 0xFFFF; }
@Override public void write(final int c) throws IOException { if (this.count >= BUFFER_SIZE) { flushBuffer(); } this.buffer[this.count++] = (char) c; }
@Override public void write(final int c) throws IOException { if (this.count < this.threshold) { this.buffer[this.count++] = (char) c; } else { writeAndTryFlush((char) c); } }
@Override public int read() throws IOException { if (this.pos >= this.count) { fill(); if (this.count == 0) { return -1; } } return this.buffer[this.pos++] & 0xFF; }
@Override public void write(final int c) throws IOException { if (this.count < this.threshold) { this.buffer[this.count++] = (byte) c; } else { writeAndTryFlush((byte) c); } }
public boolean overlaps(final Iterable<Range> ranges) { for (final Range range : ranges) { if (overlaps(range)) { return true; } } return false; }
private LibSvmClassifier(final Parameters parameters, final String modelHash, final Dictionary<String> dictionary, final svm_model model) { super(parameters, modelHash); this.dictionary = dictionary.freeze(); this.model = model; }
@Override public void flush() throws IOException { flushBuffers(); }
@Override public int read() throws IOException { if (this.pos >= this.count) { fill(); if (this.pos >= this.count) { return -1; } } return this.buffer[this.pos++] & 0xFF; }
@Override public void write(final char[] cbuf, final int off, final int len) throws IOException { final int end = off + len; for (int index = off; index < end; ++index) { write(cbuf[index]); } }
public boolean connectedWith(final Iterable<Range> ranges) { for (final Range range : ranges) { if (connectedWith(range)) { return true; } } return false; }
@Override public void write(final int b) throws IOException { if (this.count >= BUFFER_SIZE) { flushBuffer(); } this.buffer[this.count++] = (byte) b; }
@Override public int read() throws IOException { if (this.pos >= this.count) { fill(); if (this.count == 0) { return -1; } } return this.buffer[this.pos++] & 0xFFFF; }