id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
101,700 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java | ObjectDiskQueue.enqueue | public synchronized void enqueue(final T o) throws IOException {
assert o != null;
fbaos.reset();
BinIO.storeObject(o, fbaos);
byteDiskQueue.enqueueInt(fbaos.length);
byteDiskQueue.enqueue(fbaos.array, 0, fbaos.length);
size++;
} | java | public synchronized void enqueue(final T o) throws IOException {
assert o != null;
fbaos.reset();
BinIO.storeObject(o, fbaos);
byteDiskQueue.enqueueInt(fbaos.length);
byteDiskQueue.enqueue(fbaos.array, 0, fbaos.length);
size++;
} | [
"public",
"synchronized",
"void",
"enqueue",
"(",
"final",
"T",
"o",
")",
"throws",
"IOException",
"{",
"assert",
"o",
"!=",
"null",
";",
"fbaos",
".",
"reset",
"(",
")",
";",
"BinIO",
".",
"storeObject",
"(",
"o",
",",
"fbaos",
")",
";",
"byteDiskQueu... | Enqueues an object to this queue.
@param o the object to be enqueued. | [
"Enqueues",
"an",
"object",
"to",
"this",
"queue",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java#L94-L101 |
101,701 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java | ObjectDiskQueue.dequeue | @SuppressWarnings("unchecked")
public synchronized T dequeue() throws IOException {
final int length = byteDiskQueue.dequeueInt();
fbaos.array = ByteArrays.grow(fbaos.array, length);
byteDiskQueue.dequeue(fbaos.array, 0, length);
size--;
try {
return (T)BinIO.loadObject(new FastByteArrayInputStream(fbaos.... | java | @SuppressWarnings("unchecked")
public synchronized T dequeue() throws IOException {
final int length = byteDiskQueue.dequeueInt();
fbaos.array = ByteArrays.grow(fbaos.array, length);
byteDiskQueue.dequeue(fbaos.array, 0, length);
size--;
try {
return (T)BinIO.loadObject(new FastByteArrayInputStream(fbaos.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"synchronized",
"T",
"dequeue",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"length",
"=",
"byteDiskQueue",
".",
"dequeueInt",
"(",
")",
";",
"fbaos",
".",
"array",
"=",
"ByteArrays",
... | Dequeues an object from the queue in FIFO fashion. | [
"Dequeues",
"an",
"object",
"from",
"the",
"queue",
"in",
"FIFO",
"fashion",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ObjectDiskQueue.java#L104-L116 |
101,702 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/StatsThread.java | StatsThread.start | public void start(long previousCrawlDuration) {
requestLogger.start(previousCrawlDuration);
resourceLogger.start(previousCrawlDuration);
transferredBytesLogger.start(previousCrawlDuration);
receivedURLsLogger.start(previousCrawlDuration);
} | java | public void start(long previousCrawlDuration) {
requestLogger.start(previousCrawlDuration);
resourceLogger.start(previousCrawlDuration);
transferredBytesLogger.start(previousCrawlDuration);
receivedURLsLogger.start(previousCrawlDuration);
} | [
"public",
"void",
"start",
"(",
"long",
"previousCrawlDuration",
")",
"{",
"requestLogger",
".",
"start",
"(",
"previousCrawlDuration",
")",
";",
"resourceLogger",
".",
"start",
"(",
"previousCrawlDuration",
")",
";",
"transferredBytesLogger",
".",
"start",
"(",
"... | Starst all progress loggers.
@param previousCrawlDuration the duration of the previous crawl, or zero for a new crawl. | [
"Starst",
"all",
"progress",
"loggers",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/StatsThread.java#L98-L103 |
101,703 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/StatsThread.java | StatsThread.emit | public void emit() {
requestLogger.setAndDisplay(frontier.fetchedResources.get() + frontier.fetchedRobots.get());
final long duplicates = frontier.duplicates.get();
final long archetypes = frontier.archetypes();
resourceLogger.setAndDisplay(archetypes + duplicates);
transferredBytesLogger.setAndDisplay(fronti... | java | public void emit() {
requestLogger.setAndDisplay(frontier.fetchedResources.get() + frontier.fetchedRobots.get());
final long duplicates = frontier.duplicates.get();
final long archetypes = frontier.archetypes();
resourceLogger.setAndDisplay(archetypes + duplicates);
transferredBytesLogger.setAndDisplay(fronti... | [
"public",
"void",
"emit",
"(",
")",
"{",
"requestLogger",
".",
"setAndDisplay",
"(",
"frontier",
".",
"fetchedResources",
".",
"get",
"(",
")",
"+",
"frontier",
".",
"fetchedRobots",
".",
"get",
"(",
")",
")",
";",
"final",
"long",
"duplicates",
"=",
"fr... | Emits the statistics. | [
"Emits",
"the",
"statistics",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/StatsThread.java#L130-L160 |
101,704 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveReader.java | GZIPArchiveReader.readLEInt | private static int readLEInt(InputStream in) throws IOException {
int i = in.read() & 0xFF;
i |= (in.read() & 0xFF) << 8;
i |= (in.read() & 0xFF) << 16;
i |= (in.read() & 0xFF) << 24;
return i;
} | java | private static int readLEInt(InputStream in) throws IOException {
int i = in.read() & 0xFF;
i |= (in.read() & 0xFF) << 8;
i |= (in.read() & 0xFF) << 16;
i |= (in.read() & 0xFF) << 24;
return i;
} | [
"private",
"static",
"int",
"readLEInt",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"int",
"i",
"=",
"in",
".",
"read",
"(",
")",
"&",
"0xFF",
";",
"i",
"|=",
"(",
"in",
".",
"read",
"(",
")",
"&",
"0xFF",
")",
"<<",
"8",
";",
... | Reads an integer in little-endian from the stream. | [
"Reads",
"an",
"integer",
"in",
"little",
"-",
"endian",
"from",
"the",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveReader.java#L261-L267 |
101,705 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveReader.java | GZIPArchiveReader.readLEShort | private static short readLEShort(InputStream in) throws IOException {
short s = (byte)in.read();
s |= (byte)in.read() << 8;
return s;
} | java | private static short readLEShort(InputStream in) throws IOException {
short s = (byte)in.read();
s |= (byte)in.read() << 8;
return s;
} | [
"private",
"static",
"short",
"readLEShort",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"short",
"s",
"=",
"(",
"byte",
")",
"in",
".",
"read",
"(",
")",
";",
"s",
"|=",
"(",
"byte",
")",
"in",
".",
"read",
"(",
")",
"<<",
"8",
... | Reads a short in little-endian from the stream. | [
"Reads",
"a",
"short",
"in",
"little",
"-",
"endian",
"from",
"the",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveReader.java#L270-L274 |
101,706 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/records/WarcHeader.java | WarcHeader.getFirstHeader | public static Header getFirstHeader(final HeaderGroup headers, final WarcHeader.Name name) {
return headers.getFirstHeader(name.value);
} | java | public static Header getFirstHeader(final HeaderGroup headers, final WarcHeader.Name name) {
return headers.getFirstHeader(name.value);
} | [
"public",
"static",
"Header",
"getFirstHeader",
"(",
"final",
"HeaderGroup",
"headers",
",",
"final",
"WarcHeader",
".",
"Name",
"name",
")",
"{",
"return",
"headers",
".",
"getFirstHeader",
"(",
"name",
".",
"value",
")",
";",
"}"
] | Returns the first header of given name.
@param headers the headers to search from.
@param name the name of the header to lookup.
@return the header. | [
"Returns",
"the",
"first",
"header",
"of",
"given",
"name",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/records/WarcHeader.java#L123-L125 |
101,707 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/URLRespectsRobots.java | URLRespectsRobots.apply | public static boolean apply(final char[][] robotsFilter, final URI url) {
if (robotsFilter.length == 0) return true;
final String pathQuery = BURL.pathAndQuery(url);
int from = 0;
int to = robotsFilter.length - 1;
while (from <= to) {
final int mid = (from + to) >>> 1;
final int cmp = compare(robotsFilt... | java | public static boolean apply(final char[][] robotsFilter, final URI url) {
if (robotsFilter.length == 0) return true;
final String pathQuery = BURL.pathAndQuery(url);
int from = 0;
int to = robotsFilter.length - 1;
while (from <= to) {
final int mid = (from + to) >>> 1;
final int cmp = compare(robotsFilt... | [
"public",
"static",
"boolean",
"apply",
"(",
"final",
"char",
"[",
"]",
"[",
"]",
"robotsFilter",
",",
"final",
"URI",
"url",
")",
"{",
"if",
"(",
"robotsFilter",
".",
"length",
"==",
"0",
")",
"return",
"true",
";",
"final",
"String",
"pathQuery",
"="... | Checks whether a specified URL passes a specified robots filter.
@param robotsFilter a robot filter.
@param url a URL to check against {@code robotsFilter}.
@return true if {@code url} passes {@code robotsFilter}. | [
"Checks",
"whether",
"a",
"specified",
"URL",
"passes",
"a",
"specified",
"robots",
"filter",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/URLRespectsRobots.java#L214-L227 |
101,708 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/IsProbablyBinary.java | IsProbablyBinary.apply | @Override
public boolean apply(final HttpResponse httpResponse) {
try {
final InputStream content = httpResponse.getEntity().getContent();
int count = 0;
for(int i = BINARY_CHECK_SCAN_LENGTH; i-- != 0;) {
final int b = content.read();
if (b == -1) return false;
if (b == 0 && ++count == THRESHOLD... | java | @Override
public boolean apply(final HttpResponse httpResponse) {
try {
final InputStream content = httpResponse.getEntity().getContent();
int count = 0;
for(int i = BINARY_CHECK_SCAN_LENGTH; i-- != 0;) {
final int b = content.read();
if (b == -1) return false;
if (b == 0 && ++count == THRESHOLD... | [
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"final",
"HttpResponse",
"httpResponse",
")",
"{",
"try",
"{",
"final",
"InputStream",
"content",
"=",
"httpResponse",
".",
"getEntity",
"(",
")",
".",
"getContent",
"(",
")",
";",
"int",
"count",
"=",
"0... | This method implements a simple heuristic for guessing whether a page is binary.
<P>The first {@link #BINARY_CHECK_SCAN_LENGTH} bytes are scanned: if we find more than
{@link #THRESHOLD} zeroes, we deduce that this page is binary. Note that this works
also with UTF-8, as no UTF-8 legal character encoding contains thes... | [
"This",
"method",
"implements",
"a",
"simple",
"heuristic",
"for",
"guessing",
"whether",
"a",
"page",
"is",
"binary",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/IsProbablyBinary.java#L48-L63 |
101,709 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/sieve/ByteArrayListByteSerializerDeserializer.java | ByteArrayListByteSerializerDeserializer.fromStream | @Override
public ByteArrayList fromStream(final InputStream is) throws IOException {
final int length = Util.readVByte(is);
buffer.size(length);
final int actual = is.read(buffer.elements(), 0, length);
if (actual != length) throw new IOException("Asked for " + length + " but got " + actual);
return buffer;
... | java | @Override
public ByteArrayList fromStream(final InputStream is) throws IOException {
final int length = Util.readVByte(is);
buffer.size(length);
final int actual = is.read(buffer.elements(), 0, length);
if (actual != length) throw new IOException("Asked for " + length + " but got " + actual);
return buffer;
... | [
"@",
"Override",
"public",
"ByteArrayList",
"fromStream",
"(",
"final",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"final",
"int",
"length",
"=",
"Util",
".",
"readVByte",
"(",
"is",
")",
";",
"buffer",
".",
"size",
"(",
"length",
")",
";",
... | A serializer-deserializer for byte arrays that write the array length using variable-length byte encoding,
and the writes the content of the array. | [
"A",
"serializer",
"-",
"deserializer",
"for",
"byte",
"arrays",
"that",
"write",
"the",
"array",
"length",
"using",
"variable",
"-",
"length",
"byte",
"encoding",
"and",
"the",
"writes",
"the",
"content",
"of",
"the",
"array",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/sieve/ByteArrayListByteSerializerDeserializer.java#L36-L43 |
101,710 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitStateSet.java | VisitStateSet.add | public boolean add(final VisitState v) {
// The starting point.
int pos = (int)(MurmurHash3.hash(v.schemeAuthority) & mask);
// There's always an unused entry.
while (visitState[pos] != null) {
if (Arrays.equals(visitState[pos].schemeAuthority, v.schemeAuthority)) return false;
pos = (pos + 1) & mask;
}... | java | public boolean add(final VisitState v) {
// The starting point.
int pos = (int)(MurmurHash3.hash(v.schemeAuthority) & mask);
// There's always an unused entry.
while (visitState[pos] != null) {
if (Arrays.equals(visitState[pos].schemeAuthority, v.schemeAuthority)) return false;
pos = (pos + 1) & mask;
}... | [
"public",
"boolean",
"add",
"(",
"final",
"VisitState",
"v",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"(",
"int",
")",
"(",
"MurmurHash3",
".",
"hash",
"(",
"v",
".",
"schemeAuthority",
")",
"&",
"mask",
")",
";",
"// There's always an unused e... | Adds a visit state to the set, if necessary.
@param v the state to be added.
@return true if the state set changed as a result of this operation. | [
"Adds",
"a",
"visit",
"state",
"to",
"the",
"set",
"if",
"necessary",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitStateSet.java#L73-L84 |
101,711 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitStateSet.java | VisitStateSet.remove | public boolean remove(final VisitState k) {
// The starting point.
int pos = (int)(MurmurHash3.hash(k.schemeAuthority) & mask);
// There's always an unused entry.
while (visitState[pos] != null) {
if (visitState[pos] == k) {
size--;
shiftKeys(pos);
// TODO: implement resize
return true;
}
... | java | public boolean remove(final VisitState k) {
// The starting point.
int pos = (int)(MurmurHash3.hash(k.schemeAuthority) & mask);
// There's always an unused entry.
while (visitState[pos] != null) {
if (visitState[pos] == k) {
size--;
shiftKeys(pos);
// TODO: implement resize
return true;
}
... | [
"public",
"boolean",
"remove",
"(",
"final",
"VisitState",
"k",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"(",
"int",
")",
"(",
"MurmurHash3",
".",
"hash",
"(",
"k",
".",
"schemeAuthority",
")",
"&",
"mask",
")",
";",
"// There's always an unuse... | Removes a given visit state.
@param k the visit state to be removed.
@return true if the state set changed as a result of this operation. | [
"Removes",
"a",
"given",
"visit",
"state",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitStateSet.java#L113-L127 |
101,712 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitStateSet.java | VisitStateSet.rehash | protected void rehash(final int newN) {
int i = 0, pos;
final VisitState[] visitState = this.visitState;
final int newMask = newN - 1;
final VisitState[] newVisitState = new VisitState[newN];
for (int j = size; j-- != 0;) {
while (visitState[i] == null) i++;
VisitState v = visitState[i];
pos = (int)... | java | protected void rehash(final int newN) {
int i = 0, pos;
final VisitState[] visitState = this.visitState;
final int newMask = newN - 1;
final VisitState[] newVisitState = new VisitState[newN];
for (int j = size; j-- != 0;) {
while (visitState[i] == null) i++;
VisitState v = visitState[i];
pos = (int)... | [
"protected",
"void",
"rehash",
"(",
"final",
"int",
"newN",
")",
"{",
"int",
"i",
"=",
"0",
",",
"pos",
";",
"final",
"VisitState",
"[",
"]",
"visitState",
"=",
"this",
".",
"visitState",
";",
"final",
"int",
"newMask",
"=",
"newN",
"-",
"1",
";",
... | Rehashes the state set to a new size.
@param newN the new size. | [
"Rehashes",
"the",
"state",
"set",
"to",
"a",
"new",
"size",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitStateSet.java#L208-L226 |
101,713 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java | ByteArrayDiskQueue.createNew | public static ByteArrayDiskQueue createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
return new ByteArrayDiskQueue(ByteDiskQueue.createNew(file, bufferSize, direct));
} | java | public static ByteArrayDiskQueue createNew(final File file, final int bufferSize, final boolean direct) throws IOException {
return new ByteArrayDiskQueue(ByteDiskQueue.createNew(file, bufferSize, direct));
} | [
"public",
"static",
"ByteArrayDiskQueue",
"createNew",
"(",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ByteArrayDiskQueue",
"(",
"ByteDiskQueue",
".",
"createN... | Creates a new disk-based queue of byte arrays.
@param file the file that will be used to dump the queue on disk.
@param bufferSize the number of items in the circular buffer (will be possibly decreased so to be a power of two).
@param direct whether the {@link ByteBuffer} used by this queue should be {@linkplain ByteB... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"byte",
"arrays",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java#L66-L68 |
101,714 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java | ByteArrayDiskQueue.createFromFile | public static ByteArrayDiskQueue createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
final ByteArrayDiskQueue byteArrayDiskQueue = new ByteArrayDiskQueue(ByteDiskQueue.createFromFile(file, bufferSize, direct));
byteArrayDiskQueue.size = size;
return by... | java | public static ByteArrayDiskQueue createFromFile(final long size, final File file, final int bufferSize, final boolean direct) throws IOException {
final ByteArrayDiskQueue byteArrayDiskQueue = new ByteArrayDiskQueue(ByteDiskQueue.createFromFile(file, bufferSize, direct));
byteArrayDiskQueue.size = size;
return by... | [
"public",
"static",
"ByteArrayDiskQueue",
"createFromFile",
"(",
"final",
"long",
"size",
",",
"final",
"File",
"file",
",",
"final",
"int",
"bufferSize",
",",
"final",
"boolean",
"direct",
")",
"throws",
"IOException",
"{",
"final",
"ByteArrayDiskQueue",
"byteArr... | Creates a new disk-based queue of byte arrays using an existing file.
<p>Note that you have to supply the correct number of byte arrays contained in the dump file of
the underlying {@link ByteDiskQueue}. Failure to do so will cause unpredictable behaviour.
@param size the number of byte arrays contained in {@code fil... | [
"Creates",
"a",
"new",
"disk",
"-",
"based",
"queue",
"of",
"byte",
"arrays",
"using",
"an",
"existing",
"file",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java#L81-L85 |
101,715 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java | ByteArrayDiskQueue.enqueue | public synchronized void enqueue(final byte[] array) throws IOException {
assert array != null;
byteDiskQueue.enqueueInt(array.length);
byteDiskQueue.enqueue(array);
size++;
} | java | public synchronized void enqueue(final byte[] array) throws IOException {
assert array != null;
byteDiskQueue.enqueueInt(array.length);
byteDiskQueue.enqueue(array);
size++;
} | [
"public",
"synchronized",
"void",
"enqueue",
"(",
"final",
"byte",
"[",
"]",
"array",
")",
"throws",
"IOException",
"{",
"assert",
"array",
"!=",
"null",
";",
"byteDiskQueue",
".",
"enqueueInt",
"(",
"array",
".",
"length",
")",
";",
"byteDiskQueue",
".",
... | Enqueues a byte array to this queue.
@param array the array to be enqueued. | [
"Enqueues",
"a",
"byte",
"array",
"to",
"this",
"queue",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java#L91-L96 |
101,716 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/Filters.java | Filters.and | @SafeVarargs
public static<T> Filter<T> and(final Filter<T>... f) {
return new Filter<T>() {
@Override
public boolean apply(final T x) {
for (final Filter<T> filter: f) if (! filter.apply(x)) return false;
return true;
}
@Override
public String toString() {
return "(" + StringUtils.join(f... | java | @SafeVarargs
public static<T> Filter<T> and(final Filter<T>... f) {
return new Filter<T>() {
@Override
public boolean apply(final T x) {
for (final Filter<T> filter: f) if (! filter.apply(x)) return false;
return true;
}
@Override
public String toString() {
return "(" + StringUtils.join(f... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Filter",
"<",
"T",
">",
"and",
"(",
"final",
"Filter",
"<",
"T",
">",
"...",
"f",
")",
"{",
"return",
"new",
"Filter",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"ap... | Produces the conjunction of the given filters.
@param <T> the type of objects that the filters deal with.
@param f the filters.
@return the conjunction. | [
"Produces",
"the",
"conjunction",
"of",
"the",
"given",
"filters",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/Filters.java#L60-L79 |
101,717 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/Filters.java | Filters.not | public static<T> Filter<T> not(final Filter<T> filter) {
return new AbstractFilter<T>() {
@Override
public boolean apply(final T x) {
return ! filter.apply(x);
}
@Override
public String toString() {
return "(not " + filter + ")";
}
@Override
public Filter<T> copy() {
return not(f... | java | public static<T> Filter<T> not(final Filter<T> filter) {
return new AbstractFilter<T>() {
@Override
public boolean apply(final T x) {
return ! filter.apply(x);
}
@Override
public String toString() {
return "(not " + filter + ")";
}
@Override
public Filter<T> copy() {
return not(f... | [
"public",
"static",
"<",
"T",
">",
"Filter",
"<",
"T",
">",
"not",
"(",
"final",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"return",
"new",
"AbstractFilter",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"fina... | Produces the negation of the given filter.
@param <T> the type of objects that the filter deal with.
@param filter the filter.
@return the negation of the given filter. | [
"Produces",
"the",
"negation",
"of",
"the",
"given",
"filter",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/Filters.java#L115-L132 |
101,718 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/Filters.java | Filters.getFilterFromSpec | @SuppressWarnings("unchecked")
public static<T> Filter<T> getFilterFromSpec(String className, String spec, Class<T> tClass) throws ParseException {
String filterClassName;
if (className.indexOf('.') >= 0) filterClassName = className;
else filterClassName = Filter.FILTER_PACKAGE_NAME + "." + className;
try {
... | java | @SuppressWarnings("unchecked")
public static<T> Filter<T> getFilterFromSpec(String className, String spec, Class<T> tClass) throws ParseException {
String filterClassName;
if (className.indexOf('.') >= 0) filterClassName = className;
else filterClassName = Filter.FILTER_PACKAGE_NAME + "." + className;
try {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Filter",
"<",
"T",
">",
"getFilterFromSpec",
"(",
"String",
"className",
",",
"String",
"spec",
",",
"Class",
"<",
"T",
">",
"tClass",
")",
"throws",
"ParseException",
... | Creates a filter from a filter class name and an external form.
@param className the name of a filter class; it may either be a single class name (in which case it
will be qualified with {@link Filter#FILTER_PACKAGE_NAME}) or a fully qualified classname.
@param spec the specification from which the filter will be crea... | [
"Creates",
"a",
"filter",
"from",
"a",
"filter",
"class",
"name",
"and",
"an",
"external",
"form",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/Filters.java#L184-L226 |
101,719 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.createHierarchicalTempFile | public static File createHierarchicalTempFile(final File baseDirectory, final int pathElements, final String prefix, final String suffix) throws IOException {
if (! baseDirectory.isDirectory()) throw new IllegalArgumentException(baseDirectory + " is not a directory.");
if (pathElements < 0 || pathElements > 8) thro... | java | public static File createHierarchicalTempFile(final File baseDirectory, final int pathElements, final String prefix, final String suffix) throws IOException {
if (! baseDirectory.isDirectory()) throw new IllegalArgumentException(baseDirectory + " is not a directory.");
if (pathElements < 0 || pathElements > 8) thro... | [
"public",
"static",
"File",
"createHierarchicalTempFile",
"(",
"final",
"File",
"baseDirectory",
",",
"final",
"int",
"pathElements",
",",
"final",
"String",
"prefix",
",",
"final",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"baseDire... | Creates a temporary file with a random hierachical path.
<p> A random hierarchical path of <var>n</var> path elements is a sequence of <var>n</var>
directories of two hexadecimal digits each, followed by a filename created by {@link File#createTempFile(String, String, File)}.
<p> This method creates an empty file hav... | [
"Creates",
"a",
"temporary",
"file",
"with",
"a",
"random",
"hierachical",
"path",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L72-L96 |
101,720 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.writeByteArray | public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException {
writeVByte(a.length, s);
s.write(a);
} | java | public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException {
writeVByte(a.length, s);
s.write(a);
} | [
"public",
"final",
"static",
"void",
"writeByteArray",
"(",
"final",
"byte",
"[",
"]",
"a",
",",
"final",
"ObjectOutputStream",
"s",
")",
"throws",
"IOException",
"{",
"writeVByte",
"(",
"a",
".",
"length",
",",
"s",
")",
";",
"s",
".",
"write",
"(",
"... | Writes a byte array prefixed by its length encoded using vByte.
@param a the array to be written.
@param s the stream where the array should be written. | [
"Writes",
"a",
"byte",
"array",
"prefixed",
"by",
"its",
"length",
"encoded",
"using",
"vByte",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L167-L170 |
101,721 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.readByteArray | public final static byte[] readByteArray(final ObjectInputStream s) throws IOException {
final byte[] a = new byte[readVByte(s)];
s.readFully(a);
return a;
} | java | public final static byte[] readByteArray(final ObjectInputStream s) throws IOException {
final byte[] a = new byte[readVByte(s)];
s.readFully(a);
return a;
} | [
"public",
"final",
"static",
"byte",
"[",
"]",
"readByteArray",
"(",
"final",
"ObjectInputStream",
"s",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"a",
"=",
"new",
"byte",
"[",
"readVByte",
"(",
"s",
")",
"]",
";",
"s",
".",
"readFul... | Reads a byte array prefixed by its length encoded using vByte.
@param s the stream from which the array should be read.
@return the array. | [
"Reads",
"a",
"byte",
"array",
"prefixed",
"by",
"its",
"length",
"encoded",
"using",
"vByte",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L177-L181 |
101,722 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.toByteArray | public static byte[] toByteArray(final String s) {
final byte[] byteArray = new byte[s.length()];
// This needs to be fast.
for(int i = s.length(); i-- != 0;) {
assert s.charAt(i) < (char)0x80 : s.charAt(i);
byteArray[i] = (byte)s.charAt(i);
}
return byteArray;
} | java | public static byte[] toByteArray(final String s) {
final byte[] byteArray = new byte[s.length()];
// This needs to be fast.
for(int i = s.length(); i-- != 0;) {
assert s.charAt(i) < (char)0x80 : s.charAt(i);
byteArray[i] = (byte)s.charAt(i);
}
return byteArray;
} | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"final",
"String",
"s",
")",
"{",
"final",
"byte",
"[",
"]",
"byteArray",
"=",
"new",
"byte",
"[",
"s",
".",
"length",
"(",
")",
"]",
";",
"// This needs to be fast.",
"for",
"(",
"int",
"i",
... | Returns a byte-array representation of an ASCII string.
<p>This method is significantly faster than those relying on character encoders, and it allocates just
one object—the resulting byte array.
@param s an ASCII string.
@return a byte-array representation of {@code s}.
@throws AssertionError if assertions are... | [
"Returns",
"a",
"byte",
"-",
"array",
"representation",
"of",
"an",
"ASCII",
"string",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L192-L200 |
101,723 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.toOutputStream | public static OutputStream toOutputStream(final String s, final OutputStream os) throws IOException {
// This needs to be fast.
final int length = s.length();
for(int i = 0; i < length; i++) {
assert s.charAt(i) < (char)0x100 : s.charAt(i);
os.write(s.charAt(i));
}
return os;
} | java | public static OutputStream toOutputStream(final String s, final OutputStream os) throws IOException {
// This needs to be fast.
final int length = s.length();
for(int i = 0; i < length; i++) {
assert s.charAt(i) < (char)0x100 : s.charAt(i);
os.write(s.charAt(i));
}
return os;
} | [
"public",
"static",
"OutputStream",
"toOutputStream",
"(",
"final",
"String",
"s",
",",
"final",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"// This needs to be fast.",
"final",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"for",
"(",... | Writes a string to an output stream, discarding higher order bits.
<p>This method is significantly faster than those relying on character encoders, and it does not allocate any object.
@param s a string.
@param os an output stream.
@return {@code os}.
@throws AssertionError if assertions are enabled and some characte... | [
"Writes",
"a",
"string",
"to",
"an",
"output",
"stream",
"discarding",
"higher",
"order",
"bits",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L211-L220 |
101,724 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java | WorkbenchEntrySet.add | public boolean add(final WorkbenchEntry e) {
// The starting point.
int pos = hashCode(e.ipAddress) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (Arrays.equals(workbenchEntry[pos].ipAddress, e.ipAddress)) return false;
pos = (pos + 1) & mask;
}
workbenchEntry[pos... | java | public boolean add(final WorkbenchEntry e) {
// The starting point.
int pos = hashCode(e.ipAddress) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (Arrays.equals(workbenchEntry[pos].ipAddress, e.ipAddress)) return false;
pos = (pos + 1) & mask;
}
workbenchEntry[pos... | [
"public",
"boolean",
"add",
"(",
"final",
"WorkbenchEntry",
"e",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"hashCode",
"(",
"e",
".",
"ipAddress",
")",
"&",
"mask",
";",
"// There's always an unused entry.",
"while",
"(",
"workbenchEntry",
"[",
"pos... | Adds a workbench entry to the set, if necessary.
@param e the entry to be added.
@return true if the state set changed as a result of this operation. | [
"Adds",
"a",
"workbench",
"entry",
"to",
"the",
"set",
"if",
"necessary",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java#L77-L88 |
101,725 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java | WorkbenchEntrySet.remove | public boolean remove(final WorkbenchEntry e) {
// The starting point.
int pos = hashCode(e.ipAddress) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (workbenchEntry[pos] == e) {
size--;
shiftKeys(pos);
// TODO: implement resize
return true;
}
pos = ... | java | public boolean remove(final WorkbenchEntry e) {
// The starting point.
int pos = hashCode(e.ipAddress) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (workbenchEntry[pos] == e) {
size--;
shiftKeys(pos);
// TODO: implement resize
return true;
}
pos = ... | [
"public",
"boolean",
"remove",
"(",
"final",
"WorkbenchEntry",
"e",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"hashCode",
"(",
"e",
".",
"ipAddress",
")",
"&",
"mask",
";",
"// There's always an unused entry.",
"while",
"(",
"workbenchEntry",
"[",
"... | Removes a given workbench entry.
@param e the workbench entry to be removed.
@return true if the state set changed as a result of this operation. | [
"Removes",
"a",
"given",
"workbench",
"entry",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java#L117-L131 |
101,726 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java | WorkbenchEntrySet.get | public WorkbenchEntry get(final byte[] address) {
// The starting point.
int pos = hashCode(address) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (Arrays.equals(workbenchEntry[pos].ipAddress, address)) return workbenchEntry[pos];
pos = (pos + 1) & mask;
}
return ... | java | public WorkbenchEntry get(final byte[] address) {
// The starting point.
int pos = hashCode(address) & mask;
// There's always an unused entry.
while (workbenchEntry[pos] != null) {
if (Arrays.equals(workbenchEntry[pos].ipAddress, address)) return workbenchEntry[pos];
pos = (pos + 1) & mask;
}
return ... | [
"public",
"WorkbenchEntry",
"get",
"(",
"final",
"byte",
"[",
"]",
"address",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"hashCode",
"(",
"address",
")",
"&",
"mask",
";",
"// There's always an unused entry.",
"while",
"(",
"workbenchEntry",
"[",
"po... | Returns the entry for a given IP address.
@param address the IP address.
@return the workbench entry corresponding to a given address, or {@code null}. | [
"Returns",
"the",
"entry",
"for",
"a",
"given",
"IP",
"address",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java#L138-L147 |
101,727 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java | WorkbenchEntrySet.rehash | protected void rehash(final int newN) {
int i = 0, pos;
final WorkbenchEntry[] workbenchEntry = this.workbenchEntry;
final int newMask = newN - 1;
final WorkbenchEntry[] newWorkbenchEntry = new WorkbenchEntry[newN];
for (int j = size; j-- != 0;) {
while (workbenchEntry[i] == null) i++;
WorkbenchEntry e... | java | protected void rehash(final int newN) {
int i = 0, pos;
final WorkbenchEntry[] workbenchEntry = this.workbenchEntry;
final int newMask = newN - 1;
final WorkbenchEntry[] newWorkbenchEntry = new WorkbenchEntry[newN];
for (int j = size; j-- != 0;) {
while (workbenchEntry[i] == null) i++;
WorkbenchEntry e... | [
"protected",
"void",
"rehash",
"(",
"final",
"int",
"newN",
")",
"{",
"int",
"i",
"=",
"0",
",",
"pos",
";",
"final",
"WorkbenchEntry",
"[",
"]",
"workbenchEntry",
"=",
"this",
".",
"workbenchEntry",
";",
"final",
"int",
"newMask",
"=",
"newN",
"-",
"1... | Rehashes the set to a new size.
@param newN the new size. | [
"Rehashes",
"the",
"set",
"to",
"a",
"new",
"size",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchEntrySet.java#L179-L197 |
101,728 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java | WorkbenchVirtualizer.dequeuePathQueries | public int dequeuePathQueries(final VisitState visitState, final int maxUrls) throws IOException {
if (maxUrls == 0) return 0;
final int dequeued = (int)Math.min(maxUrls, byteArrayDiskQueues.count(visitState));
for(int i = dequeued; i-- != 0;) visitState.enqueuePathQuery(byteArrayDiskQueues.dequeue(visitState));
... | java | public int dequeuePathQueries(final VisitState visitState, final int maxUrls) throws IOException {
if (maxUrls == 0) return 0;
final int dequeued = (int)Math.min(maxUrls, byteArrayDiskQueues.count(visitState));
for(int i = dequeued; i-- != 0;) visitState.enqueuePathQuery(byteArrayDiskQueues.dequeue(visitState));
... | [
"public",
"int",
"dequeuePathQueries",
"(",
"final",
"VisitState",
"visitState",
",",
"final",
"int",
"maxUrls",
")",
"throws",
"IOException",
"{",
"if",
"(",
"maxUrls",
"==",
"0",
")",
"return",
"0",
";",
"final",
"int",
"dequeued",
"=",
"(",
"int",
")",
... | Dequeues at most the given number of path+queries into the given visit state.
<p>Note that the path+queries are directly enqueued into the visit state using
{@link VisitState#enqueuePathQuery(byte[])}.
@param visitState the visitState in which path+queries will be moved.
@param maxUrls the maximum number of path+quer... | [
"Dequeues",
"at",
"most",
"the",
"given",
"number",
"of",
"path",
"+",
"queries",
"into",
"the",
"given",
"visit",
"state",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java#L87-L92 |
101,729 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java | WorkbenchVirtualizer.enqueueURL | public void enqueueURL(VisitState visitState, final ByteArrayList url) throws IOException {
final byte[] urlBuffer = url.elements();
final int pathQueryStart = BURL.startOfpathAndQuery(urlBuffer);
byteArrayDiskQueues.enqueue(visitState, urlBuffer, pathQueryStart, url.size() - pathQueryStart);
} | java | public void enqueueURL(VisitState visitState, final ByteArrayList url) throws IOException {
final byte[] urlBuffer = url.elements();
final int pathQueryStart = BURL.startOfpathAndQuery(urlBuffer);
byteArrayDiskQueues.enqueue(visitState, urlBuffer, pathQueryStart, url.size() - pathQueryStart);
} | [
"public",
"void",
"enqueueURL",
"(",
"VisitState",
"visitState",
",",
"final",
"ByteArrayList",
"url",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"urlBuffer",
"=",
"url",
".",
"elements",
"(",
")",
";",
"final",
"int",
"pathQueryStart",
"=... | Enqueues the given URL as a path+query associated to the scheme+authority of the given visit state.
@param visitState the visitState to which the URL must be added.
@param url a {@link BURL BUbiNG URL}.
@throws IOException | [
"Enqueues",
"the",
"given",
"URL",
"as",
"a",
"path",
"+",
"query",
"associated",
"to",
"the",
"scheme",
"+",
"authority",
"of",
"the",
"given",
"visit",
"state",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java#L126-L130 |
101,730 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java | WorkbenchVirtualizer.collectIf | public void collectIf(final double threshold, final double targetRatio) throws IOException {
if (byteArrayDiskQueues.ratio() < threshold) {
LOGGER.info("Starting collection...");
byteArrayDiskQueues.collect(targetRatio);
LOGGER.info("Completed collection.");
}
} | java | public void collectIf(final double threshold, final double targetRatio) throws IOException {
if (byteArrayDiskQueues.ratio() < threshold) {
LOGGER.info("Starting collection...");
byteArrayDiskQueues.collect(targetRatio);
LOGGER.info("Completed collection.");
}
} | [
"public",
"void",
"collectIf",
"(",
"final",
"double",
"threshold",
",",
"final",
"double",
"targetRatio",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteArrayDiskQueues",
".",
"ratio",
"(",
")",
"<",
"threshold",
")",
"{",
"LOGGER",
".",
"info",
"(",
... | Performs a garbage collection if the space used is below a given threshold, reaching a given target ratio.
@param threshold if {@link ByteArrayDiskQueues#ratio()} is below this value, a garbage collection will be performed.
@param targetRatio passed to {@link ByteArrayDiskQueues#count(Object)}. | [
"Performs",
"a",
"garbage",
"collection",
"if",
"the",
"space",
"used",
"is",
"below",
"a",
"given",
"threshold",
"reaching",
"a",
"given",
"target",
"ratio",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/WorkbenchVirtualizer.java#L137-L143 |
101,731 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/ConcurrentSummaryStats.java | ConcurrentSummaryStats.add | public synchronized void add(double x) {
final double oldA = a;
a += (x - a) / ++size;
q += (x - a) * (x - oldA);
min = Math.min(min, x);
max = Math.max(max, x);
} | java | public synchronized void add(double x) {
final double oldA = a;
a += (x - a) / ++size;
q += (x - a) * (x - oldA);
min = Math.min(min, x);
max = Math.max(max, x);
} | [
"public",
"synchronized",
"void",
"add",
"(",
"double",
"x",
")",
"{",
"final",
"double",
"oldA",
"=",
"a",
";",
"a",
"+=",
"(",
"x",
"-",
"a",
")",
"/",
"++",
"size",
";",
"q",
"+=",
"(",
"x",
"-",
"a",
")",
"*",
"(",
"x",
"-",
"oldA",
")"... | Adds a value to the stream.
@param x the new value. | [
"Adds",
"a",
"value",
"to",
"the",
"stream",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/ConcurrentSummaryStats.java#L41-L47 |
101,732 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/Workbench.java | Workbench.add | public void add(WorkbenchEntry entry) {
assert ! entry.isEmpty() : entry;
assert ! entry.acquired : entry;
entries.add(entry);
approximatedSize.incrementAndGet();
} | java | public void add(WorkbenchEntry entry) {
assert ! entry.isEmpty() : entry;
assert ! entry.acquired : entry;
entries.add(entry);
approximatedSize.incrementAndGet();
} | [
"public",
"void",
"add",
"(",
"WorkbenchEntry",
"entry",
")",
"{",
"assert",
"!",
"entry",
".",
"isEmpty",
"(",
")",
":",
"entry",
";",
"assert",
"!",
"entry",
".",
"acquired",
":",
"entry",
";",
"entries",
".",
"add",
"(",
"entry",
")",
";",
"approx... | Adds a nonempty, not acquired workbench entry to the workbench.
@param entry a nonempty, not acquired workbench entry. | [
"Adds",
"a",
"nonempty",
"not",
"acquired",
"workbench",
"entry",
"to",
"the",
"workbench",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/Workbench.java#L140-L145 |
101,733 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/Workbench.java | Workbench.acquire | public VisitState acquire() throws InterruptedException {
final WorkbenchEntry entry = entries.take();
assert ! entry.isEmpty();
// No race condition is possible here, because entry is nonempty.
assert ! entry.acquired;
entry.acquired = true;
final VisitState visitState = entry.remove();
assert visitStat... | java | public VisitState acquire() throws InterruptedException {
final WorkbenchEntry entry = entries.take();
assert ! entry.isEmpty();
// No race condition is possible here, because entry is nonempty.
assert ! entry.acquired;
entry.acquired = true;
final VisitState visitState = entry.remove();
assert visitStat... | [
"public",
"VisitState",
"acquire",
"(",
")",
"throws",
"InterruptedException",
"{",
"final",
"WorkbenchEntry",
"entry",
"=",
"entries",
".",
"take",
"(",
")",
";",
"assert",
"!",
"entry",
".",
"isEmpty",
"(",
")",
";",
"// No race condition is possible here, becau... | Acquires a visit state for a scheme+authority accessible by politeness.
Note that this is a blocking method that will wait until such a state is available.
<p>You <strong>must</strong> call {@link #release(VisitState)} when you have finished.
@return a visit state with nonempty URL queue
for a scheme+authority access... | [
"Acquires",
"a",
"visit",
"state",
"for",
"a",
"scheme",
"+",
"authority",
"accessible",
"by",
"politeness",
".",
"Note",
"that",
"this",
"is",
"a",
"blocking",
"method",
"that",
"will",
"wait",
"until",
"such",
"a",
"state",
"is",
"available",
"."
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/Workbench.java#L155-L171 |
101,734 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/IsHttpResponse.java | IsHttpResponse.apply | @Override
public boolean apply(final WarcRecord x) {
Header messageType = x.getWarcHeader(WarcHeader.Name.CONTENT_TYPE);
return (x.getWarcType() == WarcRecord.Type.RESPONSE) &&
(messageType != null && messageType.getValue().equals(HttpResponseWarcRecord.HTTP_RESPONSE_MSGTYPE));
} | java | @Override
public boolean apply(final WarcRecord x) {
Header messageType = x.getWarcHeader(WarcHeader.Name.CONTENT_TYPE);
return (x.getWarcType() == WarcRecord.Type.RESPONSE) &&
(messageType != null && messageType.getValue().equals(HttpResponseWarcRecord.HTTP_RESPONSE_MSGTYPE));
} | [
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"final",
"WarcRecord",
"x",
")",
"{",
"Header",
"messageType",
"=",
"x",
".",
"getWarcHeader",
"(",
"WarcHeader",
".",
"Name",
".",
"CONTENT_TYPE",
")",
";",
"return",
"(",
"x",
".",
"getWarcType",
"(",
... | Apply the filter to a WarcRecord
@param x the <code>WarcRecord</code> to be filtered
@return <code>true</code> if <code>x</code> is an http/https response. | [
"Apply",
"the",
"filter",
"to",
"a",
"WarcRecord"
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/IsHttpResponse.java#L40-L45 |
101,735 | LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/filters/DigestEquals.java | DigestEquals.apply | @Override
public boolean apply(final WarcRecord x) {
Header s = x.getWarcHeader(WarcHeader.Name.WARC_PAYLOAD_DIGEST);
return s != null && Arrays.equals(digest, Util.fromHexString(s.getValue()));
} | java | @Override
public boolean apply(final WarcRecord x) {
Header s = x.getWarcHeader(WarcHeader.Name.WARC_PAYLOAD_DIGEST);
return s != null && Arrays.equals(digest, Util.fromHexString(s.getValue()));
} | [
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"final",
"WarcRecord",
"x",
")",
"{",
"Header",
"s",
"=",
"x",
".",
"getWarcHeader",
"(",
"WarcHeader",
".",
"Name",
".",
"WARC_PAYLOAD_DIGEST",
")",
";",
"return",
"s",
"!=",
"null",
"&&",
"Arrays",
".... | Apply the filter to a given WarcRecord
@param x the WarcRecord to be filtered
@return <code>true</code> if the <code>WarcHeader.Name.WARC_PAYLOAD_DIGEST</code> of the <code>WarcHeader</code> of <code>x</code> is not null and equal to the inner digest (hexadecimal comparison) | [
"Apply",
"the",
"filter",
"to",
"a",
"given",
"WarcRecord"
] | e148acc90031a4f3967422705a9fb07ddaf155e4 | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/DigestEquals.java#L52-L56 |
101,736 | wg/lettuce | src/main/java/com/lambdaworks/redis/protocol/Command.java | Command.cancel | @Override
public boolean cancel(boolean ignored) {
boolean cancelled = false;
if (latch.getCount() == 1) {
latch.countDown();
output = null;
cancelled = true;
}
return cancelled;
} | java | @Override
public boolean cancel(boolean ignored) {
boolean cancelled = false;
if (latch.getCount() == 1) {
latch.countDown();
output = null;
cancelled = true;
}
return cancelled;
} | [
"@",
"Override",
"public",
"boolean",
"cancel",
"(",
"boolean",
"ignored",
")",
"{",
"boolean",
"cancelled",
"=",
"false",
";",
"if",
"(",
"latch",
".",
"getCount",
"(",
")",
"==",
"1",
")",
"{",
"latch",
".",
"countDown",
"(",
")",
";",
"output",
"=... | Cancel the command and notify any waiting consumers. This does
not cause the redis server to stop executing the command.
@param ignored Ignored parameter.
@return true if the command was cancelled. | [
"Cancel",
"the",
"command",
"and",
"notify",
"any",
"waiting",
"consumers",
".",
"This",
"does",
"not",
"cause",
"the",
"redis",
"server",
"to",
"stop",
"executing",
"the",
"command",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L49-L58 |
101,737 | wg/lettuce | src/main/java/com/lambdaworks/redis/protocol/Command.java | Command.get | @Override
public T get() {
try {
latch.await();
return output.get();
} catch (InterruptedException e) {
throw new RedisCommandInterruptedException(e);
}
} | java | @Override
public T get() {
try {
latch.await();
return output.get();
} catch (InterruptedException e) {
throw new RedisCommandInterruptedException(e);
}
} | [
"@",
"Override",
"public",
"T",
"get",
"(",
")",
"{",
"try",
"{",
"latch",
".",
"await",
"(",
")",
";",
"return",
"output",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"throw",
"new",
"RedisCommandInterruptedExc... | Get the command output and if the command hasn't completed
yet, wait until it does.
@return The command output. | [
"Get",
"the",
"command",
"output",
"and",
"if",
"the",
"command",
"hasn",
"t",
"completed",
"yet",
"wait",
"until",
"it",
"does",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L86-L94 |
101,738 | wg/lettuce | src/main/java/com/lambdaworks/redis/protocol/Command.java | Command.get | @Override
public T get(long timeout, TimeUnit unit) throws TimeoutException {
try {
if (!latch.await(timeout, unit)) {
throw new TimeoutException("Command timed out");
}
} catch (InterruptedException e) {
throw new RedisCommandInterruptedException(... | java | @Override
public T get(long timeout, TimeUnit unit) throws TimeoutException {
try {
if (!latch.await(timeout, unit)) {
throw new TimeoutException("Command timed out");
}
} catch (InterruptedException e) {
throw new RedisCommandInterruptedException(... | [
"@",
"Override",
"public",
"T",
"get",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"TimeoutException",
"{",
"try",
"{",
"if",
"(",
"!",
"latch",
".",
"await",
"(",
"timeout",
",",
"unit",
")",
")",
"{",
"throw",
"new",
"TimeoutExcep... | Get the command output and if the command hasn't completed yet,
wait up to the specified time until it does.
@param timeout Maximum time to wait for a result.
@param unit Unit of time for the timeout.
@return The command output.
@throws TimeoutException if the wait timed out. | [
"Get",
"the",
"command",
"output",
"and",
"if",
"the",
"command",
"hasn",
"t",
"completed",
"yet",
"wait",
"up",
"to",
"the",
"specified",
"time",
"until",
"it",
"does",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L107-L117 |
101,739 | wg/lettuce | src/main/java/com/lambdaworks/redis/protocol/Command.java | Command.writeInt | protected static void writeInt(ChannelBuffer buf, int value) {
if (value < 10) {
buf.writeByte('0' + value);
return;
}
StringBuilder sb = new StringBuilder(8);
while (value > 0) {
int digit = value % 10;
sb.append((char) ('0' + digit));
... | java | protected static void writeInt(ChannelBuffer buf, int value) {
if (value < 10) {
buf.writeByte('0' + value);
return;
}
StringBuilder sb = new StringBuilder(8);
while (value > 0) {
int digit = value % 10;
sb.append((char) ('0' + digit));
... | [
"protected",
"static",
"void",
"writeInt",
"(",
"ChannelBuffer",
"buf",
",",
"int",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"10",
")",
"{",
"buf",
".",
"writeByte",
"(",
"'",
"'",
"+",
"value",
")",
";",
"return",
";",
"}",
"StringBuilder",
"sb",... | Write the textual value of a positive integer to the supplied buffer.
@param buf Buffer to write to.
@param value Value to write. | [
"Write",
"the",
"textual",
"value",
"of",
"a",
"positive",
"integer",
"to",
"the",
"supplied",
"buffer",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/protocol/Command.java#L178-L194 |
101,740 | wg/lettuce | src/main/java/com/lambdaworks/codec/Base16.java | Base16.decode | public static byte[] decode(char[] src) {
byte[] dst = new byte[src.length / 2];
for (int si = 0, di = 0; di < dst.length; di++) {
byte high = decode[src[si++] & 0x7f];
byte low = decode[src[si++] & 0x7f];
dst[di] = (byte) ((high << 4) + low);
}
ret... | java | public static byte[] decode(char[] src) {
byte[] dst = new byte[src.length / 2];
for (int si = 0, di = 0; di < dst.length; di++) {
byte high = decode[src[si++] & 0x7f];
byte low = decode[src[si++] & 0x7f];
dst[di] = (byte) ((high << 4) + low);
}
ret... | [
"public",
"static",
"byte",
"[",
"]",
"decode",
"(",
"char",
"[",
"]",
"src",
")",
"{",
"byte",
"[",
"]",
"dst",
"=",
"new",
"byte",
"[",
"src",
".",
"length",
"/",
"2",
"]",
";",
"for",
"(",
"int",
"si",
"=",
"0",
",",
"di",
"=",
"0",
";",... | Decode base16 chars to bytes.
@param src Chars to decode.
@return Decoded bytes. | [
"Decode",
"base16",
"chars",
"to",
"bytes",
"."
] | 5141640dc8289ff3af07b44a87020cef719c5f4a | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/codec/Base16.java#L51-L61 |
101,741 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getNumberBetween | public int getNumberBetween(final int min, final int max) {
if (max < min) {
throw new IllegalArgumentException(String.format("Minimum must be less than minimum (min=%d, max=%d)", min, max));
}
if (max == min) {
return min;
}
return min + random.nextInt(max - min);
} | java | public int getNumberBetween(final int min, final int max) {
if (max < min) {
throw new IllegalArgumentException(String.format("Minimum must be less than minimum (min=%d, max=%d)", min, max));
}
if (max == min) {
return min;
}
return min + random.nextInt(max - min);
} | [
"public",
"int",
"getNumberBetween",
"(",
"final",
"int",
"min",
",",
"final",
"int",
"max",
")",
"{",
"if",
"(",
"max",
"<",
"min",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Minimum must be less than minimum (... | Returns a number betwen min and max
@param min minimum value of result
@param max maximum value of result
@return Random number within range | [
"Returns",
"a",
"number",
"betwen",
"min",
"and",
"max"
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L322-L332 |
101,742 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getDateBetween | public Date getDateBetween(final Date minDate, final Date maxDate) {
// this can break if seconds is an int
long seconds = (maxDate.getTime() - minDate.getTime()) / 1000;
seconds = (long) (random.nextDouble() * seconds);
Date result = new Date();
result.setTime(minDate.getTime() + (seconds * 10... | java | public Date getDateBetween(final Date minDate, final Date maxDate) {
// this can break if seconds is an int
long seconds = (maxDate.getTime() - minDate.getTime()) / 1000;
seconds = (long) (random.nextDouble() * seconds);
Date result = new Date();
result.setTime(minDate.getTime() + (seconds * 10... | [
"public",
"Date",
"getDateBetween",
"(",
"final",
"Date",
"minDate",
",",
"final",
"Date",
"maxDate",
")",
"{",
"// this can break if seconds is an int\r",
"long",
"seconds",
"=",
"(",
"maxDate",
".",
"getTime",
"(",
")",
"-",
"minDate",
".",
"getTime",
"(",
"... | Returns a random date between two dates. This method will alter the time component of the dates
@param minDate Minimum date that can be returned
@param maxDate Maximum date that can be returned
@return random date between these two dates. | [
"Returns",
"a",
"random",
"date",
"between",
"two",
"dates",
".",
"This",
"method",
"will",
"alter",
"the",
"time",
"component",
"of",
"the",
"dates"
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L374-L381 |
101,743 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getRandomText | public String getRandomText(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
StringBuilder sb = new StringBuilder(maxLength);
int length = minLength;
if (maxLength != minLength) {
length = length + random.nextInt(maxLength - minLength);
}
whi... | java | public String getRandomText(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
StringBuilder sb = new StringBuilder(maxLength);
int length = minLength;
if (maxLength != minLength) {
length = length + random.nextInt(maxLength - minLength);
}
whi... | [
"public",
"String",
"getRandomText",
"(",
"final",
"int",
"minLength",
",",
"final",
"int",
"maxLength",
")",
"{",
"validateMinMaxParams",
"(",
"minLength",
",",
"maxLength",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"maxLength",
")",
... | Returns random text made up of english words
@param minLength minimum length of returned string
@param maxLength maximum length of returned string
@return string of length between min and max length | [
"Returns",
"random",
"text",
"made",
"up",
"of",
"english",
"words"
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L401-L422 |
101,744 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getRandomWord | public String getRandomWord(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
// special case if we need a single char
if (maxLength == 1) {
if (chance(50)) {
return "a";
}
return "I";
}
// start from random pos and find ... | java | public String getRandomWord(final int minLength, final int maxLength) {
validateMinMaxParams(minLength, maxLength);
// special case if we need a single char
if (maxLength == 1) {
if (chance(50)) {
return "a";
}
return "I";
}
// start from random pos and find ... | [
"public",
"String",
"getRandomWord",
"(",
"final",
"int",
"minLength",
",",
"final",
"int",
"maxLength",
")",
"{",
"validateMinMaxParams",
"(",
"minLength",
",",
"maxLength",
")",
";",
"// special case if we need a single char\r",
"if",
"(",
"maxLength",
"==",
"1",
... | Returns a valid word based on the length range passed in. The length will always be between the min and max length
range inclusive.
@param minLength minimum length of the word
@param maxLength maximum length of the word
@return a word of a length between min and max length | [
"Returns",
"a",
"valid",
"word",
"based",
"on",
"the",
"length",
"range",
"passed",
"in",
".",
"The",
"length",
"will",
"always",
"be",
"between",
"the",
"min",
"and",
"max",
"length",
"range",
"inclusive",
"."
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L521-L545 |
101,745 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getNumberText | public String getNumberText(final int digits) {
String result = "";
for (int i = 0; i < digits; i++) {
result = result + random.nextInt(10);
}
return result;
} | java | public String getNumberText(final int digits) {
String result = "";
for (int i = 0; i < digits; i++) {
result = result + random.nextInt(10);
}
return result;
} | [
"public",
"String",
"getNumberText",
"(",
"final",
"int",
"digits",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"digits",
";",
"i",
"++",
")",
"{",
"result",
"=",
"result",
"+",
"random",
".",
... | Returns a string containing a set of numbers with a fixed number of digits
@param digits number of digits in the final number
@return Random number as a string with a fixed length | [
"Returns",
"a",
"string",
"containing",
"a",
"set",
"of",
"numbers",
"with",
"a",
"fixed",
"number",
"of",
"digits"
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L572-L578 |
101,746 | andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getEmailAddress | public String getEmailAddress() {
int test = random.nextInt(100);
String email = "";
if (test < 50) {
// name and initial
email = getFirstName().charAt(0) + getLastName();
} else {
// 2 words
email = getItem(contentDataValues.getWords()) + getItem(contentDataValues.getWor... | java | public String getEmailAddress() {
int test = random.nextInt(100);
String email = "";
if (test < 50) {
// name and initial
email = getFirstName().charAt(0) + getLastName();
} else {
// 2 words
email = getItem(contentDataValues.getWords()) + getItem(contentDataValues.getWor... | [
"public",
"String",
"getEmailAddress",
"(",
")",
"{",
"int",
"test",
"=",
"random",
".",
"nextInt",
"(",
"100",
")",
";",
"String",
"email",
"=",
"\"\"",
";",
"if",
"(",
"test",
"<",
"50",
")",
"{",
"// name and initial\r",
"email",
"=",
"getFirstName",
... | Generates an email address
@return an email address | [
"Generates",
"an",
"email",
"address"
] | f748beb93844dea2ad6174715be3b70df0448a9c | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L594-L609 |
101,747 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLDroidPreparedStatement.java | SQLDroidPreparedStatement.setBinaryStream | @Override
public void setBinaryStream(int parameterIndex, InputStream inputStream, int length) throws SQLException {
if (length <= 0) {
throw new SQLException ("Invalid length " + length);
}
if (inputStream == null ) {
throw new SQLException ("Input Stream cannot be null");
}
final in... | java | @Override
public void setBinaryStream(int parameterIndex, InputStream inputStream, int length) throws SQLException {
if (length <= 0) {
throw new SQLException ("Invalid length " + length);
}
if (inputStream == null ) {
throw new SQLException ("Input Stream cannot be null");
}
final in... | [
"@",
"Override",
"public",
"void",
"setBinaryStream",
"(",
"int",
"parameterIndex",
",",
"InputStream",
"inputStream",
",",
"int",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"SQLException",
"(",
"\... | Set the parameter from the contents of a binary stream.
@param parameterIndex the index of the parameter to set
@param inputStream the input stream from which a byte array will be read and set as the value. If inputStream is null
this method will throw a SQLException
@param length a positive non-zero length values
@ex... | [
"Set",
"the",
"parameter",
"from",
"the",
"contents",
"of",
"a",
"binary",
"stream",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLDroidPreparedStatement.java#L514-L544 |
101,748 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLDroidPreparedStatement.java | SQLDroidPreparedStatement.setBinaryStream | @Override
public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
if ( length > Integer.MAX_VALUE ) {
throw new SQLException ("SQLDroid does not allow input stream data greater than " + Integer.MAX_VALUE );
}
setBinaryStream(parameterIndex, inputSt... | java | @Override
public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException {
if ( length > Integer.MAX_VALUE ) {
throw new SQLException ("SQLDroid does not allow input stream data greater than " + Integer.MAX_VALUE );
}
setBinaryStream(parameterIndex, inputSt... | [
"@",
"Override",
"public",
"void",
"setBinaryStream",
"(",
"int",
"parameterIndex",
",",
"InputStream",
"inputStream",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"length",
">",
"Integer",
".",
"MAX_VALUE",
")",
"{",
"throw",
"new",
... | This is a pass through to the integer version of the same method. That is, the long is downcast to an
integer. If the length is greater than Integer.MAX_VALUE this method will throw a SQLException.
@see #setBinaryStream(int, InputStream, int)
@exception SQLException thrown if length is greater than Integer.MAX_VALUE ... | [
"This",
"is",
"a",
"pass",
"through",
"to",
"the",
"integer",
"version",
"of",
"the",
"same",
"method",
".",
"That",
"is",
"the",
"long",
"is",
"downcast",
"to",
"an",
"integer",
".",
"If",
"the",
"length",
"is",
"greater",
"than",
"Integer",
".",
"MAX... | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLDroidPreparedStatement.java#L747-L753 |
101,749 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLDroidDatabaseMetaData.java | SQLDroidDatabaseMetaData.escape | private String escape(final String val) {
// TODO: this function is ugly, pass this work off to SQLite, then we
// don't have to worry about Unicode 4, other characters needing
// escaping, etc.
int len = val.length();
StringBuilder buf = new StringBuilder(len);
for (int i = 0; i < len; i++) {
... | java | private String escape(final String val) {
// TODO: this function is ugly, pass this work off to SQLite, then we
// don't have to worry about Unicode 4, other characters needing
// escaping, etc.
int len = val.length();
StringBuilder buf = new StringBuilder(len);
for (int i = 0; i < len; i++) {
... | [
"private",
"String",
"escape",
"(",
"final",
"String",
"val",
")",
"{",
"// TODO: this function is ugly, pass this work off to SQLite, then we",
"// don't have to worry about Unicode 4, other characters needing",
"// escaping, etc.",
"int",
"len",
"=",
"val",
".",
"leng... | Applies SQL escapes for special characters in a given string.
@param val The string to escape.
@return The SQL escaped string. | [
"Applies",
"SQL",
"escapes",
"for",
"special",
"characters",
"in",
"a",
"given",
"string",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLDroidDatabaseMetaData.java#L1555-L1568 |
101,750 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLDroidClob.java | SQLDroidClob.free | public void free() throws SQLException
{
if (freed)
{
return;
}
string = null;
if (reader != null)
{
reader.close();
}
if (inputStream != null)
{
try
{
inputStream.close();
... | java | public void free() throws SQLException
{
if (freed)
{
return;
}
string = null;
if (reader != null)
{
reader.close();
}
if (inputStream != null)
{
try
{
inputStream.close();
... | [
"public",
"void",
"free",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"freed",
")",
"{",
"return",
";",
"}",
"string",
"=",
"null",
";",
"if",
"(",
"reader",
"!=",
"null",
")",
"{",
"reader",
".",
"close",
"(",
")",
";",
"}",
"if",
"(",
... | Free the Blob object and releases the resources that it holds.
The object is invalid once the free method is called.
@throws SQLException if an error occurs | [
"Free",
"the",
"Blob",
"object",
"and",
"releases",
"the",
"resources",
"that",
"it",
"holds",
".",
"The",
"object",
"is",
"invalid",
"once",
"the",
"free",
"method",
"is",
"called",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLDroidClob.java#L136-L160 |
101,751 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLiteDatabase.java | SQLiteDatabase.isLockedException | protected boolean isLockedException ( SQLiteException maybeLocked ) {
try {
if (Class.forName("android.database.sqlite.SQLiteDatabaseLockedException", false, getClass().getClassLoader()).isAssignableFrom(maybeLocked.getClass()) ) {
return true;
}
} catch (ClassNotFoundException e) {
//... | java | protected boolean isLockedException ( SQLiteException maybeLocked ) {
try {
if (Class.forName("android.database.sqlite.SQLiteDatabaseLockedException", false, getClass().getClassLoader()).isAssignableFrom(maybeLocked.getClass()) ) {
return true;
}
} catch (ClassNotFoundException e) {
//... | [
"protected",
"boolean",
"isLockedException",
"(",
"SQLiteException",
"maybeLocked",
")",
"{",
"try",
"{",
"if",
"(",
"Class",
".",
"forName",
"(",
"\"android.database.sqlite.SQLiteDatabaseLockedException\"",
",",
"false",
",",
"getClass",
"(",
")",
".",
"getClassLoade... | Returns true if the exception is an instance of "SQLiteDatabaseLockedException". Since this exception does not exist
in APIs below 11 this code uses reflection to check the exception type. | [
"Returns",
"true",
"if",
"the",
"exception",
"is",
"an",
"instance",
"of",
"SQLiteDatabaseLockedException",
".",
"Since",
"this",
"exception",
"does",
"not",
"exist",
"in",
"APIs",
"below",
"11",
"this",
"code",
"uses",
"reflection",
"to",
"check",
"the",
"exc... | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLiteDatabase.java#L97-L106 |
101,752 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLiteDatabase.java | SQLiteDatabase.rawQuery | public Cursor rawQuery(String sql, String[] makeArgListQueryString) throws SQLException {
Log.v("SQLiteDatabase rawQuery: " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + sql);
long timeNow = System.currentTimeMillis();
long delta = 0;
do {
try {
Curs... | java | public Cursor rawQuery(String sql, String[] makeArgListQueryString) throws SQLException {
Log.v("SQLiteDatabase rawQuery: " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + sql);
long timeNow = System.currentTimeMillis();
long delta = 0;
do {
try {
Curs... | [
"public",
"Cursor",
"rawQuery",
"(",
"String",
"sql",
",",
"String",
"[",
"]",
"makeArgListQueryString",
")",
"throws",
"SQLException",
"{",
"Log",
".",
"v",
"(",
"\"SQLiteDatabase rawQuery: \"",
"+",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getId",
"("... | Proxy for the "rawQuery" command.
@throws SQLException | [
"Proxy",
"for",
"the",
"rawQuery",
"command",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLiteDatabase.java#L111-L129 |
101,753 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLiteDatabase.java | SQLiteDatabase.execNoArgVoidMethod | public void execNoArgVoidMethod (Transaction transaction ) throws SQLException {
long timeNow = System.currentTimeMillis();
long delta = 0;
do {
try {
switch ( transaction ) {
case setTransactionSuccessful:
sqliteDatabase.setTransactionSuccessful();
return;
... | java | public void execNoArgVoidMethod (Transaction transaction ) throws SQLException {
long timeNow = System.currentTimeMillis();
long delta = 0;
do {
try {
switch ( transaction ) {
case setTransactionSuccessful:
sqliteDatabase.setTransactionSuccessful();
return;
... | [
"public",
"void",
"execNoArgVoidMethod",
"(",
"Transaction",
"transaction",
")",
"throws",
"SQLException",
"{",
"long",
"timeNow",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"delta",
"=",
"0",
";",
"do",
"{",
"try",
"{",
"switch",
"(",
... | Executes one of the methods in the "transactions" enum. This just allows the
timeout code to be combined in one method.
@throws SQLException thrown if the timeout expires before the method successfully executes. | [
"Executes",
"one",
"of",
"the",
"methods",
"in",
"the",
"transactions",
"enum",
".",
"This",
"just",
"allows",
"the",
"timeout",
"code",
"to",
"be",
"combined",
"in",
"one",
"method",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLiteDatabase.java#L195-L223 |
101,754 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLiteDatabase.java | SQLiteDatabase.changedRowCount | public int changedRowCount () {
if ( getChangedRowCount == null ) {
try { // JNA/J2SE compatibility method.
getChangedRowCount = sqliteDatabase.getClass().getMethod("changedRowCount", (Class<?>[])null);
} catch ( Exception any ) {
try {
// Android
getChangedRowCount ... | java | public int changedRowCount () {
if ( getChangedRowCount == null ) {
try { // JNA/J2SE compatibility method.
getChangedRowCount = sqliteDatabase.getClass().getMethod("changedRowCount", (Class<?>[])null);
} catch ( Exception any ) {
try {
// Android
getChangedRowCount ... | [
"public",
"int",
"changedRowCount",
"(",
")",
"{",
"if",
"(",
"getChangedRowCount",
"==",
"null",
")",
"{",
"try",
"{",
"// JNA/J2SE compatibility method.",
"getChangedRowCount",
"=",
"sqliteDatabase",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"changedRo... | The count of changed rows. On JNA platforms, this is a call to sqlite3_changes
On Android, it's a convoluted call to a package-private method (or, if that fails, the
response is '1'. | [
"The",
"count",
"of",
"changed",
"rows",
".",
"On",
"JNA",
"platforms",
"this",
"is",
"a",
"call",
"to",
"sqlite3_changes",
"On",
"Android",
"it",
"s",
"a",
"convoluted",
"call",
"to",
"a",
"package",
"-",
"private",
"method",
"(",
"or",
"if",
"that",
... | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLiteDatabase.java#L254-L276 |
101,755 | SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLDroidConnection.java | SQLDroidConnection.chainException | public static SQLException chainException(android.database.SQLException sqlException) {
if ( sqlThrowable < 0 || sqlThrowable >= 9 ) {
try {
sqlThrowable = 9;
//return new SQLException (sqlException);
// creating by reflection is significantly slower, ... | java | public static SQLException chainException(android.database.SQLException sqlException) {
if ( sqlThrowable < 0 || sqlThrowable >= 9 ) {
try {
sqlThrowable = 9;
//return new SQLException (sqlException);
// creating by reflection is significantly slower, ... | [
"public",
"static",
"SQLException",
"chainException",
"(",
"android",
".",
"database",
".",
"SQLException",
"sqlException",
")",
"{",
"if",
"(",
"sqlThrowable",
"<",
"0",
"||",
"sqlThrowable",
">=",
"9",
")",
"{",
"try",
"{",
"sqlThrowable",
"=",
"9",
";",
... | This will create and return an exception. For API levels less than 9 this will return
a SQLDroidSQLException, for later APIs it will return a SQLException. | [
"This",
"will",
"create",
"and",
"return",
"an",
"exception",
".",
"For",
"API",
"levels",
"less",
"than",
"9",
"this",
"will",
"return",
"a",
"SQLDroidSQLException",
"for",
"later",
"APIs",
"it",
"will",
"return",
"a",
"SQLException",
"."
] | 4fb38ee40338673cb0205044571e4379573762c4 | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLDroidConnection.java#L182-L206 |
101,756 | mattprecious/telescope | telescope/src/main/java/com/mattprecious/telescope/FileProvider.java | FileProvider.attachInfo | @Override public void attachInfo(Context context, ProviderInfo info) {
super.attachInfo(context, info);
// Sanity check our security
if (info.exported) {
throw new SecurityException("Provider must not be exported");
}
if (!info.grantUriPermissions) {
throw new SecurityException("Provide... | java | @Override public void attachInfo(Context context, ProviderInfo info) {
super.attachInfo(context, info);
// Sanity check our security
if (info.exported) {
throw new SecurityException("Provider must not be exported");
}
if (!info.grantUriPermissions) {
throw new SecurityException("Provide... | [
"@",
"Override",
"public",
"void",
"attachInfo",
"(",
"Context",
"context",
",",
"ProviderInfo",
"info",
")",
"{",
"super",
".",
"attachInfo",
"(",
"context",
",",
"info",
")",
";",
"// Sanity check our security",
"if",
"(",
"info",
".",
"exported",
")",
"{"... | After the FileProvider is instantiated, this method is called to provide the system with
information about the provider.
@param context A {@link Context} for the current component.
@param info A {@link ProviderInfo} for the new provider. | [
"After",
"the",
"FileProvider",
"is",
"instantiated",
"this",
"method",
"is",
"called",
"to",
"provide",
"the",
"system",
"with",
"information",
"about",
"the",
"provider",
"."
] | ce5e2710fb16ee214026fc25b091eb946fdbbb3c | https://github.com/mattprecious/telescope/blob/ce5e2710fb16ee214026fc25b091eb946fdbbb3c/telescope/src/main/java/com/mattprecious/telescope/FileProvider.java#L347-L359 |
101,757 | mattprecious/telescope | telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java | TelescopeLayout.cleanUp | public static void cleanUp(Context context) {
File path = getScreenshotFolder(context);
if (!path.exists()) {
return;
}
delete(path);
} | java | public static void cleanUp(Context context) {
File path = getScreenshotFolder(context);
if (!path.exists()) {
return;
}
delete(path);
} | [
"public",
"static",
"void",
"cleanUp",
"(",
"Context",
"context",
")",
"{",
"File",
"path",
"=",
"getScreenshotFolder",
"(",
"context",
")",
";",
"if",
"(",
"!",
"path",
".",
"exists",
"(",
")",
")",
"{",
"return",
";",
"}",
"delete",
"(",
"path",
")... | Delete the screenshot folder for this app. Be careful not to call this before any intents have
finished using a screenshot reference. | [
"Delete",
"the",
"screenshot",
"folder",
"for",
"this",
"app",
".",
"Be",
"careful",
"not",
"to",
"call",
"this",
"before",
"any",
"intents",
"have",
"finished",
"using",
"a",
"screenshot",
"reference",
"."
] | ce5e2710fb16ee214026fc25b091eb946fdbbb3c | https://github.com/mattprecious/telescope/blob/ce5e2710fb16ee214026fc25b091eb946fdbbb3c/telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java#L224-L231 |
101,758 | mattprecious/telescope | telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java | TelescopeLayout.delete | private static void delete(File file) {
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null) {
for (File child : files) {
delete(child);
}
}
}
file.delete();
} | java | private static void delete(File file) {
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null) {
for (File child : files) {
delete(child);
}
}
}
file.delete();
} | [
"private",
"static",
"void",
"delete",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"file",
".",
"listFiles",
"(",
")",
";",
"if",
"(",
"files",
"!=",
"null",
")",
"{",
... | Recursive delete of a file or directory. | [
"Recursive",
"delete",
"of",
"a",
"file",
"or",
"directory",
"."
] | ce5e2710fb16ee214026fc25b091eb946fdbbb3c | https://github.com/mattprecious/telescope/blob/ce5e2710fb16ee214026fc25b091eb946fdbbb3c/telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java#L517-L528 |
101,759 | palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java | UIUtils.getCompatDrawable | public static Drawable getCompatDrawable(Context c, int drawableRes) {
Drawable d = null;
try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
d = c.getResources().getDrawable(drawableRes);
} else {
d = c.getResources().getDrawable(dra... | java | public static Drawable getCompatDrawable(Context c, int drawableRes) {
Drawable d = null;
try {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
d = c.getResources().getDrawable(drawableRes);
} else {
d = c.getResources().getDrawable(dra... | [
"public",
"static",
"Drawable",
"getCompatDrawable",
"(",
"Context",
"c",
",",
"int",
"drawableRes",
")",
"{",
"Drawable",
"d",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"Build",
".",
"VERSION_CODES",
".",
"LO... | helper method to get the drawable by its resource. specific to the correct android version
@param c
@param drawableRes
@return | [
"helper",
"method",
"to",
"get",
"the",
"drawable",
"by",
"its",
"resource",
".",
"specific",
"to",
"the",
"correct",
"android",
"version"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java#L64-L75 |
101,760 | palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java | UIUtils.getThemeAttributeDimensionSize | public static int getThemeAttributeDimensionSize(Context context, int attr) {
TypedArray a = null;
try {
a = context.getTheme().obtainStyledAttributes(new int[]{attr});
return a.getDimensionPixelSize(0, 0);
} finally {
if (a != null) {
a.recycl... | java | public static int getThemeAttributeDimensionSize(Context context, int attr) {
TypedArray a = null;
try {
a = context.getTheme().obtainStyledAttributes(new int[]{attr});
return a.getDimensionPixelSize(0, 0);
} finally {
if (a != null) {
a.recycl... | [
"public",
"static",
"int",
"getThemeAttributeDimensionSize",
"(",
"Context",
"context",
",",
"int",
"attr",
")",
"{",
"TypedArray",
"a",
"=",
"null",
";",
"try",
"{",
"a",
"=",
"context",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttributes",
"(",
"new",
... | Returns the size in pixels of an attribute dimension
@param context the context to get the resources from
@param attr is the attribute dimension we want to know the size from
@return the size in pixels of an attribute dimension | [
"Returns",
"the",
"size",
"in",
"pixels",
"of",
"an",
"attribute",
"dimension"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java#L123-L133 |
101,761 | palaima/DebugDrawer | debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkModule.java | NetworkModule.isMobileNetworkEnabled | private boolean isMobileNetworkEnabled(ConnectivityManager connectivityManager) {
final NetworkInfo info = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
return (info != null && info.isConnected());
} | java | private boolean isMobileNetworkEnabled(ConnectivityManager connectivityManager) {
final NetworkInfo info = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
return (info != null && info.isConnected());
} | [
"private",
"boolean",
"isMobileNetworkEnabled",
"(",
"ConnectivityManager",
"connectivityManager",
")",
"{",
"final",
"NetworkInfo",
"info",
"=",
"connectivityManager",
".",
"getNetworkInfo",
"(",
"ConnectivityManager",
".",
"TYPE_MOBILE",
")",
";",
"return",
"(",
"info... | True if mobile network enabled | [
"True",
"if",
"mobile",
"network",
"enabled"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkModule.java#L120-L123 |
101,762 | palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/DebugDrawer.java | DebugDrawer.closeDrawer | public void closeDrawer() {
if (drawerLayout != null) {
if (drawerGravity != 0) {
drawerLayout.closeDrawer(drawerGravity);
} else {
drawerLayout.closeDrawer(sliderLayout);
}
}
} | java | public void closeDrawer() {
if (drawerLayout != null) {
if (drawerGravity != 0) {
drawerLayout.closeDrawer(drawerGravity);
} else {
drawerLayout.closeDrawer(sliderLayout);
}
}
} | [
"public",
"void",
"closeDrawer",
"(",
")",
"{",
"if",
"(",
"drawerLayout",
"!=",
"null",
")",
"{",
"if",
"(",
"drawerGravity",
"!=",
"0",
")",
"{",
"drawerLayout",
".",
"closeDrawer",
"(",
"drawerGravity",
")",
";",
"}",
"else",
"{",
"drawerLayout",
".",... | close the drawer | [
"close",
"the",
"drawer"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/DebugDrawer.java#L76-L84 |
101,763 | palaima/DebugDrawer | debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber/data/LumberYard.java | LumberYard.save | public void save(OnSaveLogListener listener) {
File dir = getLogDir();
if (dir == null) {
listener.onError("Can't save logs. External storage is not mounted. " +
"Check android.permission.WRITE_EXTERNAL_STORAGE permission");
return;
}
FileWriter ... | java | public void save(OnSaveLogListener listener) {
File dir = getLogDir();
if (dir == null) {
listener.onError("Can't save logs. External storage is not mounted. " +
"Check android.permission.WRITE_EXTERNAL_STORAGE permission");
return;
}
FileWriter ... | [
"public",
"void",
"save",
"(",
"OnSaveLogListener",
"listener",
")",
"{",
"File",
"dir",
"=",
"getLogDir",
"(",
")",
";",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"listener",
".",
"onError",
"(",
"\"Can't save logs. External storage is not mounted. \"",
"+",
... | Save the current logs to disk. | [
"Save",
"the",
"current",
"logs",
"to",
"disk",
"."
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer-timber/src/main/java/io/palaima/debugdrawer/timber/data/LumberYard.java#L98-L134 |
101,764 | palaima/DebugDrawer | debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkController.java | NetworkController.unregisterReceiver | void unregisterReceiver() {
try {
final Context context = contextRef.get();
if (context != null) {
context.unregisterReceiver(receiver);
}
} catch (IllegalArgumentException e) {
}
} | java | void unregisterReceiver() {
try {
final Context context = contextRef.get();
if (context != null) {
context.unregisterReceiver(receiver);
}
} catch (IllegalArgumentException e) {
}
} | [
"void",
"unregisterReceiver",
"(",
")",
"{",
"try",
"{",
"final",
"Context",
"context",
"=",
"contextRef",
".",
"get",
"(",
")",
";",
"if",
"(",
"context",
"!=",
"null",
")",
"{",
"context",
".",
"unregisterReceiver",
"(",
"receiver",
")",
";",
"}",
"}... | Unregister network state broadcast receiver | [
"Unregister",
"network",
"state",
"broadcast",
"receiver"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkController.java#L74-L82 |
101,765 | palaima/DebugDrawer | debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkController.java | NetworkController.registerReceiver | void registerReceiver() {
if (receiver == null) {
receiver = new NetworkReceiver(new Listener() {
@Override
public void post(NetworkChangeEvent event) {
if (onNetworkChangedListener != null) {
onNetworkChangedListener.onChan... | java | void registerReceiver() {
if (receiver == null) {
receiver = new NetworkReceiver(new Listener() {
@Override
public void post(NetworkChangeEvent event) {
if (onNetworkChangedListener != null) {
onNetworkChangedListener.onChan... | [
"void",
"registerReceiver",
"(",
")",
"{",
"if",
"(",
"receiver",
"==",
"null",
")",
"{",
"receiver",
"=",
"new",
"NetworkReceiver",
"(",
"new",
"Listener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"post",
"(",
"NetworkChangeEvent",
"event",
")",
... | Register network state broadcast receiver | [
"Register",
"network",
"state",
"broadcast",
"receiver"
] | 49b5992a1148757bd740c4a0b7df10ef70ade6d8 | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer-commons/src/main/java/io/palaima/debugdrawer/commons/NetworkController.java#L87-L105 |
101,766 | stephenc/java-iso-tools | iso9660-vfs-impl/src/main/java/com/github/stephenc/javaisotools/vfs/provider/iso/IsoFileObject.java | IsoFileObject.setIsoEntry | void setIsoEntry(final Iso9660FileEntry entry) {
if (null != this.entry) {
throw new RuntimeException("Cannot change the underlying entry once it has been set");
}
if (null == entry) {
throw new IllegalArgumentException("'entry' cannot be null");
}
this.e... | java | void setIsoEntry(final Iso9660FileEntry entry) {
if (null != this.entry) {
throw new RuntimeException("Cannot change the underlying entry once it has been set");
}
if (null == entry) {
throw new IllegalArgumentException("'entry' cannot be null");
}
this.e... | [
"void",
"setIsoEntry",
"(",
"final",
"Iso9660FileEntry",
"entry",
")",
"{",
"if",
"(",
"null",
"!=",
"this",
".",
"entry",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Cannot change the underlying entry once it has been set\"",
")",
";",
"}",
"if",
"(",
... | Sets the Iso9660FileEntry that backs this FileObject. This method is package-private because IsoFileSystem
pre-creates some directory entries when building the file index, and it needs to set the backing entry after the
fact. | [
"Sets",
"the",
"Iso9660FileEntry",
"that",
"backs",
"this",
"FileObject",
".",
"This",
"method",
"is",
"package",
"-",
"private",
"because",
"IsoFileSystem",
"pre",
"-",
"creates",
"some",
"directory",
"entries",
"when",
"building",
"the",
"file",
"index",
"and"... | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-vfs-impl/src/main/java/com/github/stephenc/javaisotools/vfs/provider/iso/IsoFileObject.java#L61-L71 |
101,767 | stephenc/java-iso-tools | iso9660-vfs-impl/src/main/java/com/github/stephenc/javaisotools/vfs/provider/iso/IsoFileSystem.java | IsoFileSystem.doCloseCommunicationLink | protected void doCloseCommunicationLink() {
if (null != this.fileSystem && !this.fileSystem.isClosed()) {
try {
this.fileSystem.close();
}
catch (IOException ex) {
VfsLog.warn(getLogger(), log,
"vfs.provider.iso/close-is... | java | protected void doCloseCommunicationLink() {
if (null != this.fileSystem && !this.fileSystem.isClosed()) {
try {
this.fileSystem.close();
}
catch (IOException ex) {
VfsLog.warn(getLogger(), log,
"vfs.provider.iso/close-is... | [
"protected",
"void",
"doCloseCommunicationLink",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"this",
".",
"fileSystem",
"&&",
"!",
"this",
".",
"fileSystem",
".",
"isClosed",
"(",
")",
")",
"{",
"try",
"{",
"this",
".",
"fileSystem",
".",
"close",
"(",
")"... | Closes the underlying .iso file. | [
"Closes",
"the",
"underlying",
".",
"iso",
"file",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-vfs-impl/src/main/java/com/github/stephenc/javaisotools/vfs/provider/iso/IsoFileSystem.java#L146-L156 |
101,768 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660Directory.java | ISO9660Directory.unsortedIterator | public Iterator<ISO9660Directory> unsortedIterator() {
if (unsortedIterator == null) {
unsortedIterator = new ISO9660DirectoryIterator(this, false);
}
unsortedIterator.reset();
return unsortedIterator;
} | java | public Iterator<ISO9660Directory> unsortedIterator() {
if (unsortedIterator == null) {
unsortedIterator = new ISO9660DirectoryIterator(this, false);
}
unsortedIterator.reset();
return unsortedIterator;
} | [
"public",
"Iterator",
"<",
"ISO9660Directory",
">",
"unsortedIterator",
"(",
")",
"{",
"if",
"(",
"unsortedIterator",
"==",
"null",
")",
"{",
"unsortedIterator",
"=",
"new",
"ISO9660DirectoryIterator",
"(",
"this",
",",
"false",
")",
";",
"}",
"unsortedIterator"... | Returns a directory iterator to traverse the directory hierarchy using a recursive method
@return Iterator | [
"Returns",
"a",
"directory",
"iterator",
"to",
"traverse",
"the",
"directory",
"hierarchy",
"using",
"a",
"recursive",
"method"
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660Directory.java#L532-L538 |
101,769 | stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java | AbstractBlockFileSystem.readBlock | protected final boolean readBlock(final long block, final byte[] buffer) throws IOException {
final int bytesRead = readData(block * this.blockSize, buffer, 0, this.blockSize);
if (bytesRead <= 0) {
return false;
}
if (this.blockSize != bytesRead) {
throw new IO... | java | protected final boolean readBlock(final long block, final byte[] buffer) throws IOException {
final int bytesRead = readData(block * this.blockSize, buffer, 0, this.blockSize);
if (bytesRead <= 0) {
return false;
}
if (this.blockSize != bytesRead) {
throw new IO... | [
"protected",
"final",
"boolean",
"readBlock",
"(",
"final",
"long",
"block",
",",
"final",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"final",
"int",
"bytesRead",
"=",
"readData",
"(",
"block",
"*",
"this",
".",
"blockSize",
",",
"buffe... | Read the data for the specified block into the specified buffer.
@return if the block was actually read
@throws IOException if the number of bytes read into the buffer was less than the expected number (i.e. the block
size) | [
"Read",
"the",
"data",
"for",
"the",
"specified",
"block",
"into",
"the",
"specified",
"buffer",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java#L89-L101 |
101,770 | stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java | AbstractBlockFileSystem.readData | protected final synchronized int readData(final long startPos, final byte[] buffer, final int offset,
final int len)
throws IOException {
seek(startPos);
return read(buffer, offset, len);
} | java | protected final synchronized int readData(final long startPos, final byte[] buffer, final int offset,
final int len)
throws IOException {
seek(startPos);
return read(buffer, offset, len);
} | [
"protected",
"final",
"synchronized",
"int",
"readData",
"(",
"final",
"long",
"startPos",
",",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"throws",
"IOException",
"{",
"seek",
"(",
"startPos",
")",... | Read file data, starting at the specified position.
@return the number of bytes read into the buffer | [
"Read",
"file",
"data",
"starting",
"at",
"the",
"specified",
"position",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/spi/AbstractBlockFileSystem.java#L108-L113 |
101,771 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660File.java | ISO9660File.setVersion | public void setVersion(int version) throws HandlerException {
if (version < 1 || version > ISO9660Constants.MAX_FILE_VERSION) {
throw new HandlerException("Invalid file version: " + version);
}
this.version = version;
if (parent != null) {
parent.forceSort();
... | java | public void setVersion(int version) throws HandlerException {
if (version < 1 || version > ISO9660Constants.MAX_FILE_VERSION) {
throw new HandlerException("Invalid file version: " + version);
}
this.version = version;
if (parent != null) {
parent.forceSort();
... | [
"public",
"void",
"setVersion",
"(",
"int",
"version",
")",
"throws",
"HandlerException",
"{",
"if",
"(",
"version",
"<",
"1",
"||",
"version",
">",
"ISO9660Constants",
".",
"MAX_FILE_VERSION",
")",
"{",
"throw",
"new",
"HandlerException",
"(",
"\"Invalid file v... | Set file version
@param version File version
@throws HandlerException Invalid file version | [
"Set",
"file",
"version"
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660File.java#L248-L257 |
101,772 | stephenc/java-iso-tools | loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java | LittleEndian.getUInt32 | public static long getUInt32(byte[] src, int offset) {
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[offset + 3] & 0xFF;
return ((v3 << 24) | (v2 << 16) | (v1 << 8) | v0);
} | java | public static long getUInt32(byte[] src, int offset) {
final long v0 = src[offset] & 0xFF;
final long v1 = src[offset + 1] & 0xFF;
final long v2 = src[offset + 2] & 0xFF;
final long v3 = src[offset + 3] & 0xFF;
return ((v3 << 24) | (v2 << 16) | (v1 << 8) | v0);
} | [
"public",
"static",
"long",
"getUInt32",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
")",
"{",
"final",
"long",
"v0",
"=",
"src",
"[",
"offset",
"]",
"&",
"0xFF",
";",
"final",
"long",
"v1",
"=",
"src",
"[",
"offset",
"+",
"1",
"]",
"&",
... | Gets a 32-bit unsigned integer from the given byte array at the given offset. | [
"Gets",
"a",
"32",
"-",
"bit",
"unsigned",
"integer",
"from",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-spi/src/main/java/com/github/stephenc/javaisotools/loopfs/util/LittleEndian.java#L53-L59 |
101,773 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/rockridge/impl/RockRidgeConfig.java | RockRidgeConfig.addModeForPattern | public void addModeForPattern(String pattern, Integer mode) {
System.out.println(String.format("*** Recording pattern \"%s\" with mode %o", pattern, mode));
patternToModeMap.put(pattern, mode);
} | java | public void addModeForPattern(String pattern, Integer mode) {
System.out.println(String.format("*** Recording pattern \"%s\" with mode %o", pattern, mode));
patternToModeMap.put(pattern, mode);
} | [
"public",
"void",
"addModeForPattern",
"(",
"String",
"pattern",
",",
"Integer",
"mode",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"String",
".",
"format",
"(",
"\"*** Recording pattern \\\"%s\\\" with mode %o\"",
",",
"pattern",
",",
"mode",
")",
")"... | Add a new mode for a specific file pattern.
@param pattern the pattern to be matched
@param mode the POSIX file mode for matching filenames | [
"Add",
"a",
"new",
"mode",
"for",
"a",
"specific",
"file",
"pattern",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/rockridge/impl/RockRidgeConfig.java#L95-L98 |
101,774 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Util.java | Util.getDChars | public static String getDChars(byte[] block, int pos, int length) {
return new String(block, pos - 1, length).trim();
} | java | public static String getDChars(byte[] block, int pos, int length) {
return new String(block, pos - 1, length).trim();
} | [
"public",
"static",
"String",
"getDChars",
"(",
"byte",
"[",
"]",
"block",
",",
"int",
"pos",
",",
"int",
"length",
")",
"{",
"return",
"new",
"String",
"(",
"block",
",",
"pos",
"-",
"1",
",",
"length",
")",
".",
"trim",
"(",
")",
";",
"}"
] | Gets a string of d-characters. See section 7.4.1. | [
"Gets",
"a",
"string",
"of",
"d",
"-",
"characters",
".",
"See",
"section",
"7",
".",
"4",
".",
"1",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Util.java#L97-L99 |
101,775 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660RootDirectory.java | ISO9660RootDirectory.setMovedDirectoryStore | public void setMovedDirectoryStore() {
if (movedDirectoriesStore == null) {
movedDirectoriesStore = new ISO9660Directory(MOVED_DIRECTORIES_STORE_NAME);
addDirectory(movedDirectoriesStore);
// Force iterator recreation
sortedIterator = null;
}
} | java | public void setMovedDirectoryStore() {
if (movedDirectoriesStore == null) {
movedDirectoriesStore = new ISO9660Directory(MOVED_DIRECTORIES_STORE_NAME);
addDirectory(movedDirectoriesStore);
// Force iterator recreation
sortedIterator = null;
}
} | [
"public",
"void",
"setMovedDirectoryStore",
"(",
")",
"{",
"if",
"(",
"movedDirectoriesStore",
"==",
"null",
")",
"{",
"movedDirectoriesStore",
"=",
"new",
"ISO9660Directory",
"(",
"MOVED_DIRECTORIES_STORE_NAME",
")",
";",
"addDirectory",
"(",
"movedDirectoriesStore",
... | Create and Add Moved Directories Store to Directory Hierarchy | [
"Create",
"and",
"Add",
"Moved",
"Directories",
"Store",
"to",
"Directory",
"Hierarchy"
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/ISO9660RootDirectory.java#L44-L51 |
101,776 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/joliet/impl/JolietConfig.java | JolietConfig.setUCS2Level | public void setUCS2Level(int level) throws ConfigException {
if (level != 1 && level != 2 && level != 3) {
throw new ConfigException(this, "Invalid UCS-2 level: " + level);
}
this.ucs2_level = level;
} | java | public void setUCS2Level(int level) throws ConfigException {
if (level != 1 && level != 2 && level != 3) {
throw new ConfigException(this, "Invalid UCS-2 level: " + level);
}
this.ucs2_level = level;
} | [
"public",
"void",
"setUCS2Level",
"(",
"int",
"level",
")",
"throws",
"ConfigException",
"{",
"if",
"(",
"level",
"!=",
"1",
"&&",
"level",
"!=",
"2",
"&&",
"level",
"!=",
"3",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"this",
",",
"\"Invalid UCS... | Set UCS-2 Level
@param level 1, 2 or 3
@throws ConfigException Invalid UCS-2 level
@see http://www.nada.kth.se/i18n/ucs/unicode-iso10646-oview.html | [
"Set",
"UCS",
"-",
"2",
"Level"
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/joliet/impl/JolietConfig.java#L64-L69 |
101,777 | stephenc/java-iso-tools | iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/impl/ISO9660Config.java | ISO9660Config.allowASCII | public void allowASCII(boolean allow) {
this.allowASCII = allow;
ISO9660NamingConventions.FORCE_ISO9660_CHARSET = !allow;
if (allow) {
System.out.println("Warning: Allowing the full ASCII character set breaks ISO 9660 conformance.");
}
} | java | public void allowASCII(boolean allow) {
this.allowASCII = allow;
ISO9660NamingConventions.FORCE_ISO9660_CHARSET = !allow;
if (allow) {
System.out.println("Warning: Allowing the full ASCII character set breaks ISO 9660 conformance.");
}
} | [
"public",
"void",
"allowASCII",
"(",
"boolean",
"allow",
")",
"{",
"this",
".",
"allowASCII",
"=",
"allow",
";",
"ISO9660NamingConventions",
".",
"FORCE_ISO9660_CHARSET",
"=",
"!",
"allow",
";",
"if",
"(",
"allow",
")",
"{",
"System",
".",
"out",
".",
"pri... | Allow ASCII for filenames and other strings
@param allow Whether to allow the ASCII character set for filenames and other strings | [
"Allow",
"ASCII",
"for",
"filenames",
"and",
"other",
"strings"
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/iso9660-writer/src/main/java/com/github/stephenc/javaisotools/iso9660/impl/ISO9660Config.java#L73-L79 |
101,778 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.deserializePrimary | private void deserializePrimary(byte[] descriptor) throws IOException {
// according to the spec, some ISO 9660 file systems can contain multiple identical primary
// volume descriptors
if (this.hasPrimary) {
return;
}
validateBlockSize(descriptor);
if (!thi... | java | private void deserializePrimary(byte[] descriptor) throws IOException {
// according to the spec, some ISO 9660 file systems can contain multiple identical primary
// volume descriptors
if (this.hasPrimary) {
return;
}
validateBlockSize(descriptor);
if (!thi... | [
"private",
"void",
"deserializePrimary",
"(",
"byte",
"[",
"]",
"descriptor",
")",
"throws",
"IOException",
"{",
"// according to the spec, some ISO 9660 file systems can contain multiple identical primary",
"// volume descriptors",
"if",
"(",
"this",
".",
"hasPrimary",
")",
... | Read the fields of a primary volume descriptor.
@param descriptor the descriptor bytes
@throws IOException | [
"Read",
"the",
"fields",
"of",
"a",
"primary",
"volume",
"descriptor",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L121-L155 |
101,779 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.deserializeSupplementary | private void deserializeSupplementary(byte[] descriptor) throws IOException {
// for now, only recognize one supplementary descriptor
if (this.hasSupplementary) {
return;
}
validateBlockSize(descriptor);
String escapeSequences = Util.getDChars(descriptor, 89, 32);
... | java | private void deserializeSupplementary(byte[] descriptor) throws IOException {
// for now, only recognize one supplementary descriptor
if (this.hasSupplementary) {
return;
}
validateBlockSize(descriptor);
String escapeSequences = Util.getDChars(descriptor, 89, 32);
... | [
"private",
"void",
"deserializeSupplementary",
"(",
"byte",
"[",
"]",
"descriptor",
")",
"throws",
"IOException",
"{",
"// for now, only recognize one supplementary descriptor",
"if",
"(",
"this",
".",
"hasSupplementary",
")",
"{",
"return",
";",
"}",
"validateBlockSize... | The supplementary descriptor sets the character encoding and may override the common
descriptor information.
@param descriptor the descriptor bytes
@throws IOException | [
"The",
"supplementary",
"descriptor",
"sets",
"the",
"character",
"encoding",
"and",
"may",
"override",
"the",
"common",
"descriptor",
"information",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L164-L186 |
101,780 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.deserializeCommon | private void deserializeCommon(byte[] descriptor) throws IOException {
this.systemIdentifier = Util.getAChars(descriptor, 9, 32, this.encoding);
this.volumeIdentifier = Util.getDChars(descriptor, 41, 32, this.encoding);
this.volumeSetIdentifier = Util.getDChars(descriptor, 191, 128, this.encodin... | java | private void deserializeCommon(byte[] descriptor) throws IOException {
this.systemIdentifier = Util.getAChars(descriptor, 9, 32, this.encoding);
this.volumeIdentifier = Util.getDChars(descriptor, 41, 32, this.encoding);
this.volumeSetIdentifier = Util.getDChars(descriptor, 191, 128, this.encodin... | [
"private",
"void",
"deserializeCommon",
"(",
"byte",
"[",
"]",
"descriptor",
")",
"throws",
"IOException",
"{",
"this",
".",
"systemIdentifier",
"=",
"Util",
".",
"getAChars",
"(",
"descriptor",
",",
"9",
",",
"32",
",",
"this",
".",
"encoding",
")",
";",
... | Read the information common to primary and secondary volume descriptors.
@param descriptor the volume descriptor bytes
@throws IOException | [
"Read",
"the",
"information",
"common",
"to",
"primary",
"and",
"secondary",
"volume",
"descriptors",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L194-L199 |
101,781 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.validateBlockSize | private void validateBlockSize(byte[] descriptor) throws IOException {
int blockSize = Util.getUInt16Both(descriptor, 129);
if (blockSize != Constants.DEFAULT_BLOCK_SIZE) {
throw new LoopFileSystemException("Invalid block size: " + blockSize);
}
} | java | private void validateBlockSize(byte[] descriptor) throws IOException {
int blockSize = Util.getUInt16Both(descriptor, 129);
if (blockSize != Constants.DEFAULT_BLOCK_SIZE) {
throw new LoopFileSystemException("Invalid block size: " + blockSize);
}
} | [
"private",
"void",
"validateBlockSize",
"(",
"byte",
"[",
"]",
"descriptor",
")",
"throws",
"IOException",
"{",
"int",
"blockSize",
"=",
"Util",
".",
"getUInt16Both",
"(",
"descriptor",
",",
"129",
")",
";",
"if",
"(",
"blockSize",
"!=",
"Constants",
".",
... | Check that the block size is what we expect.
@param descriptor the descriptor bytes
@throws IOException | [
"Check",
"that",
"the",
"block",
"size",
"is",
"what",
"we",
"expect",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L207-L212 |
101,782 | stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.getEncoding | private String getEncoding(String escapeSequences) {
String encoding = null;
if (escapeSequences.equals("%/@")) {
// UCS-2 level 1
encoding = "UTF-16BE";
} else if (escapeSequences.equals("%/C")) {
// UCS-2 level 2
encoding = "UTF-16BE";
}... | java | private String getEncoding(String escapeSequences) {
String encoding = null;
if (escapeSequences.equals("%/@")) {
// UCS-2 level 1
encoding = "UTF-16BE";
} else if (escapeSequences.equals("%/C")) {
// UCS-2 level 2
encoding = "UTF-16BE";
}... | [
"private",
"String",
"getEncoding",
"(",
"String",
"escapeSequences",
")",
"{",
"String",
"encoding",
"=",
"null",
";",
"if",
"(",
"escapeSequences",
".",
"equals",
"(",
"\"%/@\"",
")",
")",
"{",
"// UCS-2 level 1",
"encoding",
"=",
"\"UTF-16BE\"",
";",
"}",
... | Derive an encoding name from the given escape sequences.
@param escapeSequences
@return | [
"Derive",
"an",
"encoding",
"name",
"from",
"the",
"given",
"escape",
"sequences",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L220-L235 |
101,783 | stephenc/java-iso-tools | examples/archive/src/main/java/com/github/stephenc/javaisotools/examples/archive/IsoCreation.java | IsoCreation.finalizeDisc | public void finalizeDisc(File isoPath) {
ISOImageFileHandler handler = null;
try {
handler = new ISOImageFileHandler(isoPath);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
CreateISO iso = new CreateISO(handler, root);
... | java | public void finalizeDisc(File isoPath) {
ISOImageFileHandler handler = null;
try {
handler = new ISOImageFileHandler(isoPath);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
try {
CreateISO iso = new CreateISO(handler, root);
... | [
"public",
"void",
"finalizeDisc",
"(",
"File",
"isoPath",
")",
"{",
"ISOImageFileHandler",
"handler",
"=",
"null",
";",
"try",
"{",
"handler",
"=",
"new",
"ISOImageFileHandler",
"(",
"isoPath",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
... | Close out the disc.
@param isoPath | [
"Close",
"out",
"the",
"disc",
"."
] | 828c50b02eb311a14dde0dab43462a0d0c9dfb06 | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/examples/archive/src/main/java/com/github/stephenc/javaisotools/examples/archive/IsoCreation.java#L93-L111 |
101,784 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/controller/MultipleUploadItems.java | MultipleUploadItems.items | public List<FileItemStream> items(String fieldName) {
List<FileItemStream> filteredItems = new ArrayList<FileItemStream>();
for (FileItemStream fis : _items) {
if (fis.getFieldName().equals(fieldName))
filteredItems.add(fis);
}
return filteredItems;
} | java | public List<FileItemStream> items(String fieldName) {
List<FileItemStream> filteredItems = new ArrayList<FileItemStream>();
for (FileItemStream fis : _items) {
if (fis.getFieldName().equals(fieldName))
filteredItems.add(fis);
}
return filteredItems;
} | [
"public",
"List",
"<",
"FileItemStream",
">",
"items",
"(",
"String",
"fieldName",
")",
"{",
"List",
"<",
"FileItemStream",
">",
"filteredItems",
"=",
"new",
"ArrayList",
"<",
"FileItemStream",
">",
"(",
")",
";",
"for",
"(",
"FileItemStream",
"fis",
":",
... | find items with given form field name
@param fieldName
@return | [
"find",
"items",
"with",
"given",
"form",
"field",
"name"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/controller/MultipleUploadItems.java#L40-L48 |
101,785 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/util/FsItemFilterUtils.java | FsItemFilterUtils.createMimeFilter | public static FsItemFilter createMimeFilter(final String[] mimeFilters)
{
if (mimeFilters == null || mimeFilters.length == 0)
return FILTER_ALL;
return new FsItemFilter()
{
@Override
public boolean accepts(FsItemEx item)
{
String mimeType = item.getMimeType().toUpperCase();
for ... | java | public static FsItemFilter createMimeFilter(final String[] mimeFilters)
{
if (mimeFilters == null || mimeFilters.length == 0)
return FILTER_ALL;
return new FsItemFilter()
{
@Override
public boolean accepts(FsItemEx item)
{
String mimeType = item.getMimeType().toUpperCase();
for ... | [
"public",
"static",
"FsItemFilter",
"createMimeFilter",
"(",
"final",
"String",
"[",
"]",
"mimeFilters",
")",
"{",
"if",
"(",
"mimeFilters",
"==",
"null",
"||",
"mimeFilters",
".",
"length",
"==",
"0",
")",
"return",
"FILTER_ALL",
";",
"return",
"new",
"FsIt... | returns a FsItemFilter according to given mimeFilters
@param mimeFilters
An array of MIME types, if <code>null</code> no filtering is
done
@return A filter that only accepts the supplied MIME types. | [
"returns",
"a",
"FsItemFilter",
"according",
"to",
"given",
"mimeFilters"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/util/FsItemFilterUtils.java#L62-L83 |
101,786 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java | ConnectorServlet.createCommandExecutorFactory | protected CommandExecutorFactory createCommandExecutorFactory(
ServletConfig config)
{
DefaultCommandExecutorFactory defaultCommandExecutorFactory = new DefaultCommandExecutorFactory();
defaultCommandExecutorFactory
.setClassNamePattern("cn.bluejoe.elfinder.controller.executors.%sCommandExecutor");
... | java | protected CommandExecutorFactory createCommandExecutorFactory(
ServletConfig config)
{
DefaultCommandExecutorFactory defaultCommandExecutorFactory = new DefaultCommandExecutorFactory();
defaultCommandExecutorFactory
.setClassNamePattern("cn.bluejoe.elfinder.controller.executors.%sCommandExecutor");
... | [
"protected",
"CommandExecutorFactory",
"createCommandExecutorFactory",
"(",
"ServletConfig",
"config",
")",
"{",
"DefaultCommandExecutorFactory",
"defaultCommandExecutorFactory",
"=",
"new",
"DefaultCommandExecutorFactory",
"(",
")",
";",
"defaultCommandExecutorFactory",
".",
"se... | create a command executor factory
@param config
@return | [
"create",
"a",
"command",
"executor",
"factory"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java#L42-L51 |
101,787 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java | ConnectorServlet.createConnectorController | protected ConnectorController createConnectorController(ServletConfig config)
{
ConnectorController connectorController = new ConnectorController();
connectorController
.setCommandExecutorFactory(createCommandExecutorFactory(config));
connectorController.setFsServiceFactory(createServiceFactory(config... | java | protected ConnectorController createConnectorController(ServletConfig config)
{
ConnectorController connectorController = new ConnectorController();
connectorController
.setCommandExecutorFactory(createCommandExecutorFactory(config));
connectorController.setFsServiceFactory(createServiceFactory(config... | [
"protected",
"ConnectorController",
"createConnectorController",
"(",
"ServletConfig",
"config",
")",
"{",
"ConnectorController",
"connectorController",
"=",
"new",
"ConnectorController",
"(",
")",
";",
"connectorController",
".",
"setCommandExecutorFactory",
"(",
"createComm... | create a connector controller
@param config
@return | [
"create",
"a",
"connector",
"controller"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java#L59-L68 |
101,788 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java | ConnectorServlet.createServiceFactory | protected StaticFsServiceFactory createServiceFactory(ServletConfig config)
{
StaticFsServiceFactory staticFsServiceFactory = new StaticFsServiceFactory();
DefaultFsService fsService = createFsService();
staticFsServiceFactory.setFsService(fsService);
return staticFsServiceFactory;
} | java | protected StaticFsServiceFactory createServiceFactory(ServletConfig config)
{
StaticFsServiceFactory staticFsServiceFactory = new StaticFsServiceFactory();
DefaultFsService fsService = createFsService();
staticFsServiceFactory.setFsService(fsService);
return staticFsServiceFactory;
} | [
"protected",
"StaticFsServiceFactory",
"createServiceFactory",
"(",
"ServletConfig",
"config",
")",
"{",
"StaticFsServiceFactory",
"staticFsServiceFactory",
"=",
"new",
"StaticFsServiceFactory",
"(",
")",
";",
"DefaultFsService",
"fsService",
"=",
"createFsService",
"(",
")... | create a service factory
@param config
@return | [
"create",
"a",
"service",
"factory"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/servlet/ConnectorServlet.java#L102-L109 |
101,789 | bluejoe2008/elfinder-2.x-servlet | src/main/java/cn/bluejoe/elfinder/impl/DefaultFsService.java | DefaultFsService.findRecursively | private Collection<FsItemEx> findRecursively(FsItemFilter filter,
FsItem root)
{
List<FsItemEx> results = new ArrayList<FsItemEx>();
FsVolume vol = root.getVolume();
for (FsItem child : vol.listChildren(root))
{
if (vol.isFolder(child))
{
results.addAll(findRecursively(filter, child));
}
els... | java | private Collection<FsItemEx> findRecursively(FsItemFilter filter,
FsItem root)
{
List<FsItemEx> results = new ArrayList<FsItemEx>();
FsVolume vol = root.getVolume();
for (FsItem child : vol.listChildren(root))
{
if (vol.isFolder(child))
{
results.addAll(findRecursively(filter, child));
}
els... | [
"private",
"Collection",
"<",
"FsItemEx",
">",
"findRecursively",
"(",
"FsItemFilter",
"filter",
",",
"FsItem",
"root",
")",
"{",
"List",
"<",
"FsItemEx",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"FsItemEx",
">",
"(",
")",
";",
"FsVolume",
"vol",
"=",... | find files recursively in specific folder
@param filter
The filter to apply to select files.
@param root
The location in the hierarchy to search from.
@return A collection of files that match the filter and have the root as
a parent. | [
"find",
"files",
"recursively",
"in",
"specific",
"folder"
] | 83caa5c8ccb05a4139c87babb1b37b73248db9da | https://github.com/bluejoe2008/elfinder-2.x-servlet/blob/83caa5c8ccb05a4139c87babb1b37b73248db9da/src/main/java/cn/bluejoe/elfinder/impl/DefaultFsService.java#L66-L86 |
101,790 | Cosium/spring-data-jpa-entity-graph | src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryHintsUtils.java | QueryHintsUtils.removeEntityGraphs | static void removeEntityGraphs(Map<String, Object> queryHints) {
if (queryHints == null) {
return;
}
queryHints.remove(EntityGraph.EntityGraphType.FETCH.getKey());
queryHints.remove(EntityGraph.EntityGraphType.LOAD.getKey());
} | java | static void removeEntityGraphs(Map<String, Object> queryHints) {
if (queryHints == null) {
return;
}
queryHints.remove(EntityGraph.EntityGraphType.FETCH.getKey());
queryHints.remove(EntityGraph.EntityGraphType.LOAD.getKey());
} | [
"static",
"void",
"removeEntityGraphs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"queryHints",
")",
"{",
"if",
"(",
"queryHints",
"==",
"null",
")",
"{",
"return",
";",
"}",
"queryHints",
".",
"remove",
"(",
"EntityGraph",
".",
"EntityGraphType",
"."... | Remove all EntityGraph pre existing in the QueryHints
@param queryHints | [
"Remove",
"all",
"EntityGraph",
"pre",
"existing",
"in",
"the",
"QueryHints"
] | b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f | https://github.com/Cosium/spring-data-jpa-entity-graph/blob/b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryHintsUtils.java#L30-L36 |
101,791 | Cosium/spring-data-jpa-entity-graph | src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/RepositoryEntityManagerEntityGraphInjector.java | RepositoryEntityManagerEntityGraphInjector.proxy | static EntityManager proxy(EntityManager entityManager) {
ProxyFactory proxyFactory = new ProxyFactory(entityManager);
proxyFactory.addAdvice(new RepositoryEntityManagerEntityGraphInjector());
return (EntityManager) proxyFactory.getProxy();
} | java | static EntityManager proxy(EntityManager entityManager) {
ProxyFactory proxyFactory = new ProxyFactory(entityManager);
proxyFactory.addAdvice(new RepositoryEntityManagerEntityGraphInjector());
return (EntityManager) proxyFactory.getProxy();
} | [
"static",
"EntityManager",
"proxy",
"(",
"EntityManager",
"entityManager",
")",
"{",
"ProxyFactory",
"proxyFactory",
"=",
"new",
"ProxyFactory",
"(",
"entityManager",
")",
";",
"proxyFactory",
".",
"addAdvice",
"(",
"new",
"RepositoryEntityManagerEntityGraphInjector",
"... | Builds a proxy on entity manager which is aware of methods that can make use of query hints.
@param entityManager The entity manager to proxy
@return The proxied entity manager | [
"Builds",
"a",
"proxy",
"on",
"entity",
"manager",
"which",
"is",
"aware",
"of",
"methods",
"that",
"can",
"make",
"use",
"of",
"query",
"hints",
"."
] | b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f | https://github.com/Cosium/spring-data-jpa-entity-graph/blob/b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/RepositoryEntityManagerEntityGraphInjector.java#L45-L49 |
101,792 | Cosium/spring-data-jpa-entity-graph | src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/RepositoryEntityManagerEntityGraphInjector.java | RepositoryEntityManagerEntityGraphInjector.addEntityGraphToFindMethodQueryHints | private void addEntityGraphToFindMethodQueryHints(
EntityGraphBean entityGraphCandidate, MethodInvocation invocation) {
LOG.trace("Trying to push the EntityGraph candidate to the query hints find method");
Map<String, Object> queryProperties = null;
int index = 0;
for (Object argument : invocatio... | java | private void addEntityGraphToFindMethodQueryHints(
EntityGraphBean entityGraphCandidate, MethodInvocation invocation) {
LOG.trace("Trying to push the EntityGraph candidate to the query hints find method");
Map<String, Object> queryProperties = null;
int index = 0;
for (Object argument : invocatio... | [
"private",
"void",
"addEntityGraphToFindMethodQueryHints",
"(",
"EntityGraphBean",
"entityGraphCandidate",
",",
"MethodInvocation",
"invocation",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Trying to push the EntityGraph candidate to the query hints find method\"",
")",
";",
"Map",
... | Push the current entity graph to the find method query hints.
@param entityGraphCandidate The EntityGraph to set
@param invocation The invocation of the find method | [
"Push",
"the",
"current",
"entity",
"graph",
"to",
"the",
"find",
"method",
"query",
"hints",
"."
] | b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f | https://github.com/Cosium/spring-data-jpa-entity-graph/blob/b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/RepositoryEntityManagerEntityGraphInjector.java#L94-L123 |
101,793 | SeanRoy/lambda-maven-plugin | src/main/java/com/github/seanroy/plugins/DeleteLambdaMojo.java | DeleteLambdaMojo.execute | public void execute() throws MojoExecutionException {
super.execute();
try {
lambdaFunctions.forEach(context -> {
try {
deleteTriggers.andThen(deleteFunction).apply(
context.withFunctionArn(lambdaClient.getFunction(new GetFuncti... | java | public void execute() throws MojoExecutionException {
super.execute();
try {
lambdaFunctions.forEach(context -> {
try {
deleteTriggers.andThen(deleteFunction).apply(
context.withFunctionArn(lambdaClient.getFunction(new GetFuncti... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"super",
".",
"execute",
"(",
")",
";",
"try",
"{",
"lambdaFunctions",
".",
"forEach",
"(",
"context",
"->",
"{",
"try",
"{",
"deleteTriggers",
".",
"andThen",
"(",
"deleteFuncti... | The entry point into the AWS lambda function. | [
"The",
"entry",
"point",
"into",
"the",
"AWS",
"lambda",
"function",
"."
] | 7959db46f8ea9f100da6a31962de81fe57ac3015 | https://github.com/SeanRoy/lambda-maven-plugin/blob/7959db46f8ea9f100da6a31962de81fe57ac3015/src/main/java/com/github/seanroy/plugins/DeleteLambdaMojo.java#L32-L47 |
101,794 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/QueryPersistor.java | QueryPersistor.storeAs | public void storeAs(String queryName) {
QueryRecorder.queryCompleted(this.query);
QueryMemento qm = this.createMemento();
IDBAccess dbAccess = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDBAccess();
String qLabel = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDomainL... | java | public void storeAs(String queryName) {
QueryRecorder.queryCompleted(this.query);
QueryMemento qm = this.createMemento();
IDBAccess dbAccess = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDBAccess();
String qLabel = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDomainL... | [
"public",
"void",
"storeAs",
"(",
"String",
"queryName",
")",
"{",
"QueryRecorder",
".",
"queryCompleted",
"(",
"this",
".",
"query",
")",
";",
"QueryMemento",
"qm",
"=",
"this",
".",
"createMemento",
"(",
")",
";",
"IDBAccess",
"dbAccess",
"=",
"(",
"(",
... | Store the query with the domain model under the given name.
@param queryName | [
"Store",
"the",
"query",
"with",
"the",
"domain",
"model",
"under",
"the",
"given",
"name",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/QueryPersistor.java#L88-L110 |
101,795 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/QueryPersistor.java | QueryPersistor.augment | public QueryPersistor augment(DomainObjectMatch<?> domainObjectMatch, String as) {
if (this.augmentations == null)
this.augmentations = new HashMap<DomainObjectMatch<?>, String>();
this.augmentations.put(domainObjectMatch, as);
return this;
} | java | public QueryPersistor augment(DomainObjectMatch<?> domainObjectMatch, String as) {
if (this.augmentations == null)
this.augmentations = new HashMap<DomainObjectMatch<?>, String>();
this.augmentations.put(domainObjectMatch, as);
return this;
} | [
"public",
"QueryPersistor",
"augment",
"(",
"DomainObjectMatch",
"<",
"?",
">",
"domainObjectMatch",
",",
"String",
"as",
")",
"{",
"if",
"(",
"this",
".",
"augmentations",
"==",
"null",
")",
"this",
".",
"augmentations",
"=",
"new",
"HashMap",
"<",
"DomainO... | Give a name to a DomainObjectMatch for better readability in a Java-DSL like string representation
@param domainObjectMatch
@param as
@return | [
"Give",
"a",
"name",
"to",
"a",
"DomainObjectMatch",
"for",
"better",
"readability",
"in",
"a",
"Java",
"-",
"DSL",
"like",
"string",
"representation"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/QueryPersistor.java#L118-L123 |
101,796 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.createMatchFrom | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> createMatchFrom(DomainObjectMatch<T> domainObjectMatch) {
DomainObjectMatch<T> ret;
FromPreviousQueryExpression pqe;
DomainObjectMatch<?> match;
DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjectMatch);
if (delegate != null) { // ... | java | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> createMatchFrom(DomainObjectMatch<T> domainObjectMatch) {
DomainObjectMatch<T> ret;
FromPreviousQueryExpression pqe;
DomainObjectMatch<?> match;
DomainObjectMatch<?> delegate = APIAccess.getDelegate(domainObjectMatch);
if (delegate != null) { // ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"DomainObjectMatch",
"<",
"T",
">",
"createMatchFrom",
"(",
"DomainObjectMatch",
"<",
"T",
">",
"domainObjectMatch",
")",
"{",
"DomainObjectMatch",
"<",
"T",
">",
"ret",
";",
"FromPre... | Create a match from a DomainObjectMatch specified in the context of another query
@param domainObjectMatch a match specified in the context of another query
@return a DomainObjectMatch | [
"Create",
"a",
"match",
"from",
"a",
"DomainObjectMatch",
"specified",
"in",
"the",
"context",
"of",
"another",
"query"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L92-L120 |
101,797 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.createMatchFor | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> createMatchFor(T domainObject) {
DomainObjectMatch<T> ret;
if (domainObject.getClass().equals(DomainObject.class)) { // generic model
List<DomainObject> source = new ArrayList<DomainObject>();
source.add((DomainObject) domainObject);
String ty... | java | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> createMatchFor(T domainObject) {
DomainObjectMatch<T> ret;
if (domainObject.getClass().equals(DomainObject.class)) { // generic model
List<DomainObject> source = new ArrayList<DomainObject>();
source.add((DomainObject) domainObject);
String ty... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"DomainObjectMatch",
"<",
"T",
">",
"createMatchFor",
"(",
"T",
"domainObject",
")",
"{",
"DomainObjectMatch",
"<",
"T",
">",
"ret",
";",
"if",
"(",
"domainObject",
".",
"getClass",... | Create a match for a domain object which was retrieved by another query
@param domainObject a domain object which was retrieved by another query
@return a DomainObjectMatch | [
"Create",
"a",
"match",
"for",
"a",
"domain",
"object",
"which",
"was",
"retrieved",
"by",
"another",
"query"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L127-L145 |
101,798 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.BR_OPEN | public TerminalResult BR_OPEN() {
ConcatenateExpression ce = new ConcatenateExpression(Concatenator.BR_OPEN);
this.astObjectsContainer.addAstObject(ce);
TerminalResult ret = APIAccess.createTerminalResult(ce);
QueryRecorder.recordInvocation(this, "BR_OPEN", ret);
return ret;
} | java | public TerminalResult BR_OPEN() {
ConcatenateExpression ce = new ConcatenateExpression(Concatenator.BR_OPEN);
this.astObjectsContainer.addAstObject(ce);
TerminalResult ret = APIAccess.createTerminalResult(ce);
QueryRecorder.recordInvocation(this, "BR_OPEN", ret);
return ret;
} | [
"public",
"TerminalResult",
"BR_OPEN",
"(",
")",
"{",
"ConcatenateExpression",
"ce",
"=",
"new",
"ConcatenateExpression",
"(",
"Concatenator",
".",
"BR_OPEN",
")",
";",
"this",
".",
"astObjectsContainer",
".",
"addAstObject",
"(",
"ce",
")",
";",
"TerminalResult",... | Open a block, encapsulating predicate expressions | [
"Open",
"a",
"block",
"encapsulating",
"predicate",
"expressions"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L244-L250 |
101,799 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.ORDER | public Order ORDER(DomainObjectMatch<?> toOrder) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(toOrder);
DomainObjectMatch<?> match = delegate != null ? delegate : toOrder;
OrderExpression oe = this.queryExecutor.getOrderFor(match);
Order ret = APIAccess.createOrder(oe);
QueryRecorder.recordInvocati... | java | public Order ORDER(DomainObjectMatch<?> toOrder) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(toOrder);
DomainObjectMatch<?> match = delegate != null ? delegate : toOrder;
OrderExpression oe = this.queryExecutor.getOrderFor(match);
Order ret = APIAccess.createOrder(oe);
QueryRecorder.recordInvocati... | [
"public",
"Order",
"ORDER",
"(",
"DomainObjectMatch",
"<",
"?",
">",
"toOrder",
")",
"{",
"DomainObjectMatch",
"<",
"?",
">",
"delegate",
"=",
"APIAccess",
".",
"getDelegate",
"(",
"toOrder",
")",
";",
"DomainObjectMatch",
"<",
"?",
">",
"match",
"=",
"del... | Define an order on a set of domain objects which are specified by
a DomainObjectMatch in the context of the domain query.
@param toOrder the DomainObjectMatch
specifying the set of domain objects which should be ordered
@return | [
"Define",
"an",
"order",
"on",
"a",
"set",
"of",
"domain",
"objects",
"which",
"are",
"specified",
"by",
"a",
"DomainObjectMatch",
"in",
"the",
"context",
"of",
"the",
"domain",
"query",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L270-L277 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.