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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java | OIndexFullText.indexDocument | public void indexDocument(final ODocument iDocument) {
modificationLock.requestModificationLock();
try {
Object fieldValue;
for (final String fieldName : iDocument.fieldNames()) {
fieldValue = iDocument.field(fieldName);
put(fieldValue, iDocument);
}
acquire... | java | public void indexDocument(final ODocument iDocument) {
modificationLock.requestModificationLock();
try {
Object fieldValue;
for (final String fieldName : iDocument.fieldNames()) {
fieldValue = iDocument.field(fieldName);
put(fieldValue, iDocument);
}
acquire... | [
"public",
"void",
"indexDocument",
"(",
"final",
"ODocument",
"iDocument",
")",
"{",
"modificationLock",
".",
"requestModificationLock",
"(",
")",
";",
"try",
"{",
"Object",
"fieldValue",
";",
"for",
"(",
"final",
"String",
"fieldName",
":",
"iDocument",
".",
... | Index an entire document field by field and save the index at the end.
@param iDocument
The document to index | [
"Index",
"an",
"entire",
"document",
"field",
"by",
"field",
"and",
"save",
"the",
"index",
"at",
"the",
"end",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java#L63-L85 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java | OIndexFullText.put | @Override
public OIndexFullText put(final Object iKey, final OIdentifiable iSingleValue) {
if (iKey == null)
return this;
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
// FOREACH WORD CREATE THE LINK TO THE CURR... | java | @Override
public OIndexFullText put(final Object iKey, final OIdentifiable iSingleValue) {
if (iKey == null)
return this;
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
// FOREACH WORD CREATE THE LINK TO THE CURR... | [
"@",
"Override",
"public",
"OIndexFullText",
"put",
"(",
"final",
"Object",
"iKey",
",",
"final",
"OIdentifiable",
"iSingleValue",
")",
"{",
"if",
"(",
"iKey",
"==",
"null",
")",
"return",
"this",
";",
"modificationLock",
".",
"requestModificationLock",
"(",
"... | Indexes a value and save the index. Splits the value in single words and index each one. Save of the index is responsibility of
the caller. | [
"Indexes",
"a",
"value",
"and",
"save",
"the",
"index",
".",
"Splits",
"the",
"value",
"in",
"single",
"words",
"and",
"index",
"each",
"one",
".",
"Save",
"of",
"the",
"index",
"is",
"responsibility",
"of",
"the",
"caller",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java#L91-L129 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java | OIndexFullText.remove | @Override
public boolean remove(final Object iKey, final OIdentifiable value) {
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
boolean removed = false;
for (final String word : words) {
acquireExclusiveLock()... | java | @Override
public boolean remove(final Object iKey, final OIdentifiable value) {
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
boolean removed = false;
for (final String word : words) {
acquireExclusiveLock()... | [
"@",
"Override",
"public",
"boolean",
"remove",
"(",
"final",
"Object",
"iKey",
",",
"final",
"OIdentifiable",
"value",
")",
"{",
"modificationLock",
".",
"requestModificationLock",
"(",
")",
";",
"try",
"{",
"final",
"List",
"<",
"String",
">",
"words",
"="... | Splits passed in key on several words and remove records with keys equals to any item of split result and values equals to
passed in value.
@param iKey
Key to remove.
@param value
Value to remove.
@return <code>true</code> if at least one record is removed. | [
"Splits",
"passed",
"in",
"key",
"on",
"several",
"words",
"and",
"remove",
"records",
"with",
"keys",
"equals",
"to",
"any",
"item",
"of",
"split",
"result",
"and",
"values",
"equals",
"to",
"passed",
"in",
"value",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java#L141-L173 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionRealAbstract.java | OTransactionRealAbstract.getRecordEntriesByClass | public List<ORecordOperation> getRecordEntriesByClass(final String iClassName) {
final List<ORecordOperation> result = new ArrayList<ORecordOperation>();
if (iClassName == null || iClassName.length() == 0)
// RETURN ALL THE RECORDS
for (ORecordOperation entry : recordEntries.values()) {
... | java | public List<ORecordOperation> getRecordEntriesByClass(final String iClassName) {
final List<ORecordOperation> result = new ArrayList<ORecordOperation>();
if (iClassName == null || iClassName.length() == 0)
// RETURN ALL THE RECORDS
for (ORecordOperation entry : recordEntries.values()) {
... | [
"public",
"List",
"<",
"ORecordOperation",
">",
"getRecordEntriesByClass",
"(",
"final",
"String",
"iClassName",
")",
"{",
"final",
"List",
"<",
"ORecordOperation",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"ORecordOperation",
">",
"(",
")",
";",
"if",
"(",... | Called by class iterator. | [
"Called",
"by",
"class",
"iterator",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionRealAbstract.java#L142-L159 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionRealAbstract.java | OTransactionRealAbstract.getRecordEntriesByClusterIds | public List<ORecordOperation> getRecordEntriesByClusterIds(final int[] iIds) {
final List<ORecordOperation> result = new ArrayList<ORecordOperation>();
if (iIds == null)
// RETURN ALL THE RECORDS
for (ORecordOperation entry : recordEntries.values()) {
result.add(entry);
}
... | java | public List<ORecordOperation> getRecordEntriesByClusterIds(final int[] iIds) {
final List<ORecordOperation> result = new ArrayList<ORecordOperation>();
if (iIds == null)
// RETURN ALL THE RECORDS
for (ORecordOperation entry : recordEntries.values()) {
result.add(entry);
}
... | [
"public",
"List",
"<",
"ORecordOperation",
">",
"getRecordEntriesByClusterIds",
"(",
"final",
"int",
"[",
"]",
"iIds",
")",
"{",
"final",
"List",
"<",
"ORecordOperation",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"ORecordOperation",
">",
"(",
")",
";",
"i... | Called by cluster iterator. | [
"Called",
"by",
"cluster",
"iterator",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionRealAbstract.java#L164-L184 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.getValueByBinStr | protected static int getValueByBinStr(String binaryString, boolean signed) {
Integer value = Integer.parseInt(binaryString, 2);
if (signed && binaryString.charAt(0) == '1') {
char[] invert = new char[binaryString.length()];
Arrays.fill(invert, '1');
value ^= Integer.parseInt(new String(invert), 2);
val... | java | protected static int getValueByBinStr(String binaryString, boolean signed) {
Integer value = Integer.parseInt(binaryString, 2);
if (signed && binaryString.charAt(0) == '1') {
char[] invert = new char[binaryString.length()];
Arrays.fill(invert, '1');
value ^= Integer.parseInt(new String(invert), 2);
val... | [
"protected",
"static",
"int",
"getValueByBinStr",
"(",
"String",
"binaryString",
",",
"boolean",
"signed",
")",
"{",
"Integer",
"value",
"=",
"Integer",
".",
"parseInt",
"(",
"binaryString",
",",
"2",
")",
";",
"if",
"(",
"signed",
"&&",
"binaryString",
".",... | Get a value for specified bits from the binary string.
@param fromBit
@param toBit
@return
@throws AisParseException | [
"Get",
"a",
"value",
"for",
"specified",
"bits",
"from",
"the",
"binary",
"string",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L30-L42 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.ascii8To6bitBin | @VisibleForTesting
static byte[] ascii8To6bitBin(byte[] toDecBytes) {
byte[] convertedBytes = new byte[toDecBytes.length];
int sum = 0;
int _6bitBin = 0;
for (int i = 0; i < toDecBytes.length; i++) {
sum = 0;
_6bitBin = 0;
if (toDecBytes[i] < 48) {
throw new AisParseException(AisParseException.... | java | @VisibleForTesting
static byte[] ascii8To6bitBin(byte[] toDecBytes) {
byte[] convertedBytes = new byte[toDecBytes.length];
int sum = 0;
int _6bitBin = 0;
for (int i = 0; i < toDecBytes.length; i++) {
sum = 0;
_6bitBin = 0;
if (toDecBytes[i] < 48) {
throw new AisParseException(AisParseException.... | [
"@",
"VisibleForTesting",
"static",
"byte",
"[",
"]",
"ascii8To6bitBin",
"(",
"byte",
"[",
"]",
"toDecBytes",
")",
"{",
"byte",
"[",
"]",
"convertedBytes",
"=",
"new",
"byte",
"[",
"toDecBytes",
".",
"length",
"]",
";",
"int",
"sum",
"=",
"0",
";",
"in... | Returns conversion of ASCII-coded character to 6-bit binary byte array.
@param toDecBytes
@return decodedBytes | [
"Returns",
"conversion",
"of",
"ASCII",
"-",
"coded",
"character",
"to",
"6",
"-",
"bit",
"binary",
"byte",
"array",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L65-L108 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.getDecodedStr | private static String getDecodedStr(byte[] decBytes) {
// prepare StringBuilder with capacity being the smallest power of 2
// greater than decBytes.length*6
int n = decBytes.length * 6;
int capacity = leastPowerOf2GreaterThanOrEqualTo(n);
StringBuilder decStr = new StringBuilder(capacity);
for (int i = 0... | java | private static String getDecodedStr(byte[] decBytes) {
// prepare StringBuilder with capacity being the smallest power of 2
// greater than decBytes.length*6
int n = decBytes.length * 6;
int capacity = leastPowerOf2GreaterThanOrEqualTo(n);
StringBuilder decStr = new StringBuilder(capacity);
for (int i = 0... | [
"private",
"static",
"String",
"getDecodedStr",
"(",
"byte",
"[",
"]",
"decBytes",
")",
"{",
"// prepare StringBuilder with capacity being the smallest power of 2",
"// greater than decBytes.length*6",
"int",
"n",
"=",
"decBytes",
".",
"length",
"*",
"6",
";",
"int",
"c... | Get decoded string from bytes.
@param decBytes | [
"Get",
"decoded",
"string",
"from",
"bytes",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L115-L139 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.getAsciiStringFrom6BitStr | protected static String getAsciiStringFrom6BitStr(String str) {
StringBuilder txt = new StringBuilder();
for (int i = 0; i < str.length(); i = i + 6) {
byte _byte = (byte) Integer.parseInt(str.substring(i, i + 6), 2);
_byte = convert6BitCharToStandardAscii(_byte);
char convChar = (char) _byte;
if (con... | java | protected static String getAsciiStringFrom6BitStr(String str) {
StringBuilder txt = new StringBuilder();
for (int i = 0; i < str.length(); i = i + 6) {
byte _byte = (byte) Integer.parseInt(str.substring(i, i + 6), 2);
_byte = convert6BitCharToStandardAscii(_byte);
char convChar = (char) _byte;
if (con... | [
"protected",
"static",
"String",
"getAsciiStringFrom6BitStr",
"(",
"String",
"str",
")",
"{",
"StringBuilder",
"txt",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",... | Decode 6 bit String to standard ASCII String
Input is a binary string of 0 and 1 each 6 bit is a character that will
be converted to the standard ASCII character
@param str
@return | [
"Decode",
"6",
"bit",
"String",
"to",
"standard",
"ASCII",
"String"
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L154-L169 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.convert6BitCharToStandardAscii | @VisibleForTesting
static byte convert6BitCharToStandardAscii(byte byteToConvert) {
byte b = 0;
if (byteToConvert < 32) {
b = (byte) (byteToConvert + 64);
} else if (byteToConvert < 63) {
b = byteToConvert;
}
return b;
} | java | @VisibleForTesting
static byte convert6BitCharToStandardAscii(byte byteToConvert) {
byte b = 0;
if (byteToConvert < 32) {
b = (byte) (byteToConvert + 64);
} else if (byteToConvert < 63) {
b = byteToConvert;
}
return b;
} | [
"@",
"VisibleForTesting",
"static",
"byte",
"convert6BitCharToStandardAscii",
"(",
"byte",
"byteToConvert",
")",
"{",
"byte",
"b",
"=",
"0",
";",
"if",
"(",
"byteToConvert",
"<",
"32",
")",
"{",
"b",
"=",
"(",
"byte",
")",
"(",
"byteToConvert",
"+",
"64",
... | Convert one 6 bit ASCII character to 8 bit ASCII character
@param byteToConvert
@return | [
"Convert",
"one",
"6",
"bit",
"ASCII",
"character",
"to",
"8",
"bit",
"ASCII",
"character"
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L177-L188 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.checkLatLong | public static void checkLatLong(double lat, double lon) {
checkArgument(lon <= 181.0, "longitude out of range " + lon);
checkArgument(lon > -180.0, "longitude out of range " + lon);
checkArgument(lat <= 91.0, "latitude out of range " + lat);
checkArgument(lat > -90.0, "latitude out of range " + lat);
} | java | public static void checkLatLong(double lat, double lon) {
checkArgument(lon <= 181.0, "longitude out of range " + lon);
checkArgument(lon > -180.0, "longitude out of range " + lon);
checkArgument(lat <= 91.0, "latitude out of range " + lat);
checkArgument(lat > -90.0, "latitude out of range " + lat);
} | [
"public",
"static",
"void",
"checkLatLong",
"(",
"double",
"lat",
",",
"double",
"lon",
")",
"{",
"checkArgument",
"(",
"lon",
"<=",
"181.0",
",",
"\"longitude out of range \"",
"+",
"lon",
")",
";",
"checkArgument",
"(",
"lon",
">",
"-",
"180.0",
",",
"\"... | Check lat lon are withing allowable range as per 1371-4.pdf. Note that
values of long=181, lat=91 have special meaning.
@param lat
@param lon | [
"Check",
"lat",
"lon",
"are",
"withing",
"allowable",
"range",
"as",
"per",
"1371",
"-",
"4",
".",
"pdf",
".",
"Note",
"that",
"values",
"of",
"long",
"=",
"181",
"lat",
"=",
"91",
"have",
"special",
"meaning",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L197-L202 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.checkMessageId | public static void checkMessageId(int messageId, AisMessageType... messageTypes) {
boolean found = false;
for (AisMessageType messageType : messageTypes) {
if (messageType.getId() == messageId)
found = true;
}
if (!found) {
StringBuffer s = new StringBuffer();
for (AisMessageType messageType : mess... | java | public static void checkMessageId(int messageId, AisMessageType... messageTypes) {
boolean found = false;
for (AisMessageType messageType : messageTypes) {
if (messageType.getId() == messageId)
found = true;
}
if (!found) {
StringBuffer s = new StringBuffer();
for (AisMessageType messageType : mess... | [
"public",
"static",
"void",
"checkMessageId",
"(",
"int",
"messageId",
",",
"AisMessageType",
"...",
"messageTypes",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"AisMessageType",
"messageType",
":",
"messageTypes",
")",
"{",
"if",
"(",
"messag... | Check message id corresponds to one of the given list of message types.
@param messageId
@param messageTypes | [
"Check",
"message",
"id",
"corresponds",
"to",
"one",
"of",
"the",
"given",
"list",
"of",
"message",
"types",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L261-L276 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerLocator.java | OMMapManagerLocator.getInstance | public static OMMapManager getInstance() {
if (instanceRef.get() == null) {
synchronized (instanceRef) {
if (instanceRef.compareAndSet(null, createInstance())) {
instanceRef.get().init();
}
}
}
return instanceRef.get();
} | java | public static OMMapManager getInstance() {
if (instanceRef.get() == null) {
synchronized (instanceRef) {
if (instanceRef.compareAndSet(null, createInstance())) {
instanceRef.get().init();
}
}
}
return instanceRef.get();
} | [
"public",
"static",
"OMMapManager",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instanceRef",
".",
"get",
"(",
")",
"==",
"null",
")",
"{",
"synchronized",
"(",
"instanceRef",
")",
"{",
"if",
"(",
"instanceRef",
".",
"compareAndSet",
"(",
"null",
",",
"cre... | This method returns instance of mmap manager.
@return mmap manager instance. If it is not exist create new one. | [
"This",
"method",
"returns",
"instance",
"of",
"mmap",
"manager",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OMMapManagerLocator.java#L39-L48 | train |
lightblue-platform/lightblue-migrator | jiff/src/main/java/jcmp/DocCompare.java | DocCompare.addArrayIdentity | public void addArrayIdentity(String array, String... identities) {
arrayIdentities.put(array, new ArrayIdentityFields(identities));
} | java | public void addArrayIdentity(String array, String... identities) {
arrayIdentities.put(array, new ArrayIdentityFields(identities));
} | [
"public",
"void",
"addArrayIdentity",
"(",
"String",
"array",
",",
"String",
"...",
"identities",
")",
"{",
"arrayIdentities",
".",
"put",
"(",
"array",
",",
"new",
"ArrayIdentityFields",
"(",
"identities",
")",
")",
";",
"}"
] | Adds a group of fields that can uniquely identify array elements for
object arrays
@param array The name of the array field
@param identities The fields of the array element that can identiy an
element
In the following document: <pre>
{
...
"aField": [
{ "_id":1,"field":...},
{ "_id":2,"field":...}
]
}
<pre>
the... | [
"Adds",
"a",
"group",
"of",
"fields",
"that",
"can",
"uniquely",
"identify",
"array",
"elements",
"for",
"object",
"arrays"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/jiff/src/main/java/jcmp/DocCompare.java#L464-L466 | train |
lightblue-platform/lightblue-migrator | jiff/src/main/java/jcmp/DocCompare.java | DocCompare.compareNodes | public Difference<BaseType> compareNodes(BaseType node1, BaseType node2)
throws InvalidArrayIdentity, DuplicateArrayIdentity {
return compareNodes(new ArrayList<String>(), node1, new ArrayList<String>(), node2);
} | java | public Difference<BaseType> compareNodes(BaseType node1, BaseType node2)
throws InvalidArrayIdentity, DuplicateArrayIdentity {
return compareNodes(new ArrayList<String>(), node1, new ArrayList<String>(), node2);
} | [
"public",
"Difference",
"<",
"BaseType",
">",
"compareNodes",
"(",
"BaseType",
"node1",
",",
"BaseType",
"node2",
")",
"throws",
"InvalidArrayIdentity",
",",
"DuplicateArrayIdentity",
"{",
"return",
"compareNodes",
"(",
"new",
"ArrayList",
"<",
"String",
">",
"(",... | Compares two documents and returns the difference | [
"Compares",
"two",
"documents",
"and",
"returns",
"the",
"difference"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/jiff/src/main/java/jcmp/DocCompare.java#L471-L474 | train |
lightblue-platform/lightblue-migrator | jiff/src/main/java/jcmp/DocCompare.java | DocCompare.compareObjects | public Difference<BaseType> compareObjects(List<String> field1,
ObjectType node1,
List<String> field2,
ObjectType node2)
throws InvalidArrayIdentity, DuplicateArrayIde... | java | public Difference<BaseType> compareObjects(List<String> field1,
ObjectType node1,
List<String> field2,
ObjectType node2)
throws InvalidArrayIdentity, DuplicateArrayIde... | [
"public",
"Difference",
"<",
"BaseType",
">",
"compareObjects",
"(",
"List",
"<",
"String",
">",
"field1",
",",
"ObjectType",
"node1",
",",
"List",
"<",
"String",
">",
"field2",
",",
"ObjectType",
"node2",
")",
"throws",
"InvalidArrayIdentity",
",",
"Duplicate... | Compares two object nodes recursively and returns the differences | [
"Compares",
"two",
"object",
"nodes",
"recursively",
"and",
"returns",
"the",
"differences"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/jiff/src/main/java/jcmp/DocCompare.java#L498-L534 | train |
lightblue-platform/lightblue-migrator | jiff/src/main/java/jcmp/DocCompare.java | DocCompare.compareArraysWithId | public Difference<BaseType> compareArraysWithId(List<String> field1,
ArrayType node1,
List<String> field2,
ArrayType node2,
... | java | public Difference<BaseType> compareArraysWithId(List<String> field1,
ArrayType node1,
List<String> field2,
ArrayType node2,
... | [
"public",
"Difference",
"<",
"BaseType",
">",
"compareArraysWithId",
"(",
"List",
"<",
"String",
">",
"field1",
",",
"ArrayType",
"node1",
",",
"List",
"<",
"String",
">",
"field2",
",",
"ArrayType",
"node2",
",",
"IdentityExtractor",
"idex",
")",
"throws",
... | Computes difference between arrays whose elements can be identitied by a
unique identifier | [
"Computes",
"difference",
"between",
"arrays",
"whose",
"elements",
"can",
"be",
"identitied",
"by",
"a",
"unique",
"identifier"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/jiff/src/main/java/jcmp/DocCompare.java#L585-L629 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java | OPropertyImpl.dropIndexes | @Deprecated
public OPropertyImpl dropIndexes() {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_DELETE);
final OIndexManager indexManager = getDatabase().getMetadata().getIndexManager();
final ArrayList<OIndex<?>> relatedIndexes = new ArrayList<OIndex<?>>();
f... | java | @Deprecated
public OPropertyImpl dropIndexes() {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_DELETE);
final OIndexManager indexManager = getDatabase().getMetadata().getIndexManager();
final ArrayList<OIndex<?>> relatedIndexes = new ArrayList<OIndex<?>>();
f... | [
"@",
"Deprecated",
"public",
"OPropertyImpl",
"dropIndexes",
"(",
")",
"{",
"getDatabase",
"(",
")",
".",
"checkSecurity",
"(",
"ODatabaseSecurityResources",
".",
"SCHEMA",
",",
"ORole",
".",
"PERMISSION_DELETE",
")",
";",
"final",
"OIndexManager",
"indexManager",
... | Remove the index on property
@deprecated Use {@link OIndexManager#dropIndex(String)} instead. | [
"Remove",
"the",
"index",
"on",
"property"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java#L144-L169 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java | OPropertyImpl.getIndex | @Deprecated
public OIndex<?> getIndex() {
Set<OIndex<?>> indexes = owner.getInvolvedIndexes(name);
if (indexes != null && !indexes.isEmpty())
return indexes.iterator().next();
return null;
} | java | @Deprecated
public OIndex<?> getIndex() {
Set<OIndex<?>> indexes = owner.getInvolvedIndexes(name);
if (indexes != null && !indexes.isEmpty())
return indexes.iterator().next();
return null;
} | [
"@",
"Deprecated",
"public",
"OIndex",
"<",
"?",
">",
"getIndex",
"(",
")",
"{",
"Set",
"<",
"OIndex",
"<",
"?",
">",
">",
"indexes",
"=",
"owner",
".",
"getInvolvedIndexes",
"(",
"name",
")",
";",
"if",
"(",
"indexes",
"!=",
"null",
"&&",
"!",
"in... | Returns the first index defined for the property.
@deprecated Use {@link OClass#getInvolvedIndexes(String...)} instead. | [
"Returns",
"the",
"first",
"index",
"defined",
"for",
"the",
"property",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java#L186-L192 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java | OPropertyImpl.getLinkedClass | public OClass getLinkedClass() {
if (linkedClass == null && linkedClassName != null)
linkedClass = owner.owner.getClass(linkedClassName);
return linkedClass;
} | java | public OClass getLinkedClass() {
if (linkedClass == null && linkedClassName != null)
linkedClass = owner.owner.getClass(linkedClassName);
return linkedClass;
} | [
"public",
"OClass",
"getLinkedClass",
"(",
")",
"{",
"if",
"(",
"linkedClass",
"==",
"null",
"&&",
"linkedClassName",
"!=",
"null",
")",
"linkedClass",
"=",
"owner",
".",
"owner",
".",
"getClass",
"(",
"linkedClassName",
")",
";",
"return",
"linkedClass",
";... | Returns the linked class in lazy mode because while unmarshalling the class could be not loaded yet.
@return | [
"Returns",
"the",
"linked",
"class",
"in",
"lazy",
"mode",
"because",
"while",
"unmarshalling",
"the",
"class",
"could",
"be",
"not",
"loaded",
"yet",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java#L234-L238 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java | OPropertyImpl.setTypeInternal | public void setTypeInternal(final OType iType) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
if (iType == type)
// NO CHANGES
return;
boolean ok = false;
switch (type) {
case LINKLIST:
ok = iType == OType.LINKSET;
break;... | java | public void setTypeInternal(final OType iType) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
if (iType == type)
// NO CHANGES
return;
boolean ok = false;
switch (type) {
case LINKLIST:
ok = iType == OType.LINKSET;
break;... | [
"public",
"void",
"setTypeInternal",
"(",
"final",
"OType",
"iType",
")",
"{",
"getDatabase",
"(",
")",
".",
"checkSecurity",
"(",
"ODatabaseSecurityResources",
".",
"SCHEMA",
",",
"ORole",
".",
"PERMISSION_UPDATE",
")",
";",
"if",
"(",
"iType",
"==",
"type",
... | Change the type. It checks for compatibility between the change of type.
@param iType | [
"Change",
"the",
"type",
".",
"It",
"checks",
"for",
"compatibility",
"between",
"the",
"change",
"of",
"type",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OPropertyImpl.java#L401-L422 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.putAll | @Override
public void putAll(final Map<? extends K, ? extends V> map) {
int mapSize = map.size();
if (size() == 0 && mapSize != 0 && map instanceof SortedMap) {
Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator();
if (c == comparator || (c != null && c.equals(comparator... | java | @Override
public void putAll(final Map<? extends K, ? extends V> map) {
int mapSize = map.size();
if (size() == 0 && mapSize != 0 && map instanceof SortedMap) {
Comparator<?> c = ((SortedMap<? extends K, ? extends V>) map).comparator();
if (c == comparator || (c != null && c.equals(comparator... | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"final",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"map",
")",
"{",
"int",
"mapSize",
"=",
"map",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"(",
")",
"==",
"0",
"&&",
... | Copies all of the mappings from the specified map to this map. These mappings replace any mappings that this map had for any of
the keys currently in the specified map.
@param map
mappings to be stored in this map
@throws ClassCastException
if the class of a key or value in the specified map prevents it from being sto... | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"map",
".",
"These",
"mappings",
"replace",
"any",
"mappings",
"that",
"this",
"map",
"had",
"for",
"any",
"of",
"the",
"keys",
"currently",
"in",
"the",
"specified"... | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L316-L332 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.remove | @Override
public V remove(final Object key) {
OMVRBTreeEntry<K, V> p = getEntry(key, PartialSearchMode.NONE);
setLastSearchNode(null, null);
if (p == null)
return null;
V oldValue = p.getValue();
deleteEntry(p);
return oldValue;
} | java | @Override
public V remove(final Object key) {
OMVRBTreeEntry<K, V> p = getEntry(key, PartialSearchMode.NONE);
setLastSearchNode(null, null);
if (p == null)
return null;
V oldValue = p.getValue();
deleteEntry(p);
return oldValue;
} | [
"@",
"Override",
"public",
"V",
"remove",
"(",
"final",
"Object",
"key",
")",
"{",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"p",
"=",
"getEntry",
"(",
"key",
",",
"PartialSearchMode",
".",
"NONE",
")",
";",
"setLastSearchNode",
"(",
"null",
",",
"nul... | Removes the mapping for this key from this OMVRBTree if present.
@param key
key for which mapping should be removed
@return the previous value associated with <tt>key</tt>, or <tt>null</tt> if there was no mapping for <tt>key</tt>. (A
<tt>null</tt> return can also indicate that the map previously associated <tt>null</... | [
"Removes",
"the",
"mapping",
"for",
"this",
"key",
"from",
"this",
"OMVRBTree",
"if",
"present",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L838-L848 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.next | public static <K, V> OMVRBTreeEntry<K, V> next(final OMVRBTreeEntry<K, V> t) {
if (t == null)
return null;
final OMVRBTreeEntry<K, V> succ;
if (t.tree.pageIndex < t.getSize() - 1) {
// ITERATE INSIDE THE NODE
succ = t;
t.tree.pageIndex++;
} else {
// GET THE NEXT... | java | public static <K, V> OMVRBTreeEntry<K, V> next(final OMVRBTreeEntry<K, V> t) {
if (t == null)
return null;
final OMVRBTreeEntry<K, V> succ;
if (t.tree.pageIndex < t.getSize() - 1) {
// ITERATE INSIDE THE NODE
succ = t;
t.tree.pageIndex++;
} else {
// GET THE NEXT... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"next",
"(",
"final",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"return",
"null",
";",
"final",
"OMVRBTreeE... | Returns the next item of the tree. | [
"Returns",
"the",
"next",
"item",
"of",
"the",
"tree",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2246-L2262 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.previous | public static <K, V> OMVRBTreeEntry<K, V> previous(final OMVRBTreeEntry<K, V> t) {
if (t == null)
return null;
final int index = t.getTree().getPageIndex();
final OMVRBTreeEntry<K, V> prev;
if (index <= 0) {
prev = predecessor(t);
if (prev != null)
t.tree.pageIndex ... | java | public static <K, V> OMVRBTreeEntry<K, V> previous(final OMVRBTreeEntry<K, V> t) {
if (t == null)
return null;
final int index = t.getTree().getPageIndex();
final OMVRBTreeEntry<K, V> prev;
if (index <= 0) {
prev = predecessor(t);
if (prev != null)
t.tree.pageIndex ... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"previous",
"(",
"final",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"return",
"null",
";",
"final",
"int",
... | Returns the previous item of the tree. | [
"Returns",
"the",
"previous",
"item",
"of",
"the",
"tree",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2299-L2318 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.deleteEntry | OMVRBTreeEntry<K, V> deleteEntry(OMVRBTreeEntry<K, V> p) {
setSizeDelta(-1);
modCount++;
if (pageIndex > -1) {
// DELETE INSIDE THE NODE
p.remove();
if (p.getSize() > 0)
return p;
}
final OMVRBTreeEntry<K, V> next = successor(p);
// DELETE THE ENTIRE NODE,... | java | OMVRBTreeEntry<K, V> deleteEntry(OMVRBTreeEntry<K, V> p) {
setSizeDelta(-1);
modCount++;
if (pageIndex > -1) {
// DELETE INSIDE THE NODE
p.remove();
if (p.getSize() > 0)
return p;
}
final OMVRBTreeEntry<K, V> next = successor(p);
// DELETE THE ENTIRE NODE,... | [
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"deleteEntry",
"(",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"p",
")",
"{",
"setSizeDelta",
"(",
"-",
"1",
")",
";",
"modCount",
"++",
";",
"if",
"(",
"pageIndex",
">",
"-",
"1",
")",
"{",
"// DELETE INS... | Delete node p, and then re-balance the tree.
@param p
node to delete
@return | [
"Delete",
"node",
"p",
"and",
"then",
"re",
"-",
"balance",
"the",
"tree",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2454-L2471 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.removeNode | protected OMVRBTreeEntry<K, V> removeNode(OMVRBTreeEntry<K, V> p) {
modCount++;
// If strictly internal, copy successor's element to p and then make p
// point to successor.
if (p.getLeft() != null && p.getRight() != null) {
OMVRBTreeEntry<K, V> s = next(p);
p.copyFrom(s);
p = s... | java | protected OMVRBTreeEntry<K, V> removeNode(OMVRBTreeEntry<K, V> p) {
modCount++;
// If strictly internal, copy successor's element to p and then make p
// point to successor.
if (p.getLeft() != null && p.getRight() != null) {
OMVRBTreeEntry<K, V> s = next(p);
p.copyFrom(s);
p = s... | [
"protected",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"removeNode",
"(",
"OMVRBTreeEntry",
"<",
"K",
",",
"V",
">",
"p",
")",
"{",
"modCount",
"++",
";",
"// If strictly internal, copy successor's element to p and then make p\r",
"// point to successor.\r",
"if",
"(... | Remove a node from the tree.
@param p
Node to remove
@return Node that was removed. Passed and removed nodes may be different in case node to remove contains two children. In this
case node successor will be found and removed but it's content will be copied to the node that was passed in method. | [
"Remove",
"a",
"node",
"from",
"the",
"tree",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2482-L2529 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.readOTreeSet | void readOTreeSet(int iSize, ObjectInputStream s, V defaultVal) throws java.io.IOException, ClassNotFoundException {
buildFromSorted(iSize, null, s, defaultVal);
} | java | void readOTreeSet(int iSize, ObjectInputStream s, V defaultVal) throws java.io.IOException, ClassNotFoundException {
buildFromSorted(iSize, null, s, defaultVal);
} | [
"void",
"readOTreeSet",
"(",
"int",
"iSize",
",",
"ObjectInputStream",
"s",
",",
"V",
"defaultVal",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"ClassNotFoundException",
"{",
"buildFromSorted",
"(",
"iSize",
",",
"null",
",",
"s",
",",
"defaul... | Intended to be called only from OTreeSet.readObject | [
"Intended",
"to",
"be",
"called",
"only",
"from",
"OTreeSet",
".",
"readObject"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2629-L2631 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java | OMVRBTree.addAllForOTreeSet | void addAllForOTreeSet(SortedSet<? extends K> set, V defaultVal) {
try {
buildFromSorted(set.size(), set.iterator(), null, defaultVal);
} catch (java.io.IOException cannotHappen) {
} catch (ClassNotFoundException cannotHappen) {
}
} | java | void addAllForOTreeSet(SortedSet<? extends K> set, V defaultVal) {
try {
buildFromSorted(set.size(), set.iterator(), null, defaultVal);
} catch (java.io.IOException cannotHappen) {
} catch (ClassNotFoundException cannotHappen) {
}
} | [
"void",
"addAllForOTreeSet",
"(",
"SortedSet",
"<",
"?",
"extends",
"K",
">",
"set",
",",
"V",
"defaultVal",
")",
"{",
"try",
"{",
"buildFromSorted",
"(",
"set",
".",
"size",
"(",
")",
",",
"set",
".",
"iterator",
"(",
")",
",",
"null",
",",
"default... | Intended to be called only from OTreeSet.addAll | [
"Intended",
"to",
"be",
"called",
"only",
"from",
"OTreeSet",
".",
"addAll"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTree.java#L2634-L2640 | train |
amsa-code/risky | formats/src/main/java/au/gov/amsa/risky/format/BinaryFixesOnSubscribeWithBackp.java | BinaryFixesOnSubscribeWithBackp.from | public static Observable<Fix> from(final File file, BinaryFixesFormat format) {
Func0<InputStream> resourceFactory = new Func0<InputStream>() {
@Override
public InputStream call() {
try {
if (file.getName().endsWith(".gz"))
re... | java | public static Observable<Fix> from(final File file, BinaryFixesFormat format) {
Func0<InputStream> resourceFactory = new Func0<InputStream>() {
@Override
public InputStream call() {
try {
if (file.getName().endsWith(".gz"))
re... | [
"public",
"static",
"Observable",
"<",
"Fix",
">",
"from",
"(",
"final",
"File",
"file",
",",
"BinaryFixesFormat",
"format",
")",
"{",
"Func0",
"<",
"InputStream",
">",
"resourceFactory",
"=",
"new",
"Func0",
"<",
"InputStream",
">",
"(",
")",
"{",
"@",
... | Returns stream of fixes from the given file. If the file name ends in
'.gz' then the file is unzipped before being read.
@param file
@return fixes stream | [
"Returns",
"stream",
"of",
"fixes",
"from",
"the",
"given",
"file",
".",
"If",
"the",
"file",
"name",
"ends",
"in",
".",
"gz",
"then",
"the",
"file",
"is",
"unzipped",
"before",
"being",
"read",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/formats/src/main/java/au/gov/amsa/risky/format/BinaryFixesOnSubscribeWithBackp.java#L56-L101 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java | OBaseParser.parserOptionalWord | protected String parserOptionalWord(final boolean iUpperCase) {
previousPos = currentPos;
parserNextWord(iUpperCase);
if (parserLastWord.length() == 0)
return null;
return parserLastWord.toString();
} | java | protected String parserOptionalWord(final boolean iUpperCase) {
previousPos = currentPos;
parserNextWord(iUpperCase);
if (parserLastWord.length() == 0)
return null;
return parserLastWord.toString();
} | [
"protected",
"String",
"parserOptionalWord",
"(",
"final",
"boolean",
"iUpperCase",
")",
"{",
"previousPos",
"=",
"currentPos",
";",
"parserNextWord",
"(",
"iUpperCase",
")",
";",
"if",
"(",
"parserLastWord",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
... | Parses the next word. It returns the word parsed if any.
@param iUpperCase
True if must return UPPERCASE, otherwise false
@return The word parsed if any, otherwise null | [
"Parses",
"the",
"next",
"word",
".",
"It",
"returns",
"the",
"word",
"parsed",
"if",
"any",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java#L54-L61 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java | OBaseParser.parseOptionalWord | protected String parseOptionalWord(final boolean iUpperCase, final String... iWords) {
parserNextWord(iUpperCase);
if (iWords.length > 0) {
if (parserLastWord.length() == 0)
return null;
boolean found = false;
for (String w : iWords) {
if (parserLastWord.toString().e... | java | protected String parseOptionalWord(final boolean iUpperCase, final String... iWords) {
parserNextWord(iUpperCase);
if (iWords.length > 0) {
if (parserLastWord.length() == 0)
return null;
boolean found = false;
for (String w : iWords) {
if (parserLastWord.toString().e... | [
"protected",
"String",
"parseOptionalWord",
"(",
"final",
"boolean",
"iUpperCase",
",",
"final",
"String",
"...",
"iWords",
")",
"{",
"parserNextWord",
"(",
"iUpperCase",
")",
";",
"if",
"(",
"iWords",
".",
"length",
">",
"0",
")",
"{",
"if",
"(",
"parserL... | Parses the next word. If any word is parsed it's checked against the word array received as parameter. If the parsed word is
not enlisted in it a SyntaxError exception is thrown. It returns the word parsed if any.
@param iUpperCase
True if must return UPPERCASE, otherwise false
@return The word parsed if any, otherwis... | [
"Parses",
"the",
"next",
"word",
".",
"If",
"any",
"word",
"is",
"parsed",
"it",
"s",
"checked",
"against",
"the",
"word",
"array",
"received",
"as",
"parameter",
".",
"If",
"the",
"parsed",
"word",
"is",
"not",
"enlisted",
"in",
"it",
"a",
"SyntaxError"... | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java#L71-L91 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java | OBaseParser.parserRequiredWord | protected String parserRequiredWord(final boolean iUpperCase, final String iCustomMessage, String iSeparators) {
if (iSeparators == null)
iSeparators = " =><(),\r\n";
parserNextWord(iUpperCase, iSeparators);
if (parserLastWord.length() == 0)
throwSyntaxErrorException(iCustomMessage);
... | java | protected String parserRequiredWord(final boolean iUpperCase, final String iCustomMessage, String iSeparators) {
if (iSeparators == null)
iSeparators = " =><(),\r\n";
parserNextWord(iUpperCase, iSeparators);
if (parserLastWord.length() == 0)
throwSyntaxErrorException(iCustomMessage);
... | [
"protected",
"String",
"parserRequiredWord",
"(",
"final",
"boolean",
"iUpperCase",
",",
"final",
"String",
"iCustomMessage",
",",
"String",
"iSeparators",
")",
"{",
"if",
"(",
"iSeparators",
"==",
"null",
")",
"iSeparators",
"=",
"\" =><(),\\r\\n\"",
";",
"parser... | Parses the next word. If no word is found or the parsed word is not present in the word array received as parameter then a
SyntaxError exception with the custom message received as parameter is thrown. It returns the word parsed if any.
@param iUpperCase
True if must return UPPERCASE, otherwise false
@param iCustomMes... | [
"Parses",
"the",
"next",
"word",
".",
"If",
"no",
"word",
"is",
"found",
"or",
"the",
"parsed",
"word",
"is",
"not",
"present",
"in",
"the",
"word",
"array",
"received",
"as",
"parameter",
"then",
"a",
"SyntaxError",
"exception",
"with",
"the",
"custom",
... | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java#L140-L148 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java | OBaseParser.parserNextWord | protected void parserNextWord(final boolean iForceUpperCase, final String iSeparatorChars) {
previousPos = currentPos;
parserLastWord.setLength(0);
parserSkipWhiteSpaces();
if (currentPos == -1)
return;
char stringBeginChar = ' ';
final String text2Use = iForceUpperCase ? text... | java | protected void parserNextWord(final boolean iForceUpperCase, final String iSeparatorChars) {
previousPos = currentPos;
parserLastWord.setLength(0);
parserSkipWhiteSpaces();
if (currentPos == -1)
return;
char stringBeginChar = ' ';
final String text2Use = iForceUpperCase ? text... | [
"protected",
"void",
"parserNextWord",
"(",
"final",
"boolean",
"iForceUpperCase",
",",
"final",
"String",
"iSeparatorChars",
")",
"{",
"previousPos",
"=",
"currentPos",
";",
"parserLastWord",
".",
"setLength",
"(",
"0",
")",
";",
"parserSkipWhiteSpaces",
"(",
")"... | Parses the next word.
@param iUpperCase
True if must return UPPERCASE, otherwise false
@param iSeparators
Separator characters | [
"Parses",
"the",
"next",
"word",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java#L259-L323 | train |
NetsOSS/embedded-jetty | src/main/java/eu/nets/oss/jetty/EmbeddedJettyBuilder.java | EmbeddedJettyBuilder.createRootContextHandler | public HandlerBuilder<ContextHandler> createRootContextHandler(String subPath) {
ContextHandler contextHandler = new ContextHandler();
HandlerBuilder<ContextHandler> e = new HandlerBuilder<>(contextHandler);
String usePath = contextPath + subPath;
setPath(contextHandler, usePath);
... | java | public HandlerBuilder<ContextHandler> createRootContextHandler(String subPath) {
ContextHandler contextHandler = new ContextHandler();
HandlerBuilder<ContextHandler> e = new HandlerBuilder<>(contextHandler);
String usePath = contextPath + subPath;
setPath(contextHandler, usePath);
... | [
"public",
"HandlerBuilder",
"<",
"ContextHandler",
">",
"createRootContextHandler",
"(",
"String",
"subPath",
")",
"{",
"ContextHandler",
"contextHandler",
"=",
"new",
"ContextHandler",
"(",
")",
";",
"HandlerBuilder",
"<",
"ContextHandler",
">",
"e",
"=",
"new",
... | Creates a HandlerBuilder that is mounted on top of the root path of this builder
@param subPath The sub-path that will be appended, starting with a slash, or just an empty string for no sub-path
@return A handler builder. This can not be used for servlets, see #createRootServletContextHandler | [
"Creates",
"a",
"HandlerBuilder",
"that",
"is",
"mounted",
"on",
"top",
"of",
"the",
"root",
"path",
"of",
"this",
"builder"
] | c2535867ad4887c4a43a8aa7f95b711ff54c8542 | https://github.com/NetsOSS/embedded-jetty/blob/c2535867ad4887c4a43a8aa7f95b711ff54c8542/src/main/java/eu/nets/oss/jetty/EmbeddedJettyBuilder.java#L247-L254 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/AisNmeaBuffer.java | AisNmeaBuffer.add | public Optional<List<NmeaMessage>> add(NmeaMessage nmea) {
// use compare-and-swap semantics instead of synchronizing to squeak a
// bit more performance out of this. Contention is expected to be low so
// this should help.
while (true) {
if (adding.compareAndSet(false, true)... | java | public Optional<List<NmeaMessage>> add(NmeaMessage nmea) {
// use compare-and-swap semantics instead of synchronizing to squeak a
// bit more performance out of this. Contention is expected to be low so
// this should help.
while (true) {
if (adding.compareAndSet(false, true)... | [
"public",
"Optional",
"<",
"List",
"<",
"NmeaMessage",
">",
">",
"add",
"(",
"NmeaMessage",
"nmea",
")",
"{",
"// use compare-and-swap semantics instead of synchronizing to squeak a",
"// bit more performance out of this. Contention is expected to be low so",
"// this should help.",
... | Returns the complete message only once the whole group of messages has
arrived otherwise returns null.
@param nmea
@return | [
"Returns",
"the",
"complete",
"message",
"only",
"once",
"the",
"whole",
"group",
"of",
"messages",
"has",
"arrived",
"otherwise",
"returns",
"null",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/AisNmeaBuffer.java#L39-L50 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java | MuleUtil.getServiceName | public static String getServiceName(MuleEventContext event) {
// Mule 2.2 implementation
// Service service = (event == null)? null : event.getService();
FlowConstruct service = (event == null)? null : event.getFlowConstruct();
String name = (service == null)? "" : service.getNam... | java | public static String getServiceName(MuleEventContext event) {
// Mule 2.2 implementation
// Service service = (event == null)? null : event.getService();
FlowConstruct service = (event == null)? null : event.getFlowConstruct();
String name = (service == null)? "" : service.getNam... | [
"public",
"static",
"String",
"getServiceName",
"(",
"MuleEventContext",
"event",
")",
"{",
"// Mule 2.2 implementation",
"// Service service = (event == null)? null : event.getService();",
"FlowConstruct",
"service",
"=",
"(",
"event",
"==",
"null",
")",
"?",
"null",
":... | Different implementations for retrieving the service name from a MuleEventContext-object in Mule 2.2.x and Mule
@param event
@return | [
"Different",
"implementations",
"for",
"retrieving",
"the",
"service",
"name",
"from",
"a",
"MuleEventContext",
"-",
"object",
"in",
"Mule",
"2",
".",
"2",
".",
"x",
"and",
"Mule"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java#L59-L65 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java | MuleUtil.getImmutableEndpoint | public static ImmutableEndpoint getImmutableEndpoint(MuleContext muleContext, String endpointName) throws IOException {
ImmutableEndpoint endpoint = null;
Object o = muleContext.getRegistry().lookupObject(endpointName);
if (o instanceof ImmutableEndpoint) {
// For Inbound and Outbound Endpoints
endpoint = ... | java | public static ImmutableEndpoint getImmutableEndpoint(MuleContext muleContext, String endpointName) throws IOException {
ImmutableEndpoint endpoint = null;
Object o = muleContext.getRegistry().lookupObject(endpointName);
if (o instanceof ImmutableEndpoint) {
// For Inbound and Outbound Endpoints
endpoint = ... | [
"public",
"static",
"ImmutableEndpoint",
"getImmutableEndpoint",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"throws",
"IOException",
"{",
"ImmutableEndpoint",
"endpoint",
"=",
"null",
";",
"Object",
"o",
"=",
"muleContext",
".",
"getRegistr... | Lookup an ImmutableEndpoint based on its name
@param muleContext
@param endpointName
@return
@throws IOException | [
"Lookup",
"an",
"ImmutableEndpoint",
"based",
"on",
"its",
"name"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MuleUtil.java#L100-L118 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntryMemory.java | OMVRBTreeEntryMemory.getNextInMemory | @Override
public OMVRBTreeEntryMemory<K, V> getNextInMemory() {
OMVRBTreeEntryMemory<K, V> t = this;
OMVRBTreeEntryMemory<K, V> p = null;
if (t.right != null) {
p = t.right;
while (p.left != null)
p = p.left;
} else {
p = t.parent;
while (p != null && t == p.right) {
t = p;
... | java | @Override
public OMVRBTreeEntryMemory<K, V> getNextInMemory() {
OMVRBTreeEntryMemory<K, V> t = this;
OMVRBTreeEntryMemory<K, V> p = null;
if (t.right != null) {
p = t.right;
while (p.left != null)
p = p.left;
} else {
p = t.parent;
while (p != null && t == p.right) {
t = p;
... | [
"@",
"Override",
"public",
"OMVRBTreeEntryMemory",
"<",
"K",
",",
"V",
">",
"getNextInMemory",
"(",
")",
"{",
"OMVRBTreeEntryMemory",
"<",
"K",
",",
"V",
">",
"t",
"=",
"this",
";",
"OMVRBTreeEntryMemory",
"<",
"K",
",",
"V",
">",
"p",
"=",
"null",
";"... | Returns the successor of the current Entry only by traversing the memory, or null if no such. | [
"Returns",
"the",
"successor",
"of",
"the",
"current",
"Entry",
"only",
"by",
"traversing",
"the",
"memory",
"or",
"null",
"if",
"no",
"such",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntryMemory.java#L129-L147 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntryMemory.java | OMVRBTreeEntryMemory.setValue | public V setValue(final V value) {
V oldValue = this.getValue();
this.values[tree.pageIndex] = value;
return oldValue;
} | java | public V setValue(final V value) {
V oldValue = this.getValue();
this.values[tree.pageIndex] = value;
return oldValue;
} | [
"public",
"V",
"setValue",
"(",
"final",
"V",
"value",
")",
"{",
"V",
"oldValue",
"=",
"this",
".",
"getValue",
"(",
")",
";",
"this",
".",
"values",
"[",
"tree",
".",
"pageIndex",
"]",
"=",
"value",
";",
"return",
"oldValue",
";",
"}"
] | Replaces the value currently associated with the key with the given value.
@return the value associated with the key before this method was called | [
"Replaces",
"the",
"value",
"currently",
"associated",
"with",
"the",
"key",
"with",
"the",
"given",
"value",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/collection/OMVRBTreeEntryMemory.java#L185-L189 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/record/ORecordLazyList.java | ORecordLazyList.convertLink2Record | private void convertLink2Record(final int iIndex) {
if (ridOnly || !autoConvertToRecord)
// PRECONDITIONS
return;
final OIdentifiable o = super.get(iIndex);
if (contentType == MULTIVALUE_CONTENT_TYPE.ALL_RECORDS && !o.getIdentity().isNew())
// ALL RECORDS AND THE OBJECT IS NOT NEW, DO NOTHING
... | java | private void convertLink2Record(final int iIndex) {
if (ridOnly || !autoConvertToRecord)
// PRECONDITIONS
return;
final OIdentifiable o = super.get(iIndex);
if (contentType == MULTIVALUE_CONTENT_TYPE.ALL_RECORDS && !o.getIdentity().isNew())
// ALL RECORDS AND THE OBJECT IS NOT NEW, DO NOTHING
... | [
"private",
"void",
"convertLink2Record",
"(",
"final",
"int",
"iIndex",
")",
"{",
"if",
"(",
"ridOnly",
"||",
"!",
"autoConvertToRecord",
")",
"// PRECONDITIONS\r",
"return",
";",
"final",
"OIdentifiable",
"o",
"=",
"super",
".",
"get",
"(",
"iIndex",
")",
"... | Convert the item requested from link to record.
@param iIndex
Position of the item to convert | [
"Convert",
"the",
"item",
"requested",
"from",
"link",
"to",
"record",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/record/ORecordLazyList.java#L328-L352 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/record/ORecordLazyList.java | ORecordLazyList.convertRecord2Link | private boolean convertRecord2Link(final int iIndex) {
if (contentType == MULTIVALUE_CONTENT_TYPE.ALL_RIDS)
// PRECONDITIONS
return true;
final Object o = super.get(iIndex);
if (o != null) {
if (o instanceof ORecord<?> && !((ORecord<?>) o).isDirty()) {
marshalling = true;
try {
... | java | private boolean convertRecord2Link(final int iIndex) {
if (contentType == MULTIVALUE_CONTENT_TYPE.ALL_RIDS)
// PRECONDITIONS
return true;
final Object o = super.get(iIndex);
if (o != null) {
if (o instanceof ORecord<?> && !((ORecord<?>) o).isDirty()) {
marshalling = true;
try {
... | [
"private",
"boolean",
"convertRecord2Link",
"(",
"final",
"int",
"iIndex",
")",
"{",
"if",
"(",
"contentType",
"==",
"MULTIVALUE_CONTENT_TYPE",
".",
"ALL_RIDS",
")",
"// PRECONDITIONS\r",
"return",
"true",
";",
"final",
"Object",
"o",
"=",
"super",
".",
"get",
... | Convert the item requested from record to link.
@param iIndex
Position of the item to convert
@return <code>true</code> if conversion was successful. | [
"Convert",
"the",
"item",
"requested",
"from",
"record",
"to",
"link",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/record/ORecordLazyList.java#L361-L385 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MiscUtil.java | MiscUtil.convertStreamToString | public static String convertStreamToString(InputStream is, String charset) {
if (is == null) return null;
StringBuilder sb = new StringBuilder();
String line;
long linecount = 0;
long size = 0;
try {
// TODO: Can this be a performance killer if many many lines or is... | java | public static String convertStreamToString(InputStream is, String charset) {
if (is == null) return null;
StringBuilder sb = new StringBuilder();
String line;
long linecount = 0;
long size = 0;
try {
// TODO: Can this be a performance killer if many many lines or is... | [
"public",
"static",
"String",
"convertStreamToString",
"(",
"InputStream",
"is",
",",
"String",
"charset",
")",
"{",
"if",
"(",
"is",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"li... | Converts an InputStream to a String.
To convert an InputStream to a String we use the BufferedReader.readLine()
method. We iterate until the BufferedReader return null which means
there's no more data to read. Each line will appended to a StringBuilder
and returned as String.
Closes the InputStream after completion o... | [
"Converts",
"an",
"InputStream",
"to",
"a",
"String",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MiscUtil.java#L88-L131 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MiscUtil.java | MiscUtil.convertResourceBundleToProperties | static Properties convertResourceBundleToProperties(ResourceBundle resource) {
Properties properties = new Properties();
Enumeration<String> keys = resource.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
properties.put(key, resource.getStrin... | java | static Properties convertResourceBundleToProperties(ResourceBundle resource) {
Properties properties = new Properties();
Enumeration<String> keys = resource.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
properties.put(key, resource.getStrin... | [
"static",
"Properties",
"convertResourceBundleToProperties",
"(",
"ResourceBundle",
"resource",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"Enumeration",
"<",
"String",
">",
"keys",
"=",
"resource",
".",
"getKeys",
"(",
")",
"... | Convert ResourceBundle into a Properties object.
@param resource a resource bundle to convert.
@return Properties a properties version of the resource bundle. | [
"Convert",
"ResourceBundle",
"into",
"a",
"Properties",
"object",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/util/MiscUtil.java#L294-L304 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java | OConsoleApplication.getConsoleMethods | protected Map<Method, Object> getConsoleMethods() {
// search for declared command collections
final Iterator<OConsoleCommandCollection> ite = ServiceRegistry.lookupProviders(OConsoleCommandCollection.class);
final Collection<Object> candidates = new ArrayList<Object>();
candidates.add(this);
... | java | protected Map<Method, Object> getConsoleMethods() {
// search for declared command collections
final Iterator<OConsoleCommandCollection> ite = ServiceRegistry.lookupProviders(OConsoleCommandCollection.class);
final Collection<Object> candidates = new ArrayList<Object>();
candidates.add(this);
... | [
"protected",
"Map",
"<",
"Method",
",",
"Object",
">",
"getConsoleMethods",
"(",
")",
"{",
"// search for declared command collections\r",
"final",
"Iterator",
"<",
"OConsoleCommandCollection",
">",
"ite",
"=",
"ServiceRegistry",
".",
"lookupProviders",
"(",
"OConsoleCo... | Returns a map of all console method and the object they can be called on.
@return Map<Method,Object> | [
"Returns",
"a",
"map",
"of",
"all",
"console",
"method",
"and",
"the",
"object",
"they",
"can",
"be",
"called",
"on",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/console/OConsoleApplication.java#L310-L349 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java | FtpUtil.listFilesInDirectory | static public List<String> listFilesInDirectory(MuleContext muleContext, String endpointName) {
logger.info("List endpoint: {}", endpointName);
FTPClient ftpClient = null;
List<String> fileNames = new ArrayList<String>();
try {
ftpClient = getFtpClient(muleContext, endpoin... | java | static public List<String> listFilesInDirectory(MuleContext muleContext, String endpointName) {
logger.info("List endpoint: {}", endpointName);
FTPClient ftpClient = null;
List<String> fileNames = new ArrayList<String>();
try {
ftpClient = getFtpClient(muleContext, endpoin... | [
"static",
"public",
"List",
"<",
"String",
">",
"listFilesInDirectory",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"{",
"logger",
".",
"info",
"(",
"\"List endpoint: {}\"",
",",
"endpointName",
")",
";",
"FTPClient",
"ftpClient",
"=",
... | List files in a directory. Do not return sub-directories, just plain files
@param muleContext
@param endpointName
@return a list of the names of the files in the directory
@throws IOException | [
"List",
"files",
"in",
"a",
"directory",
".",
"Do",
"not",
"return",
"sub",
"-",
"directories",
"just",
"plain",
"files"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java#L94-L135 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java | FtpUtil.recursiveDeleteDirectory | static public void recursiveDeleteDirectory(FTPClient ftpClient, String path) throws IOException {
logger.info("Delete directory: {}", path);
FTPFile[] ftpFiles = ftpClient.listFiles(path);
logger.debug("Number of files that will be deleted: {}", ftpFiles.length);
for (FTPFile ftpFile... | java | static public void recursiveDeleteDirectory(FTPClient ftpClient, String path) throws IOException {
logger.info("Delete directory: {}", path);
FTPFile[] ftpFiles = ftpClient.listFiles(path);
logger.debug("Number of files that will be deleted: {}", ftpFiles.length);
for (FTPFile ftpFile... | [
"static",
"public",
"void",
"recursiveDeleteDirectory",
"(",
"FTPClient",
"ftpClient",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"Delete directory: {}\"",
",",
"path",
")",
";",
"FTPFile",
"[",
"]",
"ftpFiles",
"=",
... | Deletes a directory with all its files and sub-directories.
@param ftpClient
@param path
@throws IOException | [
"Deletes",
"a",
"directory",
"with",
"all",
"its",
"files",
"and",
"sub",
"-",
"directories",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java#L144-L163 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java | FtpUtil.recursiveCreateDirectory | static public void recursiveCreateDirectory(FTPClient ftpClient, String path) throws IOException {
logger.info("Create Directory: {}", path);
int createDirectoryStatus = ftpClient.mkd(path); // makeDirectory...
logger.debug("Create Directory Status: {}", createDirectoryStatus);
if (createDirectoryStatus == ... | java | static public void recursiveCreateDirectory(FTPClient ftpClient, String path) throws IOException {
logger.info("Create Directory: {}", path);
int createDirectoryStatus = ftpClient.mkd(path); // makeDirectory...
logger.debug("Create Directory Status: {}", createDirectoryStatus);
if (createDirectoryStatus == ... | [
"static",
"public",
"void",
"recursiveCreateDirectory",
"(",
"FTPClient",
"ftpClient",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"Create Directory: {}\"",
",",
"path",
")",
";",
"int",
"createDirectoryStatus",
"=",
"ft... | Create a directory and all missing parent-directories.
@param ftpClient
@param path
@throws IOException | [
"Create",
"a",
"directory",
"and",
"all",
"missing",
"parent",
"-",
"directories",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/ftp/FtpUtil.java#L172-L189 | train |
Putnami/putnami-web-toolkit | core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java | DefaultThemeController.insertLinks | private void insertLinks(Theme theme) {
if (theme != null) {
for (CssLink link : theme.getLinks()) {
this.getHead().appendChild(link.getLink());
}
}
} | java | private void insertLinks(Theme theme) {
if (theme != null) {
for (CssLink link : theme.getLinks()) {
this.getHead().appendChild(link.getLink());
}
}
} | [
"private",
"void",
"insertLinks",
"(",
"Theme",
"theme",
")",
"{",
"if",
"(",
"theme",
"!=",
"null",
")",
"{",
"for",
"(",
"CssLink",
"link",
":",
"theme",
".",
"getLinks",
"(",
")",
")",
"{",
"this",
".",
"getHead",
"(",
")",
".",
"appendChild",
"... | Insert links in the document head tag.
@param theme the theme | [
"Insert",
"links",
"in",
"the",
"document",
"head",
"tag",
"."
] | 129aa781d1bda508e579d194693ca3034b4d470b | https://github.com/Putnami/putnami-web-toolkit/blob/129aa781d1bda508e579d194693ca3034b4d470b/core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java#L112-L118 | train |
Putnami/putnami-web-toolkit | core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java | DefaultThemeController.removeCssLinks | private void removeCssLinks() {
if (this.isInit) {
return;
}
this.isInit = true;
// Remove all existing link element
NodeList<Element> links = this.getHead().getElementsByTagName(LinkElement.TAG);
int size = links.getLength();
for (int i = 0; i < size; i++) {
LinkElement elem = LinkElement.as(links.... | java | private void removeCssLinks() {
if (this.isInit) {
return;
}
this.isInit = true;
// Remove all existing link element
NodeList<Element> links = this.getHead().getElementsByTagName(LinkElement.TAG);
int size = links.getLength();
for (int i = 0; i < size; i++) {
LinkElement elem = LinkElement.as(links.... | [
"private",
"void",
"removeCssLinks",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isInit",
")",
"{",
"return",
";",
"}",
"this",
".",
"isInit",
"=",
"true",
";",
"// Remove all existing link element",
"NodeList",
"<",
"Element",
">",
"links",
"=",
"this",
".",
... | Removes all link tags in the head if not initialized. | [
"Removes",
"all",
"link",
"tags",
"in",
"the",
"head",
"if",
"not",
"initialized",
"."
] | 129aa781d1bda508e579d194693ca3034b4d470b | https://github.com/Putnami/putnami-web-toolkit/blob/129aa781d1bda508e579d194693ca3034b4d470b/core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java#L123-L137 | train |
Putnami/putnami-web-toolkit | core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java | DefaultThemeController.getHead | protected HeadElement getHead() {
if (this.head == null) {
Element elt = Document.get().getElementsByTagName("head").getItem(0);
assert elt != null : "The host HTML page does not have a <head> element" + " which is required by this injector";
this.head = HeadElement.as(elt);
}
return this.head;
} | java | protected HeadElement getHead() {
if (this.head == null) {
Element elt = Document.get().getElementsByTagName("head").getItem(0);
assert elt != null : "The host HTML page does not have a <head> element" + " which is required by this injector";
this.head = HeadElement.as(elt);
}
return this.head;
} | [
"protected",
"HeadElement",
"getHead",
"(",
")",
"{",
"if",
"(",
"this",
".",
"head",
"==",
"null",
")",
"{",
"Element",
"elt",
"=",
"Document",
".",
"get",
"(",
")",
".",
"getElementsByTagName",
"(",
"\"head\"",
")",
".",
"getItem",
"(",
"0",
")",
"... | Gets the head tag element.
@return the head tag element | [
"Gets",
"the",
"head",
"tag",
"element",
"."
] | 129aa781d1bda508e579d194693ca3034b4d470b | https://github.com/Putnami/putnami-web-toolkit/blob/129aa781d1bda508e579d194693ca3034b4d470b/core/src/main/java/fr/putnami/pwt/core/theme/client/DefaultThemeController.java#L144-L151 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.reset | public static void reset() {
deactivateLogging();
deactivateReporting();
defaultLogLevel = Constants.INFO;
defaultReportLevel = Constants.INFO;
detectWTFMethods();
logLevels.clear();
maxOfEntriesInReports = 25;
enableLogEntryCollection = false;
ent... | java | public static void reset() {
deactivateLogging();
deactivateReporting();
defaultLogLevel = Constants.INFO;
defaultReportLevel = Constants.INFO;
detectWTFMethods();
logLevels.clear();
maxOfEntriesInReports = 25;
enableLogEntryCollection = false;
ent... | [
"public",
"static",
"void",
"reset",
"(",
")",
"{",
"deactivateLogging",
"(",
")",
";",
"deactivateReporting",
"(",
")",
";",
"defaultLogLevel",
"=",
"Constants",
".",
"INFO",
";",
"defaultReportLevel",
"=",
"Constants",
".",
"INFO",
";",
"detectWTFMethods",
"... | Resets the configuration. | [
"Resets",
"the",
"configuration",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L215-L229 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.getLogLevel | private static Integer getLogLevel(String tag) {
Integer result = logLevels.get(tag);
if (tag != null && result == null) {
int index = tag.lastIndexOf(".");
while (result == null && index > -1) {
result = logLevels.get(tag.substring(0, index));
ind... | java | private static Integer getLogLevel(String tag) {
Integer result = logLevels.get(tag);
if (tag != null && result == null) {
int index = tag.lastIndexOf(".");
while (result == null && index > -1) {
result = logLevels.get(tag.substring(0, index));
ind... | [
"private",
"static",
"Integer",
"getLogLevel",
"(",
"String",
"tag",
")",
"{",
"Integer",
"result",
"=",
"logLevels",
".",
"get",
"(",
"tag",
")",
";",
"if",
"(",
"tag",
"!=",
"null",
"&&",
"result",
"==",
"null",
")",
"{",
"int",
"index",
"=",
"tag"... | If called with "a.b.c.d", it will test for a.b.c.d, a.b.c, a.b, a | [
"If",
"called",
"with",
"a",
".",
"b",
".",
"c",
".",
"d",
"it",
"will",
"test",
"for",
"a",
".",
"b",
".",
"c",
".",
"d",
"a",
".",
"b",
".",
"c",
"a",
".",
"b",
"a"
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L1140-L1150 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.report | public static boolean report(String message, Throwable error) {
boolean acc = true;
for (Reporter reporter : reporters) {
if (reportFactory != null && reporter instanceof EnhancedReporter) {
Report report = reportFactory.create(context, message, error);
acc = ... | java | public static boolean report(String message, Throwable error) {
boolean acc = true;
for (Reporter reporter : reporters) {
if (reportFactory != null && reporter instanceof EnhancedReporter) {
Report report = reportFactory.create(context, message, error);
acc = ... | [
"public",
"static",
"boolean",
"report",
"(",
"String",
"message",
",",
"Throwable",
"error",
")",
"{",
"boolean",
"acc",
"=",
"true",
";",
"for",
"(",
"Reporter",
"reporter",
":",
"reporters",
")",
"{",
"if",
"(",
"reportFactory",
"!=",
"null",
"&&",
"r... | Triggers a Report. This method generates the report and send it with all
configured reporters.
@param message
the message
@param error
the error
@return <code>true</code> if the report was successfully sent by
<b>all</b> reporters, <code>false</code> otherwise. | [
"Triggers",
"a",
"Report",
".",
"This",
"method",
"generates",
"the",
"report",
"and",
"send",
"it",
"with",
"all",
"configured",
"reporters",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L1204-L1215 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/Log.java | Log.collectLogEntry | private static synchronized void collectLogEntry(int level, String tag, final String message,
final Throwable err) {
if (!isReportable(level)) {
return;
}
if (maxOfEntriesInReports > 0
&& entries.size() == maxOfEntriesInReports) {
entries.remo... | java | private static synchronized void collectLogEntry(int level, String tag, final String message,
final Throwable err) {
if (!isReportable(level)) {
return;
}
if (maxOfEntriesInReports > 0
&& entries.size() == maxOfEntriesInReports) {
entries.remo... | [
"private",
"static",
"synchronized",
"void",
"collectLogEntry",
"(",
"int",
"level",
",",
"String",
"tag",
",",
"final",
"String",
"message",
",",
"final",
"Throwable",
"err",
")",
"{",
"if",
"(",
"!",
"isReportable",
"(",
"level",
")",
")",
"{",
"return",... | Adds a log entry to the collected entry list. This method managed the
maximum number of entries and triggers report if the entry priority is
superior or equals to the report trigger level.
@param level
the log level of the entry
@param tag
the tag
@param message
the message
@param err
the error message | [
"Adds",
"a",
"log",
"entry",
"to",
"the",
"collected",
"entry",
"list",
".",
"This",
"method",
"managed",
"the",
"maximum",
"number",
"of",
"entries",
"and",
"triggers",
"report",
"if",
"the",
"entry",
"priority",
"is",
"superior",
"or",
"equals",
"to",
"t... | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/Log.java#L1231-L1255 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/security/ORole.java | ORole.grant | public void grant(final String iResource, final int iOperation) {
final Byte current = rules.get(iResource);
byte currentValue = current == null ? PERMISSION_NONE : current.byteValue();
currentValue |= (byte) iOperation;
rules.put(iResource, currentValue);
document.field("rules", rules);
... | java | public void grant(final String iResource, final int iOperation) {
final Byte current = rules.get(iResource);
byte currentValue = current == null ? PERMISSION_NONE : current.byteValue();
currentValue |= (byte) iOperation;
rules.put(iResource, currentValue);
document.field("rules", rules);
... | [
"public",
"void",
"grant",
"(",
"final",
"String",
"iResource",
",",
"final",
"int",
"iOperation",
")",
"{",
"final",
"Byte",
"current",
"=",
"rules",
".",
"get",
"(",
"iResource",
")",
";",
"byte",
"currentValue",
"=",
"current",
"==",
"null",
"?",
"PER... | Grant a permission to the resource.
@param iResource
Requested resource
@param iOperation
Permission to grant/add | [
"Grant",
"a",
"permission",
"to",
"the",
"resource",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/security/ORole.java#L135-L143 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/security/ORole.java | ORole.permissionToString | public static String permissionToString(final int iPermission) {
int permission = iPermission;
final StringBuilder returnValue = new StringBuilder();
for (Entry<Integer, String> p : PERMISSION_BIT_NAMES.entrySet()) {
if ((permission & p.getKey()) == p.getKey()) {
if (returnValue.length() ... | java | public static String permissionToString(final int iPermission) {
int permission = iPermission;
final StringBuilder returnValue = new StringBuilder();
for (Entry<Integer, String> p : PERMISSION_BIT_NAMES.entrySet()) {
if ((permission & p.getKey()) == p.getKey()) {
if (returnValue.length() ... | [
"public",
"static",
"String",
"permissionToString",
"(",
"final",
"int",
"iPermission",
")",
"{",
"int",
"permission",
"=",
"iPermission",
";",
"final",
"StringBuilder",
"returnValue",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"Inte... | Convert the permission code to a readable string.
@param iPermission
Permission to convert
@return String representation of the permission | [
"Convert",
"the",
"permission",
"code",
"to",
"a",
"readable",
"string",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/security/ORole.java#L217-L236 | train |
amsa-code/risky | streams/src/main/java/au/gov/amsa/streams/StringServer.java | StringServer.start | public void start() {
try {
while (keepGoing) {
try {
// this is a blocking call so it hogs a thread
final Socket socket = ss.accept();
final String socketName = socket.getInetAddress().getHostAddress() + ":"
... | java | public void start() {
try {
while (keepGoing) {
try {
// this is a blocking call so it hogs a thread
final Socket socket = ss.accept();
final String socketName = socket.getInetAddress().getHostAddress() + ":"
... | [
"public",
"void",
"start",
"(",
")",
"{",
"try",
"{",
"while",
"(",
"keepGoing",
")",
"{",
"try",
"{",
"// this is a blocking call so it hogs a thread",
"final",
"Socket",
"socket",
"=",
"ss",
".",
"accept",
"(",
")",
";",
"final",
"String",
"socketName",
"=... | Starts the server. Each connection to the server will bring about another
subscription to the source. | [
"Starts",
"the",
"server",
".",
"Each",
"connection",
"to",
"the",
"server",
"will",
"bring",
"about",
"another",
"subscription",
"to",
"the",
"source",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/streams/src/main/java/au/gov/amsa/streams/StringServer.java#L66-L106 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java | LogHelper.getLevel | protected static int getLevel(String level, int defaultLogLevel) {
try {
return Integer.parseInt(level);
} catch (NumberFormatException e) {
// Try to read the string.
if ("VERBOSE".equalsIgnoreCase(level)) {
return Constants.VERBOSE;
} els... | java | protected static int getLevel(String level, int defaultLogLevel) {
try {
return Integer.parseInt(level);
} catch (NumberFormatException e) {
// Try to read the string.
if ("VERBOSE".equalsIgnoreCase(level)) {
return Constants.VERBOSE;
} els... | [
"protected",
"static",
"int",
"getLevel",
"(",
"String",
"level",
",",
"int",
"defaultLogLevel",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"level",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"// Try to read th... | Parses the given level to get the log level. This method supports both
integer level and String level.
@param level
the level
@param defaultLogLevel
the default log level
@return the parsed level or the default level if the level cannot be
parsed. | [
"Parses",
"the",
"given",
"level",
"to",
"get",
"the",
"log",
"level",
".",
"This",
"method",
"supports",
"both",
"integer",
"level",
"and",
"String",
"level",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java#L49-L70 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java | LogHelper.getCaller | public static String getCaller() {
StackTraceElement[] stacks = Thread.currentThread().getStackTrace();
if (stacks != null) {
for (int i = 0; i < stacks.length; i++) {
String cn = stacks[i].getClassName();
if (cn != null && !Constants.CLASSNAME_TO_ESCAPE.conta... | java | public static String getCaller() {
StackTraceElement[] stacks = Thread.currentThread().getStackTrace();
if (stacks != null) {
for (int i = 0; i < stacks.length; i++) {
String cn = stacks[i].getClassName();
if (cn != null && !Constants.CLASSNAME_TO_ESCAPE.conta... | [
"public",
"static",
"String",
"getCaller",
"(",
")",
"{",
"StackTraceElement",
"[",
"]",
"stacks",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getStackTrace",
"(",
")",
";",
"if",
"(",
"stacks",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
... | Extracts the tag from the current stack trace.
@return the qualified name of the first non escaped class on the stack. | [
"Extracts",
"the",
"tag",
"from",
"the",
"current",
"stack",
"trace",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java#L87-L98 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java | LogHelper.getConfigurationFileFromSDCard | protected static InputStream getConfigurationFileFromSDCard(String fileName) {
File sdcard = Environment.getExternalStorageDirectory();
if (sdcard == null || !sdcard.exists() || !sdcard.canRead()) {
return null;
}
String sdCardPath = sdcard.getAbsolutePath();
File p... | java | protected static InputStream getConfigurationFileFromSDCard(String fileName) {
File sdcard = Environment.getExternalStorageDirectory();
if (sdcard == null || !sdcard.exists() || !sdcard.canRead()) {
return null;
}
String sdCardPath = sdcard.getAbsolutePath();
File p... | [
"protected",
"static",
"InputStream",
"getConfigurationFileFromSDCard",
"(",
"String",
"fileName",
")",
"{",
"File",
"sdcard",
"=",
"Environment",
".",
"getExternalStorageDirectory",
"(",
")",
";",
"if",
"(",
"sdcard",
"==",
"null",
"||",
"!",
"sdcard",
".",
"ex... | Gets an input on a configuration file placed on the the SDCard.
@param fileName
the file name
@return the input stream to read the file or <code>null</code> if the
file does not exist. | [
"Gets",
"an",
"input",
"on",
"a",
"configuration",
"file",
"placed",
"on",
"the",
"the",
"SDCard",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java#L108-L130 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java | LogHelper.getConfigurationFileFromAssets | protected static InputStream getConfigurationFileFromAssets(Context context,
String fileName) {
if (context == null) {
return null;
}
AssetManager assets = context.getAssets();
if (assets == null) {
return null;
}
try {
re... | java | protected static InputStream getConfigurationFileFromAssets(Context context,
String fileName) {
if (context == null) {
return null;
}
AssetManager assets = context.getAssets();
if (assets == null) {
return null;
}
try {
re... | [
"protected",
"static",
"InputStream",
"getConfigurationFileFromAssets",
"(",
"Context",
"context",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"AssetManager",
"assets",
"=",
"context",
".",
"ge... | Gets an input on a configuration file placed in the application assets.
@param context
the Android context to use
@param fileName
the file name
@return the input stream to read the file or <code>null</code> if the
file does not exist. | [
"Gets",
"an",
"input",
"on",
"a",
"configuration",
"file",
"placed",
"in",
"the",
"application",
"assets",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java#L142-L159 | train |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java | LogHelper.print | public static String print(int priority, String tag, String msg, Throwable tr, boolean addTimestamp) {
// Compute the letter for the given priority
String p = "X"; // X => Unknown
switch (priority) {
case Constants.DEBUG:
p = "D";
break;
ca... | java | public static String print(int priority, String tag, String msg, Throwable tr, boolean addTimestamp) {
// Compute the letter for the given priority
String p = "X"; // X => Unknown
switch (priority) {
case Constants.DEBUG:
p = "D";
break;
ca... | [
"public",
"static",
"String",
"print",
"(",
"int",
"priority",
",",
"String",
"tag",
",",
"String",
"msg",
",",
"Throwable",
"tr",
",",
"boolean",
"addTimestamp",
")",
"{",
"// Compute the letter for the given priority",
"String",
"p",
"=",
"\"X\"",
";",
"// X =... | Gets a String form of the log data.
@param priority
The priority/type of this log message
@param tag
Used to identify the source of a log message. It usually
identifies the class or activity where the log call occurs.
@param msg
The message you would like logged.
@param tr
The error, can be <code>null</code>
@param ad... | [
"Gets",
"a",
"String",
"form",
"of",
"the",
"log",
"data",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/LogHelper.java#L203-L226 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java | AsnInputStream.readLength | public int readLength() throws IOException {
int length = 0;
byte b = (byte) this.read();
// This is short form. The short form can be used if the number of
// octets in the Value part is less than or
// equal to 127, and can be used whether the Value part is primitive or
// constructed. This form... | java | public int readLength() throws IOException {
int length = 0;
byte b = (byte) this.read();
// This is short form. The short form can be used if the number of
// octets in the Value part is less than or
// equal to 127, and can be used whether the Value part is primitive or
// constructed. This form... | [
"public",
"int",
"readLength",
"(",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"0",
";",
"byte",
"b",
"=",
"(",
"byte",
")",
"this",
".",
"read",
"(",
")",
";",
"// This is short form. The short form can be used if the number of\r",
"// octets in the... | Reads and returns the length field.
In case of indefinite length returns Tag.Indefinite_Length value
@return
@throws IOException | [
"Reads",
"and",
"returns",
"the",
"length",
"field",
".",
"In",
"case",
"of",
"indefinite",
"length",
"returns",
"Tag",
".",
"Indefinite_Length",
"value"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java#L285-L324 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java | AsnInputStream.readSequenceStreamData | public AsnInputStream readSequenceStreamData(int length) throws AsnException, IOException {
if (length == Tag.Indefinite_Length) {
return this.readSequenceIndefinite();
} else {
int startPos = this.pos;
this.advance(length);
return new AsnInputStream(this, startPos, length);
}
} | java | public AsnInputStream readSequenceStreamData(int length) throws AsnException, IOException {
if (length == Tag.Indefinite_Length) {
return this.readSequenceIndefinite();
} else {
int startPos = this.pos;
this.advance(length);
return new AsnInputStream(this, startPos, length);
}
} | [
"public",
"AsnInputStream",
"readSequenceStreamData",
"(",
"int",
"length",
")",
"throws",
"AsnException",
",",
"IOException",
"{",
"if",
"(",
"length",
"==",
"Tag",
".",
"Indefinite_Length",
")",
"{",
"return",
"this",
".",
"readSequenceIndefinite",
"(",
")",
"... | This method can be invoked after the sequence tag and length has been
read. Returns the AsnInputStream that contains the sequence data. The origin
stream advances to the begin of the next record
@param length
The sequence length
@return
@throws AsnException
@throws IOException | [
"This",
"method",
"can",
"be",
"invoked",
"after",
"the",
"sequence",
"tag",
"and",
"length",
"has",
"been",
"read",
".",
"Returns",
"the",
"AsnInputStream",
"that",
"contains",
"the",
"sequence",
"data",
".",
"The",
"origin",
"stream",
"advances",
"to",
"th... | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java#L367-L376 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java | AsnInputStream.readSequenceData | public byte[] readSequenceData(int length) throws AsnException, IOException {
AsnInputStream ais = this.readSequenceStreamData(length);
byte[] res = new byte[ais.length];
System.arraycopy(ais.buffer, ais.start + ais.pos, res, 0, ais.length);
return res;
} | java | public byte[] readSequenceData(int length) throws AsnException, IOException {
AsnInputStream ais = this.readSequenceStreamData(length);
byte[] res = new byte[ais.length];
System.arraycopy(ais.buffer, ais.start + ais.pos, res, 0, ais.length);
return res;
} | [
"public",
"byte",
"[",
"]",
"readSequenceData",
"(",
"int",
"length",
")",
"throws",
"AsnException",
",",
"IOException",
"{",
"AsnInputStream",
"ais",
"=",
"this",
".",
"readSequenceStreamData",
"(",
"length",
")",
";",
"byte",
"[",
"]",
"res",
"=",
"new",
... | This method can be invoked after the sequence tag and length has been
read. Returns the byte stream that contains the sequence data. The origin
stream advances to the begin of the next record
@param length
The sequence length
@return
@throws AsnException
@throws IOException | [
"This",
"method",
"can",
"be",
"invoked",
"after",
"the",
"sequence",
"tag",
"and",
"length",
"has",
"been",
"read",
".",
"Returns",
"the",
"byte",
"stream",
"that",
"contains",
"the",
"sequence",
"data",
".",
"The",
"origin",
"stream",
"advances",
"to",
"... | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnInputStream.java#L389-L395 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/createcomponent/CreateComponentWizard.java | CreateComponentWizard.addPages | public void addPages() {
page = new CreateComponentStartPage(selection);
addPage(page);
integrationComponentPage = new CreateIntegrationComponentPage(selection);
addPage(integrationComponentPage);
serviceDescriptionComponentPage = new CreateServiceDescriptionComponentPage(selection);
addPage(serviceDescr... | java | public void addPages() {
page = new CreateComponentStartPage(selection);
addPage(page);
integrationComponentPage = new CreateIntegrationComponentPage(selection);
addPage(integrationComponentPage);
serviceDescriptionComponentPage = new CreateServiceDescriptionComponentPage(selection);
addPage(serviceDescr... | [
"public",
"void",
"addPages",
"(",
")",
"{",
"page",
"=",
"new",
"CreateComponentStartPage",
"(",
"selection",
")",
";",
"addPage",
"(",
"page",
")",
";",
"integrationComponentPage",
"=",
"new",
"CreateIntegrationComponentPage",
"(",
"selection",
")",
";",
"addP... | Adding the page to the wizard. | [
"Adding",
"the",
"page",
"to",
"the",
"wizard",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/createcomponent/CreateComponentWizard.java#L116-L127 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java | ORecordIteratorCluster.next | @SuppressWarnings("unchecked")
public REC next() {
checkDirection(true);
ORecordInternal<?> record = getRecord();
// ITERATE UNTIL THE NEXT GOOD RECORD
while (hasNext()) {
record = getTransactionEntry();
if (record != null)
return (REC) record;
if ((record = readCurrentRecord(null, ... | java | @SuppressWarnings("unchecked")
public REC next() {
checkDirection(true);
ORecordInternal<?> record = getRecord();
// ITERATE UNTIL THE NEXT GOOD RECORD
while (hasNext()) {
record = getTransactionEntry();
if (record != null)
return (REC) record;
if ((record = readCurrentRecord(null, ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"REC",
"next",
"(",
")",
"{",
"checkDirection",
"(",
"true",
")",
";",
"ORecordInternal",
"<",
"?",
">",
"record",
"=",
"getRecord",
"(",
")",
";",
"// ITERATE UNTIL THE NEXT GOOD RECORD\r",
"while",
... | Return the element at the current position and move forward the cursor to the next position available.
@return the next record found, otherwise the NoSuchElementException exception is thrown when no more records are found. | [
"Return",
"the",
"element",
"at",
"the",
"current",
"position",
"and",
"move",
"forward",
"the",
"cursor",
"to",
"the",
"next",
"position",
"available",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java#L148-L166 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java | ORecordIteratorCluster.setRange | public ORecordIteratorCluster<REC> setRange(final long iFrom, final long iEnd) {
firstClusterPosition = iFrom;
rangeTo = iEnd;
current.clusterPosition = firstClusterPosition;
return this;
} | java | public ORecordIteratorCluster<REC> setRange(final long iFrom, final long iEnd) {
firstClusterPosition = iFrom;
rangeTo = iEnd;
current.clusterPosition = firstClusterPosition;
return this;
} | [
"public",
"ORecordIteratorCluster",
"<",
"REC",
">",
"setRange",
"(",
"final",
"long",
"iFrom",
",",
"final",
"long",
"iEnd",
")",
"{",
"firstClusterPosition",
"=",
"iFrom",
";",
"rangeTo",
"=",
"iEnd",
";",
"current",
".",
"clusterPosition",
"=",
"firstCluste... | Define the range where move the iterator forward and backward.
@param iFrom
Lower bound limit of the range
@param iEnd
Upper bound limit of the range
@return | [
"Define",
"the",
"range",
"where",
"move",
"the",
"iterator",
"forward",
"and",
"backward",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java#L203-L208 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java | ORecordIteratorCluster.getRangeFrom | public long getRangeFrom() {
final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : firstClusterPosition) - 1;
if (rangeFrom > -1)
return Math.max(rangeFrom, limit);
return limit;
} | java | public long getRangeFrom() {
final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : firstClusterPosition) - 1;
if (rangeFrom > -1)
return Math.max(rangeFrom, limit);
return limit;
} | [
"public",
"long",
"getRangeFrom",
"(",
")",
"{",
"final",
"long",
"limit",
"=",
"(",
"liveUpdated",
"?",
"database",
".",
"getStorage",
"(",
")",
".",
"getClusterDataRange",
"(",
"current",
".",
"clusterId",
")",
"[",
"1",
"]",
":",
"firstClusterPosition",
... | Return the lower bound limit of the range if any, otherwise 0.
@return | [
"Return",
"the",
"lower",
"bound",
"limit",
"of",
"the",
"range",
"if",
"any",
"otherwise",
"0",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java#L215-L220 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java | ORecordIteratorCluster.getRangeTo | public long getRangeTo() {
final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : lastClusterPosition) + 1;
if (rangeTo > -1)
return Math.min(rangeTo, limit);
return limit;
} | java | public long getRangeTo() {
final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : lastClusterPosition) + 1;
if (rangeTo > -1)
return Math.min(rangeTo, limit);
return limit;
} | [
"public",
"long",
"getRangeTo",
"(",
")",
"{",
"final",
"long",
"limit",
"=",
"(",
"liveUpdated",
"?",
"database",
".",
"getStorage",
"(",
")",
".",
"getClusterDataRange",
"(",
"current",
".",
"clusterId",
")",
"[",
"1",
"]",
":",
"lastClusterPosition",
")... | Return the upper bound limit of the range if any, otherwise the last record.
@return | [
"Return",
"the",
"upper",
"bound",
"limit",
"of",
"the",
"range",
"if",
"any",
"otherwise",
"the",
"last",
"record",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/iterator/ORecordIteratorCluster.java#L227-L232 | train |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/AisNmeaMessage.java | AisNmeaMessage.getMessage | public AisMessage getMessage() {
AisMessage m = aisParser.parse(aisMessage, nmea.getSource(), padBits);
return m;
} | java | public AisMessage getMessage() {
AisMessage m = aisParser.parse(aisMessage, nmea.getSource(), padBits);
return m;
} | [
"public",
"AisMessage",
"getMessage",
"(",
")",
"{",
"AisMessage",
"m",
"=",
"aisParser",
".",
"parse",
"(",
"aisMessage",
",",
"nmea",
".",
"getSource",
"(",
")",
",",
"padBits",
")",
";",
"return",
"m",
";",
"}"
] | Returns the parsed contents of column 5 of the AIS NMEA line.
@return | [
"Returns",
"the",
"parsed",
"contents",
"of",
"column",
"5",
"of",
"the",
"AIS",
"NMEA",
"line",
"."
] | 13649942aeddfdb9210eec072c605bc5d7a6daf3 | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/AisNmeaMessage.java#L172-L175 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/OStorageEmbedded.java | OStorageEmbedded.command | public Object command(final OCommandRequestText iCommand) {
final OCommandExecutor executor = OCommandManager.instance().getExecutor(iCommand);
executor.setProgressListener(iCommand.getProgressListener());
executor.parse(iCommand);
return executeCommand(iCommand, executor);
} | java | public Object command(final OCommandRequestText iCommand) {
final OCommandExecutor executor = OCommandManager.instance().getExecutor(iCommand);
executor.setProgressListener(iCommand.getProgressListener());
executor.parse(iCommand);
return executeCommand(iCommand, executor);
} | [
"public",
"Object",
"command",
"(",
"final",
"OCommandRequestText",
"iCommand",
")",
"{",
"final",
"OCommandExecutor",
"executor",
"=",
"OCommandManager",
".",
"instance",
"(",
")",
".",
"getExecutor",
"(",
"iCommand",
")",
";",
"executor",
".",
"setProgressListen... | Executes the command request and return the result back. | [
"Executes",
"the",
"command",
"request",
"and",
"return",
"the",
"result",
"back",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/OStorageEmbedded.java#L68-L75 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java | OClusterLocalHole.pushPosition | public long pushPosition(final long iPosition) throws IOException {
final int position = getHoles() * RECORD_SIZE;
file.allocateSpace(RECORD_SIZE);
file.writeLong(position, iPosition);
if (OLogManager.instance().isDebugEnabled())
OLogManager.instance().debug(this, "Pushed new hole %s/#%d ... | java | public long pushPosition(final long iPosition) throws IOException {
final int position = getHoles() * RECORD_SIZE;
file.allocateSpace(RECORD_SIZE);
file.writeLong(position, iPosition);
if (OLogManager.instance().isDebugEnabled())
OLogManager.instance().debug(this, "Pushed new hole %s/#%d ... | [
"public",
"long",
"pushPosition",
"(",
"final",
"long",
"iPosition",
")",
"throws",
"IOException",
"{",
"final",
"int",
"position",
"=",
"getHoles",
"(",
")",
"*",
"RECORD_SIZE",
";",
"file",
".",
"allocateSpace",
"(",
"RECORD_SIZE",
")",
";",
"file",
".",
... | Append the hole to the end of segment
@throws IOException | [
"Append",
"the",
"hole",
"to",
"the",
"end",
"of",
"segment"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java#L68-L79 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java | OClusterLocalHole.popLastEntryPosition | public long popLastEntryPosition() throws IOException {
// BROWSE IN ASCENDING ORDER UNTIL A GOOD POSITION IS FOUND (!=-1)
for (int pos = getHoles() - 1; pos >= 0; --pos) {
final long recycledPosition = file.readLong(pos * RECORD_SIZE);
if (recycledPosition > -1) {
if (OLogManager.ins... | java | public long popLastEntryPosition() throws IOException {
// BROWSE IN ASCENDING ORDER UNTIL A GOOD POSITION IS FOUND (!=-1)
for (int pos = getHoles() - 1; pos >= 0; --pos) {
final long recycledPosition = file.readLong(pos * RECORD_SIZE);
if (recycledPosition > -1) {
if (OLogManager.ins... | [
"public",
"long",
"popLastEntryPosition",
"(",
")",
"throws",
"IOException",
"{",
"// BROWSE IN ASCENDING ORDER UNTIL A GOOD POSITION IS FOUND (!=-1)\r",
"for",
"(",
"int",
"pos",
"=",
"getHoles",
"(",
")",
"-",
"1",
";",
"pos",
">=",
"0",
";",
"--",
"pos",
")",
... | Returns and remove the recycled position if any.
@return the recycled position if found, otherwise -1 that usually means to request more space.
@throws IOException | [
"Returns",
"and",
"remove",
"the",
"recycled",
"position",
"if",
"any",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java#L87-L105 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java | OClusterLocalHole.removeEntryWithPosition | public boolean removeEntryWithPosition(final long iPosition) throws IOException {
// BROWSE IN ASCENDING ORDER UNTIL THE REQUESTED POSITION IS FOUND
boolean canShrink = true;
for (int pos = getHoles() - 1; pos >= 0; --pos) {
final long recycledPosition = file.readLong(pos * RECORD_SIZE);
... | java | public boolean removeEntryWithPosition(final long iPosition) throws IOException {
// BROWSE IN ASCENDING ORDER UNTIL THE REQUESTED POSITION IS FOUND
boolean canShrink = true;
for (int pos = getHoles() - 1; pos >= 0; --pos) {
final long recycledPosition = file.readLong(pos * RECORD_SIZE);
... | [
"public",
"boolean",
"removeEntryWithPosition",
"(",
"final",
"long",
"iPosition",
")",
"throws",
"IOException",
"{",
"// BROWSE IN ASCENDING ORDER UNTIL THE REQUESTED POSITION IS FOUND\r",
"boolean",
"canShrink",
"=",
"true",
";",
"for",
"(",
"int",
"pos",
"=",
"getHoles... | Removes a hole. Called on transaction recover to invalidate a delete for a record. Try to shrink the file if the invalidated
entry is not in the middle of valid entries.
@param iPosition
Record position to find and invalidate
@return
@throws IOException | [
"Removes",
"a",
"hole",
".",
"Called",
"on",
"transaction",
"recover",
"to",
"invalidate",
"a",
"delete",
"for",
"a",
"record",
".",
"Try",
"to",
"shrink",
"the",
"file",
"if",
"the",
"invalidated",
"entry",
"is",
"not",
"in",
"the",
"middle",
"of",
"val... | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLocalHole.java#L126-L149 | train |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/concur/lock/OModificationLock.java | OModificationLock.requestModificationLock | public void requestModificationLock() {
lock.readLock().lock();
if (!veto)
return;
if (throwException) {
lock.readLock().unlock();
throw new OModificationOperationProhibitedException("Modification requests are prohibited");
}
boolean wasInterrupted = false;
Thread ... | java | public void requestModificationLock() {
lock.readLock().lock();
if (!veto)
return;
if (throwException) {
lock.readLock().unlock();
throw new OModificationOperationProhibitedException("Modification requests are prohibited");
}
boolean wasInterrupted = false;
Thread ... | [
"public",
"void",
"requestModificationLock",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"if",
"(",
"!",
"veto",
")",
"return",
";",
"if",
"(",
"throwException",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"u... | Tells the lock that thread is going to perform data modifications in storage. This method allows to perform several data
modifications in parallel. | [
"Tells",
"the",
"lock",
"that",
"thread",
"is",
"going",
"to",
"perform",
"data",
"modifications",
"in",
"storage",
".",
"This",
"method",
"allows",
"to",
"perform",
"several",
"data",
"modifications",
"in",
"parallel",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/concur/lock/OModificationLock.java#L45-L68 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java | OClassImpl.setSuperClass | public OClass setSuperClass(final OClass iSuperClass) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
final String cmd = String.format("alter class %s superclass %s", name, iSuperClass.getName());
getDatabase().command(new OCommandSQL(cmd)).execute();
setSu... | java | public OClass setSuperClass(final OClass iSuperClass) {
getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
final String cmd = String.format("alter class %s superclass %s", name, iSuperClass.getName());
getDatabase().command(new OCommandSQL(cmd)).execute();
setSu... | [
"public",
"OClass",
"setSuperClass",
"(",
"final",
"OClass",
"iSuperClass",
")",
"{",
"getDatabase",
"(",
")",
".",
"checkSecurity",
"(",
"ODatabaseSecurityResources",
".",
"SCHEMA",
",",
"ORole",
".",
"PERMISSION_UPDATE",
")",
";",
"final",
"String",
"cmd",
"="... | Set the super class.
@param iSuperClass
Super class as OClass instance
@return the object itself. | [
"Set",
"the",
"super",
"class",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java#L140-L146 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java | OClassImpl.addBaseClasses | private OClass addBaseClasses(final OClass iBaseClass) {
if (baseClasses == null)
baseClasses = new ArrayList<OClass>();
if (baseClasses.contains(iBaseClass))
return this;
baseClasses.add(iBaseClass);
// ADD CLUSTER IDS OF BASE CLASS TO THIS CLASS AND ALL SUPER-CLASSES
OClas... | java | private OClass addBaseClasses(final OClass iBaseClass) {
if (baseClasses == null)
baseClasses = new ArrayList<OClass>();
if (baseClasses.contains(iBaseClass))
return this;
baseClasses.add(iBaseClass);
// ADD CLUSTER IDS OF BASE CLASS TO THIS CLASS AND ALL SUPER-CLASSES
OClas... | [
"private",
"OClass",
"addBaseClasses",
"(",
"final",
"OClass",
"iBaseClass",
")",
"{",
"if",
"(",
"baseClasses",
"==",
"null",
")",
"baseClasses",
"=",
"new",
"ArrayList",
"<",
"OClass",
">",
"(",
")",
";",
"if",
"(",
"baseClasses",
".",
"contains",
"(",
... | Adds a base class to the current one. It adds also the base class cluster ids to the polymorphic cluster ids array.
@param iBaseClass
The base class to add. | [
"Adds",
"a",
"base",
"class",
"to",
"the",
"current",
"one",
".",
"It",
"adds",
"also",
"the",
"base",
"class",
"cluster",
"ids",
"to",
"the",
"polymorphic",
"cluster",
"ids",
"array",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java#L538-L555 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java | OClassImpl.truncate | public void truncate() throws IOException {
getDatabase().checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_UPDATE);
getDatabase().getStorage().callInLock(new Callable<Object>() {
public Object call() throws Exception {
for (int id : clusterIds) {
getDatabase().getS... | java | public void truncate() throws IOException {
getDatabase().checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_UPDATE);
getDatabase().getStorage().callInLock(new Callable<Object>() {
public Object call() throws Exception {
for (int id : clusterIds) {
getDatabase().getS... | [
"public",
"void",
"truncate",
"(",
")",
"throws",
"IOException",
"{",
"getDatabase",
"(",
")",
".",
"checkSecurity",
"(",
"ODatabaseSecurityResources",
".",
"CLASS",
",",
"ORole",
".",
"PERMISSION_UPDATE",
")",
";",
"getDatabase",
"(",
")",
".",
"getStorage",
... | Truncates all the clusters the class uses.
@throws IOException | [
"Truncates",
"all",
"the",
"clusters",
"the",
"class",
"uses",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java#L688-L703 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java | OClassImpl.addPolymorphicClusterIds | private void addPolymorphicClusterIds(final OClassImpl iBaseClass) {
boolean found;
for (int i : iBaseClass.polymorphicClusterIds) {
found = false;
for (int k : polymorphicClusterIds) {
if (i == k) {
found = true;
break;
}
}
if (!found) {
... | java | private void addPolymorphicClusterIds(final OClassImpl iBaseClass) {
boolean found;
for (int i : iBaseClass.polymorphicClusterIds) {
found = false;
for (int k : polymorphicClusterIds) {
if (i == k) {
found = true;
break;
}
}
if (!found) {
... | [
"private",
"void",
"addPolymorphicClusterIds",
"(",
"final",
"OClassImpl",
"iBaseClass",
")",
"{",
"boolean",
"found",
";",
"for",
"(",
"int",
"i",
":",
"iBaseClass",
".",
"polymorphicClusterIds",
")",
"{",
"found",
"=",
"false",
";",
"for",
"(",
"int",
"k",... | Add different cluster id to the "polymorphic cluster ids" array. | [
"Add",
"different",
"cluster",
"id",
"to",
"the",
"polymorphic",
"cluster",
"ids",
"array",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OClassImpl.java#L867-L885 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OMultiFileSegment.java | OMultiFileSegment.allocateSpace | protected long[] allocateSpace(final int iRecordSize) throws IOException {
// IT'S PREFEREABLE TO FIND SPACE WITHOUT ENLARGE ANY FILES: FIND THE FIRST FILE WITH FREE SPACE TO USE
OFile file;
for (int i = 0; i < files.length; ++i) {
file = files[i];
if (file.getFreeSpace() >= iRecordSize)
... | java | protected long[] allocateSpace(final int iRecordSize) throws IOException {
// IT'S PREFEREABLE TO FIND SPACE WITHOUT ENLARGE ANY FILES: FIND THE FIRST FILE WITH FREE SPACE TO USE
OFile file;
for (int i = 0; i < files.length; ++i) {
file = files[i];
if (file.getFreeSpace() >= iRecordSize)
... | [
"protected",
"long",
"[",
"]",
"allocateSpace",
"(",
"final",
"int",
"iRecordSize",
")",
"throws",
"IOException",
"{",
"// IT'S PREFEREABLE TO FIND SPACE WITHOUT ENLARGE ANY FILES: FIND THE FIRST FILE WITH FREE SPACE TO USE\r",
"OFile",
"file",
";",
"for",
"(",
"int",
"i",
... | Find free space for iRecordSize bytes.
@param iRecordSize
@return a pair file-id/file-pos
@throws IOException | [
"Find",
"free",
"space",
"for",
"iRecordSize",
"bytes",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OMultiFileSegment.java#L186-L226 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/tool/ODatabaseImport.java | ODatabaseImport.deleteHoleRecords | private void deleteHoleRecords() {
listener.onMessage("\nDelete temporary records...");
final ORecordId rid = new ORecordId();
final ODocument doc = new ODocument(rid);
for (String recId : recordToDelete) {
doc.reset();
rid.fromString(recId);
doc.delete();
}
listener... | java | private void deleteHoleRecords() {
listener.onMessage("\nDelete temporary records...");
final ORecordId rid = new ORecordId();
final ODocument doc = new ODocument(rid);
for (String recId : recordToDelete) {
doc.reset();
rid.fromString(recId);
doc.delete();
}
listener... | [
"private",
"void",
"deleteHoleRecords",
"(",
")",
"{",
"listener",
".",
"onMessage",
"(",
"\"\\nDelete temporary records...\"",
")",
";",
"final",
"ORecordId",
"rid",
"=",
"new",
"ORecordId",
"(",
")",
";",
"final",
"ODocument",
"doc",
"=",
"new",
"ODocument",
... | Delete all the temporary records created to fill the holes and to mantain the same record ID | [
"Delete",
"all",
"the",
"temporary",
"records",
"created",
"to",
"fill",
"the",
"holes",
"and",
"to",
"mantain",
"the",
"same",
"record",
"ID"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/tool/ODatabaseImport.java#L153-L164 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/util/StatusPage.java | StatusPage.createStatusPrintStream | public PrintStream createStatusPrintStream() {
return new PrintStream(new OutputStream() {
StringBuffer sb = new StringBuffer();
@Override
public void write(int b) throws IOException {
if (b == '\n') {
String str = sb.toString();
sb.delete(0, sb.length());
writeLine(str);
} else {
... | java | public PrintStream createStatusPrintStream() {
return new PrintStream(new OutputStream() {
StringBuffer sb = new StringBuffer();
@Override
public void write(int b) throws IOException {
if (b == '\n') {
String str = sb.toString();
sb.delete(0, sb.length());
writeLine(str);
} else {
... | [
"public",
"PrintStream",
"createStatusPrintStream",
"(",
")",
"{",
"return",
"new",
"PrintStream",
"(",
"new",
"OutputStream",
"(",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"@",
"Override",
"public",
"void",
"write",
"(",
"i... | Returns a new PrinstStream that can be used to update the status-text-area on this page.
@return | [
"Returns",
"a",
"new",
"PrinstStream",
"that",
"can",
"be",
"used",
"to",
"update",
"the",
"status",
"-",
"text",
"-",
"area",
"on",
"this",
"page",
"."
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/util/StatusPage.java#L64-L78 | train |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/util/StatusPage.java | StatusPage.writeLine | protected void writeLine(final String line) {
getContainer().getShell().getDisplay().syncExec(
new Runnable() {
public void run() {
if (statusTextArea != null) {
statusTextArea.setText(line + '\n' + statusTextArea.getText());
}
}
}
);
} | java | protected void writeLine(final String line) {
getContainer().getShell().getDisplay().syncExec(
new Runnable() {
public void run() {
if (statusTextArea != null) {
statusTextArea.setText(line + '\n' + statusTextArea.getText());
}
}
}
);
} | [
"protected",
"void",
"writeLine",
"(",
"final",
"String",
"line",
")",
"{",
"getContainer",
"(",
")",
".",
"getShell",
"(",
")",
".",
"getDisplay",
"(",
")",
".",
"syncExec",
"(",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"... | Writes a line to the status-text-area in the GUI-thread
@param line | [
"Writes",
"a",
"line",
"to",
"the",
"status",
"-",
"text",
"-",
"area",
"in",
"the",
"GUI",
"-",
"thread"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator-eclipse-plugin/soitoolkit-generator-plugin/src/org/soitoolkit/tools/generator/plugin/util/StatusPage.java#L85-L95 | train |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java | LcdsChampionTradeService.attemptTrade | public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
} | java | public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
} | [
"public",
"Object",
"attemptTrade",
"(",
"String",
"summonerInternalName",
",",
"int",
"championId",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"attemptTrade\"",
",",
"summonerInternalName",
",",
"championId",
",",
"false",
")",
";... | Attempt to trade with the target player
@param summonerInternalName The summoner's internal name, as sent by {@link #getPotentialTraders()}
@param championId Unknown - id of sent champion? id of trade?
@return unknown | [
"Attempt",
"to",
"trade",
"with",
"the",
"target",
"player"
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java#L45-L47 | train |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java | LcdsChampionTradeService.acceptTrade | public Object acceptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, true);
} | java | public Object acceptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, true);
} | [
"public",
"Object",
"acceptTrade",
"(",
"String",
"summonerInternalName",
",",
"int",
"championId",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"attemptTrade\"",
",",
"summonerInternalName",
",",
"championId",
",",
"true",
")",
";",... | Accept a trade
@param summonerInternalName The summoner's internal name
@param championId unknown - The id of the sent champion?
@return unknown | [
"Accept",
"a",
"trade"
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java#L63-L65 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java | Controller.getMigrationConfiguration | public MigrationConfiguration getMigrationConfiguration(String configurationName)
throws IOException, LightblueException {
DataFindRequest findRequest = new DataFindRequest("migrationConfiguration", null);
findRequest.where(Query.and(
Query.withValue("configurationName", Quer... | java | public MigrationConfiguration getMigrationConfiguration(String configurationName)
throws IOException, LightblueException {
DataFindRequest findRequest = new DataFindRequest("migrationConfiguration", null);
findRequest.where(Query.and(
Query.withValue("configurationName", Quer... | [
"public",
"MigrationConfiguration",
"getMigrationConfiguration",
"(",
"String",
"configurationName",
")",
"throws",
"IOException",
",",
"LightblueException",
"{",
"DataFindRequest",
"findRequest",
"=",
"new",
"DataFindRequest",
"(",
"\"migrationConfiguration\"",
",",
"null",
... | Read a configuration from the database whose name matches the the given
configuration name | [
"Read",
"a",
"configuration",
"from",
"the",
"database",
"whose",
"name",
"matches",
"the",
"the",
"given",
"configuration",
"name"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java#L92-L102 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java | Controller.loadMigrationConfiguration | public MigrationConfiguration loadMigrationConfiguration(String migrationConfigurationId)
throws IOException, LightblueException {
DataFindRequest findRequest = new DataFindRequest("migrationConfiguration", null);
findRequest.where(Query.withValue("_id", Query.eq, migrationConfigurationId));... | java | public MigrationConfiguration loadMigrationConfiguration(String migrationConfigurationId)
throws IOException, LightblueException {
DataFindRequest findRequest = new DataFindRequest("migrationConfiguration", null);
findRequest.where(Query.withValue("_id", Query.eq, migrationConfigurationId));... | [
"public",
"MigrationConfiguration",
"loadMigrationConfiguration",
"(",
"String",
"migrationConfigurationId",
")",
"throws",
"IOException",
",",
"LightblueException",
"{",
"DataFindRequest",
"findRequest",
"=",
"new",
"DataFindRequest",
"(",
"\"migrationConfiguration\"",
",",
... | Load migration configuration based on its id | [
"Load",
"migration",
"configuration",
"based",
"on",
"its",
"id"
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java#L107-L114 | train |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java | Controller.createControllers | public void createControllers(MigrationConfiguration[] configurations) throws Exception {
for (MigrationConfiguration cfg : configurations) {
MigrationProcess process = migrationMap.get(cfg.get_id());
if (process == null) {
LOGGER.debug("Creating a controller thread for c... | java | public void createControllers(MigrationConfiguration[] configurations) throws Exception {
for (MigrationConfiguration cfg : configurations) {
MigrationProcess process = migrationMap.get(cfg.get_id());
if (process == null) {
LOGGER.debug("Creating a controller thread for c... | [
"public",
"void",
"createControllers",
"(",
"MigrationConfiguration",
"[",
"]",
"configurations",
")",
"throws",
"Exception",
"{",
"for",
"(",
"MigrationConfiguration",
"cfg",
":",
"configurations",
")",
"{",
"MigrationProcess",
"process",
"=",
"migrationMap",
".",
... | Creates controller threads for migrators and consistency checkers based
on the configuration loaded from the db.
For each configuration item, a migrator controller thread is created and
started.
Once created, each thread manages its own lifecycle. If the corresponding
configuration is removed, thread terminates, or i... | [
"Creates",
"controller",
"threads",
"for",
"migrators",
"and",
"consistency",
"checkers",
"based",
"on",
"the",
"configuration",
"loaded",
"from",
"the",
"db",
"."
] | ec20748557b40d1f7851e1816d1b76dae48d2027 | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Controller.java#L154-L176 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/type/tree/provider/OMVRBTreeRIDEntryProvider.java | OMVRBTreeRIDEntryProvider.getKeyAt | public OIdentifiable getKeyAt(final int iIndex) {
if (rids != null && rids[iIndex] != null)
return rids[iIndex];
final ORecordId rid = itemFromStream(iIndex);
if (rids != null)
rids[iIndex] = rid;
return rid;
} | java | public OIdentifiable getKeyAt(final int iIndex) {
if (rids != null && rids[iIndex] != null)
return rids[iIndex];
final ORecordId rid = itemFromStream(iIndex);
if (rids != null)
rids[iIndex] = rid;
return rid;
} | [
"public",
"OIdentifiable",
"getKeyAt",
"(",
"final",
"int",
"iIndex",
")",
"{",
"if",
"(",
"rids",
"!=",
"null",
"&&",
"rids",
"[",
"iIndex",
"]",
"!=",
"null",
")",
"return",
"rids",
"[",
"iIndex",
"]",
";",
"final",
"ORecordId",
"rid",
"=",
"itemFrom... | Lazy unmarshall the RID if not in memory. | [
"Lazy",
"unmarshall",
"the",
"RID",
"if",
"not",
"in",
"memory",
"."
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/type/tree/provider/OMVRBTreeRIDEntryProvider.java#L86-L96 | train |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/metadata/OMetadata.java | OMetadata.close | public void close() {
if (indexManager != null)
indexManager.flush();
if (schema != null)
schema.close();
if (security != null)
security.close();
} | java | public void close() {
if (indexManager != null)
indexManager.flush();
if (schema != null)
schema.close();
if (security != null)
security.close();
} | [
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"indexManager",
"!=",
"null",
")",
"indexManager",
".",
"flush",
"(",
")",
";",
"if",
"(",
"schema",
"!=",
"null",
")",
"schema",
".",
"close",
"(",
")",
";",
"if",
"(",
"security",
"!=",
"null",... | Closes internal objects | [
"Closes",
"internal",
"objects"
] | ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0 | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/metadata/OMetadata.java#L144-L151 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java | RestClient.doHttpSendRequest | public MuleMessage doHttpSendRequest(String url, String method, String payload, String contentType) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Content-Type", contentType);
MuleMessage response = send(url, payload,... | java | public MuleMessage doHttpSendRequest(String url, String method, String payload, String contentType) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Content-Type", contentType);
MuleMessage response = send(url, payload,... | [
"public",
"MuleMessage",
"doHttpSendRequest",
"(",
"String",
"url",
",",
"String",
"method",
",",
"String",
"payload",
",",
"String",
"contentType",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Perform a HTTP call sending information to the server using POST or PUT
@param url
@param method, e.g. "POST" or "PUT"
@param payload
@param contentType
@return
@throws MuleException | [
"Perform",
"a",
"HTTP",
"call",
"sending",
"information",
"to",
"the",
"server",
"using",
"POST",
"or",
"PUT"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java#L159-L168 | train |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java | RestClient.doHttpReceiveRequest | public MuleMessage doHttpReceiveRequest(String url, String method, String acceptConentType, String acceptCharSet) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Accept", acceptConentType);
properties.put("Accept-... | java | public MuleMessage doHttpReceiveRequest(String url, String method, String acceptConentType, String acceptCharSet) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Accept", acceptConentType);
properties.put("Accept-... | [
"public",
"MuleMessage",
"doHttpReceiveRequest",
"(",
"String",
"url",
",",
"String",
"method",
",",
"String",
"acceptConentType",
",",
"String",
"acceptCharSet",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
"=",
"new",
"HashMap",
"<",
"St... | Perform a HTTP call receiving information from the server using GET or DELETE
@param url
@param method, e.g. "GET" or "DELETE"
@param acceptConentType
@param acceptCharSet
@return
@throws MuleException | [
"Perform",
"a",
"HTTP",
"call",
"receiving",
"information",
"from",
"the",
"server",
"using",
"GET",
"or",
"DELETE"
] | e891350dbf55e6307be94d193d056bdb785b37d3 | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java#L180-L190 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream.toByteArray | public byte[] toByteArray() {
if (this.pos == this.length)
return this.buffer;
else {
byte[] res = new byte[this.pos];
System.arraycopy(this.buffer, 0, res, 0, this.pos);
return res;
}
} | java | public byte[] toByteArray() {
if (this.pos == this.length)
return this.buffer;
else {
byte[] res = new byte[this.pos];
System.arraycopy(this.buffer, 0, res, 0, this.pos);
return res;
}
} | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"if",
"(",
"this",
".",
"pos",
"==",
"this",
".",
"length",
")",
"return",
"this",
".",
"buffer",
";",
"else",
"{",
"byte",
"[",
"]",
"res",
"=",
"new",
"byte",
"[",
"this",
".",
"pos",
... | Returns the written to the stream data as a byte array
@return | [
"Returns",
"the",
"written",
"to",
"the",
"stream",
"data",
"as",
"a",
"byte",
"array"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L64-L73 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream.write | @Override
public void write(byte[] b, int off, int len) {
this.checkIncreaseArray(len);
System.arraycopy(b, off, this.buffer, this.pos, len);
this.pos += len;
} | java | @Override
public void write(byte[] b, int off, int len) {
this.checkIncreaseArray(len);
System.arraycopy(b, off, this.buffer, this.pos, len);
this.pos += len;
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"this",
".",
"checkIncreaseArray",
"(",
"len",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"off",
",",
"this",
".",
"... | Writes a byte array content into the stream
@param b
@param off
@param len | [
"Writes",
"a",
"byte",
"array",
"content",
"into",
"the",
"stream"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L123-L128 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream.writeTag | public void writeTag(int tagClass, boolean primitive, int tag) throws AsnException {
if (tag < 0)
throw new AsnException("Tag must not be negative");
if (tag <= 30) {
int toEncode = (tagClass & 0x03) << 6;
toEncode |= (primitive ? 0 : 1) << 5;
toEncode |= tag & 0x1F;
this.write(toEn... | java | public void writeTag(int tagClass, boolean primitive, int tag) throws AsnException {
if (tag < 0)
throw new AsnException("Tag must not be negative");
if (tag <= 30) {
int toEncode = (tagClass & 0x03) << 6;
toEncode |= (primitive ? 0 : 1) << 5;
toEncode |= tag & 0x1F;
this.write(toEn... | [
"public",
"void",
"writeTag",
"(",
"int",
"tagClass",
",",
"boolean",
"primitive",
",",
"int",
"tag",
")",
"throws",
"AsnException",
"{",
"if",
"(",
"tag",
"<",
"0",
")",
"throw",
"new",
"AsnException",
"(",
"\"Tag must not be negative\"",
")",
";",
"if",
... | Writes a tag field into the atream
@param tagClass
@param primitive
@param tag
@throws AsnException | [
"Writes",
"a",
"tag",
"field",
"into",
"the",
"atream"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L149-L188 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream.writeLength | public void writeLength(int v) throws IOException {
if (v == Tag.Indefinite_Length) {
this.write(0x80);
return;
} else if (v > 0x7F) {
int count;
byte[] buf = new byte[4];
if ((v & 0xFF000000) > 0) {
buf[0] = (byte)((v >> 24) & 0xFF);
... | java | public void writeLength(int v) throws IOException {
if (v == Tag.Indefinite_Length) {
this.write(0x80);
return;
} else if (v > 0x7F) {
int count;
byte[] buf = new byte[4];
if ((v & 0xFF000000) > 0) {
buf[0] = (byte)((v >> 24) & 0xFF);
... | [
"public",
"void",
"writeLength",
"(",
"int",
"v",
")",
"throws",
"IOException",
"{",
"if",
"(",
"v",
"==",
"Tag",
".",
"Indefinite_Length",
")",
"{",
"this",
".",
"write",
"(",
"0x80",
")",
";",
"return",
";",
"}",
"else",
"if",
"(",
"v",
">",
"0x7... | Write the length field into the stream
Use Tag.Indefinite_Length for writing the indefinite length
@param v
@throws IOException | [
"Write",
"the",
"length",
"field",
"into",
"the",
"stream",
"Use",
"Tag",
".",
"Indefinite_Length",
"for",
"writing",
"the",
"indefinite",
"length"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L197-L240 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream.FinalizeContent | public void FinalizeContent( int lenPos ) {
if (lenPos == Tag.Indefinite_Length) {
this.write(0);
this.write(0);
} else {
int length = this.pos - lenPos - 1;
if (length <= 0x7F) {
this.buffer[lenPos] = (byte) length;
} else {
int count;
byte[] buf = new byte[4];
... | java | public void FinalizeContent( int lenPos ) {
if (lenPos == Tag.Indefinite_Length) {
this.write(0);
this.write(0);
} else {
int length = this.pos - lenPos - 1;
if (length <= 0x7F) {
this.buffer[lenPos] = (byte) length;
} else {
int count;
byte[] buf = new byte[4];
... | [
"public",
"void",
"FinalizeContent",
"(",
"int",
"lenPos",
")",
"{",
"if",
"(",
"lenPos",
"==",
"Tag",
".",
"Indefinite_Length",
")",
"{",
"this",
".",
"write",
"(",
"0",
")",
";",
"this",
".",
"write",
"(",
"0",
")",
";",
"}",
"else",
"{",
"int",
... | This method must be invoked after finishing the content writing
@param lenPos
This parameter is the the return value of the
StartContentDefiniteLength() or StartContentIndefiniteLength()
methods | [
"This",
"method",
"must",
"be",
"invoked",
"after",
"finishing",
"the",
"content",
"writing"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L279-L323 | train |
RestComm/jasn | asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java | AsnOutputStream._getByte | private static byte _getByte(int startIndex, BitSetStrictLength set)
throws AsnException {
int count = 8;
byte data = 0;
// if (set.length() - 1 < startIndex) {
// throw new AsnException();
// }
while (count > 0) {
if (set.length() - 1 < startIndex) {
break;
} else {
boolean ... | java | private static byte _getByte(int startIndex, BitSetStrictLength set)
throws AsnException {
int count = 8;
byte data = 0;
// if (set.length() - 1 < startIndex) {
// throw new AsnException();
// }
while (count > 0) {
if (set.length() - 1 < startIndex) {
break;
} else {
boolean ... | [
"private",
"static",
"byte",
"_getByte",
"(",
"int",
"startIndex",
",",
"BitSetStrictLength",
"set",
")",
"throws",
"AsnException",
"{",
"int",
"count",
"=",
"8",
";",
"byte",
"data",
"=",
"0",
";",
"//\t\tif (set.length() - 1 < startIndex) {\r",
"//\t\t\tthrow new ... | Attepts to read up to 8 bits and store into byte. If less is found, only
those are returned
@param startIndex
@param set
@return
@throws AsnException | [
"Attepts",
"to",
"read",
"up",
"to",
"8",
"bits",
"and",
"store",
"into",
"byte",
".",
"If",
"less",
"is",
"found",
"only",
"those",
"are",
"returned"
] | 3b2ec7709ba27f888114eaf47e2cd51ed8042e65 | https://github.com/RestComm/jasn/blob/3b2ec7709ba27f888114eaf47e2cd51ed8042e65/asn-impl/src/main/java/org/mobicents/protocols/asn/AsnOutputStream.java#L589-L614 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.