id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,100 | Waikato/moa | moa/src/main/java/moa/clusterers/CobWeb.java | CobWeb.determineNumberOfClusters | protected void determineNumberOfClusters() {
if (!m_numberOfClustersDetermined
&& (m_cobwebTree != null)) {
int[] numClusts = new int[1];
numClusts[0] = 0;
// try {
m_cobwebTree.assignClusterNums(numClusts);
// }
// catch (... | java | protected void determineNumberOfClusters() {
if (!m_numberOfClustersDetermined
&& (m_cobwebTree != null)) {
int[] numClusts = new int[1];
numClusts[0] = 0;
// try {
m_cobwebTree.assignClusterNums(numClusts);
// }
// catch (... | [
"protected",
"void",
"determineNumberOfClusters",
"(",
")",
"{",
"if",
"(",
"!",
"m_numberOfClustersDetermined",
"&&",
"(",
"m_cobwebTree",
"!=",
"null",
")",
")",
"{",
"int",
"[",
"]",
"numClusts",
"=",
"new",
"int",
"[",
"1",
"]",
";",
"numClusts",
"[",
... | determines the number of clusters if necessary
@see #m_numberOfClusters
@see #m_numberOfClustersDetermined | [
"determines",
"the",
"number",
"of",
"clusters",
"if",
"necessary"
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/CobWeb.java#L852-L868 |
29,101 | Waikato/moa | moa/src/main/java/moa/clusterers/CobWeb.java | CobWeb.graph | public String graph() {// throws Exception {
StringBuffer text = new StringBuffer();
text.append("digraph CobwebTree {\n");
m_cobwebTree.graphTree(text);
text.append("}\n");
return text.toString();
} | java | public String graph() {// throws Exception {
StringBuffer text = new StringBuffer();
text.append("digraph CobwebTree {\n");
m_cobwebTree.graphTree(text);
text.append("}\n");
return text.toString();
} | [
"public",
"String",
"graph",
"(",
")",
"{",
"// throws Exception {",
"StringBuffer",
"text",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"text",
".",
"append",
"(",
"\"digraph CobwebTree {\\n\"",
")",
";",
"m_cobwebTree",
".",
"graphTree",
"(",
"text",
")",
";"... | Generates the graph string of the Cobweb tree
@return a <code>String</code> value
@throws Exception if an error occurs | [
"Generates",
"the",
"graph",
"string",
"of",
"the",
"Cobweb",
"tree"
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/CobWeb.java#L916-L923 |
29,102 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java | EuclideanDistance.sqDifference | public double sqDifference(int index, double val1, double val2) {
double val = difference(index, val1, val2);
return val*val;
} | java | public double sqDifference(int index, double val1, double val2) {
double val = difference(index, val1, val2);
return val*val;
} | [
"public",
"double",
"sqDifference",
"(",
"int",
"index",
",",
"double",
"val1",
",",
"double",
"val2",
")",
"{",
"double",
"val",
"=",
"difference",
"(",
"index",
",",
"val1",
",",
"val2",
")",
";",
"return",
"val",
"*",
"val",
";",
"}"
] | Returns the squared difference of two values of an attribute.
@param index the attribute index
@param val1 the first value
@param val2 the second value
@return the squared difference | [
"Returns",
"the",
"squared",
"difference",
"of",
"two",
"values",
"of",
"an",
"attribute",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java#L171-L174 |
29,103 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java | EuclideanDistance.closestPoint | public int closestPoint(Instance instance, Instances allPoints,
int[] pointList) throws Exception {
double minDist = Integer.MAX_VALUE;
int bestPoint = 0;
for (int i = 0; i < pointList.length; i++) {
double dist = distance(instance, allPoints.instance(pointList[i]), Double.POSITIVE_INFINITY... | java | public int closestPoint(Instance instance, Instances allPoints,
int[] pointList) throws Exception {
double minDist = Integer.MAX_VALUE;
int bestPoint = 0;
for (int i = 0; i < pointList.length; i++) {
double dist = distance(instance, allPoints.instance(pointList[i]), Double.POSITIVE_INFINITY... | [
"public",
"int",
"closestPoint",
"(",
"Instance",
"instance",
",",
"Instances",
"allPoints",
",",
"int",
"[",
"]",
"pointList",
")",
"throws",
"Exception",
"{",
"double",
"minDist",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"int",
"bestPoint",
"=",
"0",
";",
... | Returns the index of the closest point to the current instance.
Index is index in Instances object that is the second parameter.
@param instance the instance to assign a cluster to
@param allPoints all points
@param pointList the list of points
@return the index of the closest point
@throws Exception if something... | [
"Returns",
"the",
"index",
"of",
"the",
"closest",
"point",
"to",
"the",
"current",
"instance",
".",
"Index",
"is",
"index",
"in",
"Instances",
"object",
"that",
"is",
"the",
"second",
"parameter",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java#L198-L210 |
29,104 | Waikato/moa | moa/src/main/java/moa/gui/experimentertab/TaskManagerTabPanel.java | TaskManagerTabPanel.openConfig | public void openConfig(String path) {
Properties properties = new Properties();
try {
properties.load(new FileInputStream(path));
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, "Problems reading the properties file",
"Error", JOptionPa... | java | public void openConfig(String path) {
Properties properties = new Properties();
try {
properties.load(new FileInputStream(path));
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, "Problems reading the properties file",
"Error", JOptionPa... | [
"public",
"void",
"openConfig",
"(",
"String",
"path",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"properties",
".",
"load",
"(",
"new",
"FileInputStream",
"(",
"path",
")",
")",
";",
"}",
"catch",
"(",
"... | Opens a previously saved configuration
@param path | [
"Opens",
"a",
"previously",
"saved",
"configuration"
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/experimentertab/TaskManagerTabPanel.java#L1281-L1313 |
29,105 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.initializeAttributeIndices | protected void initializeAttributeIndices() {
//m_AttributeIndices.setUpper(m_Data.numAttributes() - 1);
m_ActiveIndices = new boolean[m_Data.numAttributes()];
for (int i = 0; i < m_ActiveIndices.length; i++)
m_ActiveIndices[i] = true; //m_AttributeIndices.isInRange(i);
} | java | protected void initializeAttributeIndices() {
//m_AttributeIndices.setUpper(m_Data.numAttributes() - 1);
m_ActiveIndices = new boolean[m_Data.numAttributes()];
for (int i = 0; i < m_ActiveIndices.length; i++)
m_ActiveIndices[i] = true; //m_AttributeIndices.isInRange(i);
} | [
"protected",
"void",
"initializeAttributeIndices",
"(",
")",
"{",
"//m_AttributeIndices.setUpper(m_Data.numAttributes() - 1);",
"m_ActiveIndices",
"=",
"new",
"boolean",
"[",
"m_Data",
".",
"numAttributes",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | initializes the attribute indices. | [
"initializes",
"the",
"attribute",
"indices",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L221-L226 |
29,106 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.norm | protected double norm(double x, int i) {
if (Double.isNaN(m_Ranges[i][R_MIN]) || (m_Ranges[i][R_MAX] == m_Ranges[i][R_MIN]))
return 0;
else
return (x - m_Ranges[i][R_MIN]) / (m_Ranges[i][R_WIDTH]);
} | java | protected double norm(double x, int i) {
if (Double.isNaN(m_Ranges[i][R_MIN]) || (m_Ranges[i][R_MAX] == m_Ranges[i][R_MIN]))
return 0;
else
return (x - m_Ranges[i][R_MIN]) / (m_Ranges[i][R_WIDTH]);
} | [
"protected",
"double",
"norm",
"(",
"double",
"x",
",",
"int",
"i",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"m_Ranges",
"[",
"i",
"]",
"[",
"R_MIN",
"]",
")",
"||",
"(",
"m_Ranges",
"[",
"i",
"]",
"[",
"R_MAX",
"]",
"==",
"m_Ranges",
... | Normalizes a given value of a numeric attribute.
@param x the value to be normalized
@param i the attribute's index
@return the normalized value | [
"Normalizes",
"a",
"given",
"value",
"of",
"a",
"numeric",
"attribute",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L380-L385 |
29,107 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.difference | protected double difference(int index, double val1, double val2) {
//switch (m_Data.attribute(index).type()) {
//case Attribute.NOMINAL:
if (m_Data.attribute(index).isNominal() == true){
if (isMissingValue(val1) ||
isMissingValue(val2) ||
((int) val1 != (int) val2)) {
... | java | protected double difference(int index, double val1, double val2) {
//switch (m_Data.attribute(index).type()) {
//case Attribute.NOMINAL:
if (m_Data.attribute(index).isNominal() == true){
if (isMissingValue(val1) ||
isMissingValue(val2) ||
((int) val1 != (int) val2)) {
... | [
"protected",
"double",
"difference",
"(",
"int",
"index",
",",
"double",
"val1",
",",
"double",
"val2",
")",
"{",
"//switch (m_Data.attribute(index).type()) {",
"//case Attribute.NOMINAL:",
"if",
"(",
"m_Data",
".",
"attribute",
"(",
"index",
")",
".",
"isNominal",
... | Computes the difference between two given attribute
values.
@param index the attribute index
@param val1 the first value
@param val2 the second value
@return the difference | [
"Computes",
"the",
"difference",
"between",
"two",
"given",
"attribute",
"values",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L396-L448 |
29,108 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.initializeRanges | public double[][] initializeRanges() {
if (m_Data == null) {
m_Ranges = null;
return m_Ranges;
}
int numAtt = m_Data.numAttributes();
double[][] ranges = new double [numAtt][3];
if (m_Data.numInstances() <= 0) {
initializeRangesEmpty(numAtt, ranges);
m_Ranges = rang... | java | public double[][] initializeRanges() {
if (m_Data == null) {
m_Ranges = null;
return m_Ranges;
}
int numAtt = m_Data.numAttributes();
double[][] ranges = new double [numAtt][3];
if (m_Data.numInstances() <= 0) {
initializeRangesEmpty(numAtt, ranges);
m_Ranges = rang... | [
"public",
"double",
"[",
"]",
"[",
"]",
"initializeRanges",
"(",
")",
"{",
"if",
"(",
"m_Data",
"==",
"null",
")",
"{",
"m_Ranges",
"=",
"null",
";",
"return",
"m_Ranges",
";",
"}",
"int",
"numAtt",
"=",
"m_Data",
".",
"numAttributes",
"(",
")",
";",... | Initializes the ranges using all instances of the dataset.
Sets m_Ranges.
@return the ranges | [
"Initializes",
"the",
"ranges",
"using",
"all",
"instances",
"of",
"the",
"dataset",
".",
"Sets",
"m_Ranges",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L456-L482 |
29,109 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.updateRangesFirst | public void updateRangesFirst(Instance instance, int numAtt, double[][] ranges) {
for (int j = 0; j < numAtt; j++) {
if (!instance.isMissing(j)) {
ranges[j][R_MIN] = instance.value(j);
ranges[j][R_MAX] = instance.value(j);
ranges[j][R_WIDTH] = 0.0;
}
else { // if value was ... | java | public void updateRangesFirst(Instance instance, int numAtt, double[][] ranges) {
for (int j = 0; j < numAtt; j++) {
if (!instance.isMissing(j)) {
ranges[j][R_MIN] = instance.value(j);
ranges[j][R_MAX] = instance.value(j);
ranges[j][R_WIDTH] = 0.0;
}
else { // if value was ... | [
"public",
"void",
"updateRangesFirst",
"(",
"Instance",
"instance",
",",
"int",
"numAtt",
",",
"double",
"[",
"]",
"[",
"]",
"ranges",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"numAtt",
";",
"j",
"++",
")",
"{",
"if",
"(",
"!",
... | Used to initialize the ranges. For this the values of the first
instance is used to save time.
Sets low and high to the values of the first instance and
width to zero.
@param instance the new instance
@param numAtt number of attributes in the model
@param ranges low, high and width values for all attributes | [
"Used",
"to",
"initialize",
"the",
"ranges",
".",
"For",
"this",
"the",
"values",
"of",
"the",
"first",
"instance",
"is",
"used",
"to",
"save",
"time",
".",
"Sets",
"low",
"and",
"high",
"to",
"the",
"values",
"of",
"the",
"first",
"instance",
"and",
"... | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L494-L507 |
29,110 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.initializeRangesEmpty | public void initializeRangesEmpty(int numAtt, double[][] ranges) {
for (int j = 0; j < numAtt; j++) {
ranges[j][R_MIN] = Double.POSITIVE_INFINITY;
ranges[j][R_MAX] = -Double.POSITIVE_INFINITY;
ranges[j][R_WIDTH] = Double.POSITIVE_INFINITY;
}
} | java | public void initializeRangesEmpty(int numAtt, double[][] ranges) {
for (int j = 0; j < numAtt; j++) {
ranges[j][R_MIN] = Double.POSITIVE_INFINITY;
ranges[j][R_MAX] = -Double.POSITIVE_INFINITY;
ranges[j][R_WIDTH] = Double.POSITIVE_INFINITY;
}
} | [
"public",
"void",
"initializeRangesEmpty",
"(",
"int",
"numAtt",
",",
"double",
"[",
"]",
"[",
"]",
"ranges",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"numAtt",
";",
"j",
"++",
")",
"{",
"ranges",
"[",
"j",
"]",
"[",
"R_MIN",
... | Used to initialize the ranges.
@param numAtt number of attributes in the model
@param ranges low, high and width values for all attributes | [
"Used",
"to",
"initialize",
"the",
"ranges",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L546-L552 |
29,111 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.updateRanges | public double[][] updateRanges(Instance instance, double[][] ranges) {
// updateRangesFirst must have been called on ranges
for (int j = 0; j < ranges.length; j++) {
double value = instance.value(j);
if (!instance.isMissing(j)) {
if (value < ranges[j][R_MIN]) {
ranges[j][R_MIN] = v... | java | public double[][] updateRanges(Instance instance, double[][] ranges) {
// updateRangesFirst must have been called on ranges
for (int j = 0; j < ranges.length; j++) {
double value = instance.value(j);
if (!instance.isMissing(j)) {
if (value < ranges[j][R_MIN]) {
ranges[j][R_MIN] = v... | [
"public",
"double",
"[",
"]",
"[",
"]",
"updateRanges",
"(",
"Instance",
"instance",
",",
"double",
"[",
"]",
"[",
"]",
"ranges",
")",
"{",
"// updateRangesFirst must have been called on ranges",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"ranges",
"... | Updates the ranges given a new instance.
@param instance the new instance
@param ranges low, high and width values for all attributes
@return the updated ranges | [
"Updates",
"the",
"ranges",
"given",
"a",
"new",
"instance",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L561-L579 |
29,112 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.initializeRanges | public double[][] initializeRanges(int[] instList) throws Exception {
if (m_Data == null)
throw new Exception("No instances supplied.");
int numAtt = m_Data.numAttributes();
double[][] ranges = new double [numAtt][3];
if (m_Data.numInstances() <= 0) {
initializeRangesEmpty(numAtt, ... | java | public double[][] initializeRanges(int[] instList) throws Exception {
if (m_Data == null)
throw new Exception("No instances supplied.");
int numAtt = m_Data.numAttributes();
double[][] ranges = new double [numAtt][3];
if (m_Data.numInstances() <= 0) {
initializeRangesEmpty(numAtt, ... | [
"public",
"double",
"[",
"]",
"[",
"]",
"initializeRanges",
"(",
"int",
"[",
"]",
"instList",
")",
"throws",
"Exception",
"{",
"if",
"(",
"m_Data",
"==",
"null",
")",
"throw",
"new",
"Exception",
"(",
"\"No instances supplied.\"",
")",
";",
"int",
"numAtt"... | Initializes the ranges of a subset of the instances of this dataset.
Therefore m_Ranges is not set.
@param instList list of indexes of the subset
@return the ranges
@throws Exception if something goes wrong | [
"Initializes",
"the",
"ranges",
"of",
"a",
"subset",
"of",
"the",
"instances",
"of",
"this",
"dataset",
".",
"Therefore",
"m_Ranges",
"is",
"not",
"set",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L589-L609 |
29,113 | Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.inRanges | public boolean inRanges(Instance instance, double[][] ranges) {
boolean isIn = true;
// updateRangesFirst must have been called on ranges
for (int j = 0; isIn && (j < ranges.length); j++) {
if (!instance.isMissing(j)) {
double value = instance.value(j);
isIn = value <= ranges[j][R... | java | public boolean inRanges(Instance instance, double[][] ranges) {
boolean isIn = true;
// updateRangesFirst must have been called on ranges
for (int j = 0; isIn && (j < ranges.length); j++) {
if (!instance.isMissing(j)) {
double value = instance.value(j);
isIn = value <= ranges[j][R... | [
"public",
"boolean",
"inRanges",
"(",
"Instance",
"instance",
",",
"double",
"[",
"]",
"[",
"]",
"ranges",
")",
"{",
"boolean",
"isIn",
"=",
"true",
";",
"// updateRangesFirst must have been called on ranges",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"isIn",
"... | Test if an instance is within the given ranges.
@param instance the instance
@param ranges the ranges the instance is tested to be in
@return true if instance is within the ranges | [
"Test",
"if",
"an",
"instance",
"is",
"within",
"the",
"given",
"ranges",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L665-L678 |
29,114 | AgNO3/jcifs-ng | src/main/java/jcifs/http/Handler.java | Handler.setURLStreamHandlerFactory | public static void setURLStreamHandlerFactory ( URLStreamHandlerFactory factory ) {
synchronized ( PROTOCOL_HANDLERS ) {
if ( Handler.factory != null ) {
throw new IllegalStateException("URLStreamHandlerFactory already set.");
}
PROTOCOL_HANDLERS.clear();
... | java | public static void setURLStreamHandlerFactory ( URLStreamHandlerFactory factory ) {
synchronized ( PROTOCOL_HANDLERS ) {
if ( Handler.factory != null ) {
throw new IllegalStateException("URLStreamHandlerFactory already set.");
}
PROTOCOL_HANDLERS.clear();
... | [
"public",
"static",
"void",
"setURLStreamHandlerFactory",
"(",
"URLStreamHandlerFactory",
"factory",
")",
"{",
"synchronized",
"(",
"PROTOCOL_HANDLERS",
")",
"{",
"if",
"(",
"Handler",
".",
"factory",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
... | Sets the URL stream handler factory for the environment. This
allows specification of the factory used in creating underlying
stream handlers. This can be called once per JVM instance.
@param factory
The URL stream handler factory. | [
"Sets",
"the",
"URL",
"stream",
"handler",
"factory",
"for",
"the",
"environment",
".",
"This",
"allows",
"specification",
"of",
"the",
"factory",
"used",
"in",
"creating",
"underlying",
"stream",
"handlers",
".",
"This",
"can",
"be",
"called",
"once",
"per",
... | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/http/Handler.java#L86-L94 |
29,115 | AgNO3/jcifs-ng | src/main/java/jcifs/dcerpc/DcerpcHandle.java | DcerpcHandle.bind | public void bind () throws DcerpcException, IOException {
synchronized ( this ) {
try {
this.state = 1;
DcerpcMessage bind = new DcerpcBind(this.binding, this);
sendrecv(bind);
}
catch ( IOException ioe ) {
this.... | java | public void bind () throws DcerpcException, IOException {
synchronized ( this ) {
try {
this.state = 1;
DcerpcMessage bind = new DcerpcBind(this.binding, this);
sendrecv(bind);
}
catch ( IOException ioe ) {
this.... | [
"public",
"void",
"bind",
"(",
")",
"throws",
"DcerpcException",
",",
"IOException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"try",
"{",
"this",
".",
"state",
"=",
"1",
";",
"DcerpcMessage",
"bind",
"=",
"new",
"DcerpcBind",
"(",
"this",
".",
"bindin... | Bind the handle
@throws DcerpcException
@throws IOException | [
"Bind",
"the",
"handle"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/dcerpc/DcerpcHandle.java#L212-L224 |
29,116 | AgNO3/jcifs-ng | src/main/java/jcifs/smb/SmbFile.java | SmbFile.list | public String[] list () throws SmbException {
return SmbEnumerationUtil.list(this, "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null);
} | java | public String[] list () throws SmbException {
return SmbEnumerationUtil.list(this, "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null);
} | [
"public",
"String",
"[",
"]",
"list",
"(",
")",
"throws",
"SmbException",
"{",
"return",
"SmbEnumerationUtil",
".",
"list",
"(",
"this",
",",
"\"*\"",
",",
"ATTR_DIRECTORY",
"|",
"ATTR_HIDDEN",
"|",
"ATTR_SYSTEM",
",",
"null",
",",
"null",
")",
";",
"}"
] | List the contents of this SMB resource. The list returned by this
method will be;
<ul>
<li>files and directories contained within this resource if the
resource is a normal disk file directory,
<li>all available NetBIOS workgroups or domains if this resource is
the top level URL <code>smb://</code>,
<li>all servers reg... | [
"List",
"the",
"contents",
"of",
"this",
"SMB",
"resource",
".",
"The",
"list",
"returned",
"by",
"this",
"method",
"will",
"be",
";"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/SmbFile.java#L1140-L1142 |
29,117 | AgNO3/jcifs-ng | src/main/java/jcifs/internal/smb1/SMB1SigningDigest.java | SMB1SigningDigest.update | public void update ( byte[] input, int offset, int len ) {
if ( log.isTraceEnabled() ) {
log.trace("update: " + this.updates + " " + offset + ":" + len);
log.trace(Hexdump.toHexString(input, offset, Math.min(len, 256)));
}
if ( len == 0 ) {
return; /* CRITICAL... | java | public void update ( byte[] input, int offset, int len ) {
if ( log.isTraceEnabled() ) {
log.trace("update: " + this.updates + " " + offset + ":" + len);
log.trace(Hexdump.toHexString(input, offset, Math.min(len, 256)));
}
if ( len == 0 ) {
return; /* CRITICAL... | [
"public",
"void",
"update",
"(",
"byte",
"[",
"]",
"input",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"log",
".",
"trace",
"(",
"\"update: \"",
"+",
"this",
".",
"updates",
"+",
... | Update digest with data
@param input
@param offset
@param len | [
"Update",
"digest",
"with",
"data"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/internal/smb1/SMB1SigningDigest.java#L161-L171 |
29,118 | AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/Type3Message.java | Type3Message.setupMIC | public void setupMIC ( byte[] type1, byte[] type2 ) throws GeneralSecurityException, IOException {
byte[] sk = this.masterKey;
if ( sk == null ) {
return;
}
MessageDigest mac = Crypto.getHMACT64(sk);
mac.update(type1);
mac.update(type2);
byte[] type3 =... | java | public void setupMIC ( byte[] type1, byte[] type2 ) throws GeneralSecurityException, IOException {
byte[] sk = this.masterKey;
if ( sk == null ) {
return;
}
MessageDigest mac = Crypto.getHMACT64(sk);
mac.update(type1);
mac.update(type2);
byte[] type3 =... | [
"public",
"void",
"setupMIC",
"(",
"byte",
"[",
"]",
"type1",
",",
"byte",
"[",
"]",
"type2",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"byte",
"[",
"]",
"sk",
"=",
"this",
".",
"masterKey",
";",
"if",
"(",
"sk",
"==",
"null",... | Sets the MIC
@param type1
@param type2
@throws GeneralSecurityException
@throws IOException | [
"Sets",
"the",
"MIC"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/Type3Message.java#L297-L308 |
29,119 | AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/Type3Message.java | Type3Message.getDefaultFlags | public static int getDefaultFlags ( CIFSContext tc ) {
return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION
| ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM );
} | java | public static int getDefaultFlags ( CIFSContext tc ) {
return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION
| ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM );
} | [
"public",
"static",
"int",
"getDefaultFlags",
"(",
"CIFSContext",
"tc",
")",
"{",
"return",
"NTLMSSP_NEGOTIATE_NTLM",
"|",
"NTLMSSP_NEGOTIATE_VERSION",
"|",
"(",
"tc",
".",
"getConfig",
"(",
")",
".",
"isUseUnicode",
"(",
")",
"?",
"NTLMSSP_NEGOTIATE_UNICODE",
":"... | Returns the default flags for a generic Type-3 message in the
current environment.
@param tc
context to use
@return An <code>int</code> containing the default flags. | [
"Returns",
"the",
"default",
"flags",
"for",
"a",
"generic",
"Type",
"-",
"3",
"message",
"in",
"the",
"current",
"environment",
"."
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/Type3Message.java#L359-L362 |
29,120 | AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/av/AvPairs.java | AvPairs.decode | public static List<AvPair> decode ( byte[] data ) throws CIFSException {
List<AvPair> pairs = new LinkedList<>();
int pos = 0;
boolean foundEnd = false;
while ( pos + 4 <= data.length ) {
int avId = SMBUtil.readInt2(data, pos);
int avLen = SMBUtil.readInt2(data, p... | java | public static List<AvPair> decode ( byte[] data ) throws CIFSException {
List<AvPair> pairs = new LinkedList<>();
int pos = 0;
boolean foundEnd = false;
while ( pos + 4 <= data.length ) {
int avId = SMBUtil.readInt2(data, pos);
int avLen = SMBUtil.readInt2(data, p... | [
"public",
"static",
"List",
"<",
"AvPair",
">",
"decode",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"CIFSException",
"{",
"List",
"<",
"AvPair",
">",
"pairs",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"int",
"pos",
"=",
"0",
";",
"boolean",
... | Decode a list of AvPairs
@param data
@return individual pairs
@throws CIFSException | [
"Decode",
"a",
"list",
"of",
"AvPairs"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/av/AvPairs.java#L45-L72 |
29,121 | AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/av/AvPairs.java | AvPairs.remove | public static void remove ( List<AvPair> pairs, int type ) {
Iterator<AvPair> it = pairs.iterator();
while ( it.hasNext() ) {
AvPair p = it.next();
if ( p.getType() == type ) {
it.remove();
}
}
} | java | public static void remove ( List<AvPair> pairs, int type ) {
Iterator<AvPair> it = pairs.iterator();
while ( it.hasNext() ) {
AvPair p = it.next();
if ( p.getType() == type ) {
it.remove();
}
}
} | [
"public",
"static",
"void",
"remove",
"(",
"List",
"<",
"AvPair",
">",
"pairs",
",",
"int",
"type",
")",
"{",
"Iterator",
"<",
"AvPair",
">",
"it",
"=",
"pairs",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"... | Remove all occurances of the given type
@param pairs
@param type | [
"Remove",
"all",
"occurances",
"of",
"the",
"given",
"type"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/av/AvPairs.java#L118-L126 |
29,122 | AgNO3/jcifs-ng | src/main/java/jcifs/ntlmssp/av/AvPairs.java | AvPairs.replace | public static void replace ( List<AvPair> pairs, AvPair rep ) {
remove(pairs, rep.getType());
pairs.add(rep);
} | java | public static void replace ( List<AvPair> pairs, AvPair rep ) {
remove(pairs, rep.getType());
pairs.add(rep);
} | [
"public",
"static",
"void",
"replace",
"(",
"List",
"<",
"AvPair",
">",
"pairs",
",",
"AvPair",
"rep",
")",
"{",
"remove",
"(",
"pairs",
",",
"rep",
".",
"getType",
"(",
")",
")",
";",
"pairs",
".",
"add",
"(",
"rep",
")",
";",
"}"
] | Replace all occurances of the given type
@param pairs
@param rep | [
"Replace",
"all",
"occurances",
"of",
"the",
"given",
"type"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/ntlmssp/av/AvPairs.java#L135-L138 |
29,123 | AgNO3/jcifs-ng | src/main/java/jcifs/smb/SmbFileOutputStream.java | SmbFileOutputStream.close | @Override
public void close () throws IOException {
try {
if ( this.handle.isValid() ) {
this.handle.close();
}
}
finally {
this.file.clearAttributeCache();
this.tmp = null;
}
} | java | @Override
public void close () throws IOException {
try {
if ( this.handle.isValid() ) {
this.handle.close();
}
}
finally {
this.file.clearAttributeCache();
this.tmp = null;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"handle",
".",
"isValid",
"(",
")",
")",
"{",
"this",
".",
"handle",
".",
"close",
"(",
")",
";",
"}",
"}",
"finally",
"{",
"t... | Closes this output stream and releases any system resources associated
with it.
@throws IOException
if a network error occurs | [
"Closes",
"this",
"output",
"stream",
"and",
"releases",
"any",
"system",
"resources",
"associated",
"with",
"it",
"."
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/SmbFileOutputStream.java#L199-L210 |
29,124 | AgNO3/jcifs-ng | src/main/java/jcifs/smb/SmbSessionImpl.java | SmbSessionImpl.treeConnectLogon | @Override
public void treeConnectLogon () throws SmbException {
String logonShare = getContext().getConfig().getLogonShare();
if ( logonShare == null || logonShare.isEmpty() ) {
throw new SmbException("Logon share is not defined");
}
try ( SmbTreeImpl t = getSmbTree(logon... | java | @Override
public void treeConnectLogon () throws SmbException {
String logonShare = getContext().getConfig().getLogonShare();
if ( logonShare == null || logonShare.isEmpty() ) {
throw new SmbException("Logon share is not defined");
}
try ( SmbTreeImpl t = getSmbTree(logon... | [
"@",
"Override",
"public",
"void",
"treeConnectLogon",
"(",
")",
"throws",
"SmbException",
"{",
"String",
"logonShare",
"=",
"getContext",
"(",
")",
".",
"getConfig",
"(",
")",
".",
"getLogonShare",
"(",
")",
";",
"if",
"(",
"logonShare",
"==",
"null",
"||... | Establish a tree connection with the configured logon share
@throws SmbException | [
"Establish",
"a",
"tree",
"connection",
"with",
"the",
"configured",
"logon",
"share"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/SmbSessionImpl.java#L280-L292 |
29,125 | AgNO3/jcifs-ng | src/main/java/jcifs/util/transport/Transport.java | Transport.readn | public static int readn ( InputStream in, byte[] b, int off, int len ) throws IOException {
int i = 0, n = -5;
if ( off + len > b.length ) {
throw new IOException("Buffer too short, bufsize " + b.length + " read " + len);
}
while ( i < len ) {
n = in.read(b, off... | java | public static int readn ( InputStream in, byte[] b, int off, int len ) throws IOException {
int i = 0, n = -5;
if ( off + len > b.length ) {
throw new IOException("Buffer too short, bufsize " + b.length + " read " + len);
}
while ( i < len ) {
n = in.read(b, off... | [
"public",
"static",
"int",
"readn",
"(",
"InputStream",
"in",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"-",
"5",
";",
"if",
"(",
"off",
"+",
"len",... | Read bytes from the input stream into a buffer
@param in
@param b
@param off
@param len
@return number of bytes read
@throws IOException | [
"Read",
"bytes",
"from",
"the",
"input",
"stream",
"into",
"a",
"buffer"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/util/transport/Transport.java#L62-L78 |
29,126 | AgNO3/jcifs-ng | src/main/java/jcifs/util/transport/Transport.java | Transport.sendrecv | public <T extends Response> T sendrecv ( Request request, T response, Set<RequestParam> params ) throws IOException {
if ( isDisconnected() && this.state != 5 ) {
throw new TransportException("Transport is disconnected " + this.name);
}
try {
long timeout = !params.contai... | java | public <T extends Response> T sendrecv ( Request request, T response, Set<RequestParam> params ) throws IOException {
if ( isDisconnected() && this.state != 5 ) {
throw new TransportException("Transport is disconnected " + this.name);
}
try {
long timeout = !params.contai... | [
"public",
"<",
"T",
"extends",
"Response",
">",
"T",
"sendrecv",
"(",
"Request",
"request",
",",
"T",
"response",
",",
"Set",
"<",
"RequestParam",
">",
"params",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isDisconnected",
"(",
")",
"&&",
"this",
".",... | Send a request message and recieve response
@param request
@param response
@param params
@return the response
@throws IOException | [
"Send",
"a",
"request",
"message",
"and",
"recieve",
"response"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/util/transport/Transport.java#L208-L263 |
29,127 | AgNO3/jcifs-ng | src/main/java/jcifs/util/transport/Transport.java | Transport.disconnect | public synchronized boolean disconnect ( boolean hard, boolean inUse ) throws IOException {
IOException ioe = null;
switch ( this.state ) {
case 0: /* not connected - just return */
case 5:
case 6:
return false;
case 2:
hard = true;
case 3... | java | public synchronized boolean disconnect ( boolean hard, boolean inUse ) throws IOException {
IOException ioe = null;
switch ( this.state ) {
case 0: /* not connected - just return */
case 5:
case 6:
return false;
case 2:
hard = true;
case 3... | [
"public",
"synchronized",
"boolean",
"disconnect",
"(",
"boolean",
"hard",
",",
"boolean",
"inUse",
")",
"throws",
"IOException",
"{",
"IOException",
"ioe",
"=",
"null",
";",
"switch",
"(",
"this",
".",
"state",
")",
"{",
"case",
"0",
":",
"/* not connected ... | Disconnect the transport
@param hard
@param inUse
whether the caller is holding a usage reference on the transport
@return whether conenction was in use
@throws IOException | [
"Disconnect",
"the",
"transport"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/util/transport/Transport.java#L677-L717 |
29,128 | AgNO3/jcifs-ng | src/main/java/jcifs/smb/SmbTransportImpl.java | SmbTransportImpl.doRecv | @Override
protected void doRecv ( Response response ) throws IOException {
CommonServerMessageBlock resp = (CommonServerMessageBlock) response;
this.negotiated.setupResponse(response);
try {
if ( this.smb2 ) {
doRecvSMB2(resp);
}
else {
... | java | @Override
protected void doRecv ( Response response ) throws IOException {
CommonServerMessageBlock resp = (CommonServerMessageBlock) response;
this.negotiated.setupResponse(response);
try {
if ( this.smb2 ) {
doRecvSMB2(resp);
}
else {
... | [
"@",
"Override",
"protected",
"void",
"doRecv",
"(",
"Response",
"response",
")",
"throws",
"IOException",
"{",
"CommonServerMessageBlock",
"resp",
"=",
"(",
"CommonServerMessageBlock",
")",
"response",
";",
"this",
".",
"negotiated",
".",
"setupResponse",
"(",
"r... | must be synchronized with peekKey | [
"must",
"be",
"synchronized",
"with",
"peekKey"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/SmbTransportImpl.java#L1137-L1158 |
29,129 | AgNO3/jcifs-ng | src/main/java/jcifs/netbios/UniAddress.java | UniAddress.isDotQuadIP | public static boolean isDotQuadIP ( String hostname ) {
if ( Character.isDigit(hostname.charAt(0)) ) {
int i, len, dots;
char[] data;
i = dots = 0; /* quick IP address validation */
len = hostname.length();
data = hostname.toCharArray();
w... | java | public static boolean isDotQuadIP ( String hostname ) {
if ( Character.isDigit(hostname.charAt(0)) ) {
int i, len, dots;
char[] data;
i = dots = 0; /* quick IP address validation */
len = hostname.length();
data = hostname.toCharArray();
w... | [
"public",
"static",
"boolean",
"isDotQuadIP",
"(",
"String",
"hostname",
")",
"{",
"if",
"(",
"Character",
".",
"isDigit",
"(",
"hostname",
".",
"charAt",
"(",
"0",
")",
")",
")",
"{",
"int",
"i",
",",
"len",
",",
"dots",
";",
"char",
"[",
"]",
"da... | Check whether a hostname is actually an ip address
@param hostname
@return whether this is an IP address | [
"Check",
"whether",
"a",
"hostname",
"is",
"actually",
"an",
"ip",
"address"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/netbios/UniAddress.java#L57-L78 |
29,130 | AgNO3/jcifs-ng | src/main/java/jcifs/context/SingletonContext.java | SingletonContext.init | public static synchronized final void init ( Properties props ) throws CIFSException {
if ( INSTANCE != null ) {
throw new CIFSException("Singleton context is already initialized");
}
Properties p = new Properties();
try {
String filename = System.getProperty("jci... | java | public static synchronized final void init ( Properties props ) throws CIFSException {
if ( INSTANCE != null ) {
throw new CIFSException("Singleton context is already initialized");
}
Properties p = new Properties();
try {
String filename = System.getProperty("jci... | [
"public",
"static",
"synchronized",
"final",
"void",
"init",
"(",
"Properties",
"props",
")",
"throws",
"CIFSException",
"{",
"if",
"(",
"INSTANCE",
"!=",
"null",
")",
"{",
"throw",
"new",
"CIFSException",
"(",
"\"Singleton context is already initialized\"",
")",
... | Initialize singleton context using custom properties
This method can only be called once.
@param props
@throws CIFSException | [
"Initialize",
"singleton",
"context",
"using",
"custom",
"properties"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/context/SingletonContext.java#L54-L77 |
29,131 | AgNO3/jcifs-ng | src/main/java/jcifs/context/SingletonContext.java | SingletonContext.getInstance | public static synchronized final SingletonContext getInstance () {
if ( INSTANCE == null ) {
try {
log.debug("Initializing singleton context");
init(null);
}
catch ( CIFSException e ) {
log.error("Failed to create singleton JCIF... | java | public static synchronized final SingletonContext getInstance () {
if ( INSTANCE == null ) {
try {
log.debug("Initializing singleton context");
init(null);
}
catch ( CIFSException e ) {
log.error("Failed to create singleton JCIF... | [
"public",
"static",
"synchronized",
"final",
"SingletonContext",
"getInstance",
"(",
")",
"{",
"if",
"(",
"INSTANCE",
"==",
"null",
")",
"{",
"try",
"{",
"log",
".",
"debug",
"(",
"\"Initializing singleton context\"",
")",
";",
"init",
"(",
"null",
")",
";",... | Get singleton context
The singleton context will use system properties for configuration as well as values specified in a file
specified through this <tt>jcifs.properties</tt> system property.
@return a global context, initialized on first call | [
"Get",
"singleton",
"context"
] | 0311107a077ea372527ae74839eec8042197332f | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/context/SingletonContext.java#L88-L99 |
29,132 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/util/stats/NumberUtil.java | NumberUtil.getPowerOf2 | public static int getPowerOf2(long value) {
Preconditions.checkArgument(isPowerOf2(value));
return Long.SIZE-(Long.numberOfLeadingZeros(value)+1);
} | java | public static int getPowerOf2(long value) {
Preconditions.checkArgument(isPowerOf2(value));
return Long.SIZE-(Long.numberOfLeadingZeros(value)+1);
} | [
"public",
"static",
"int",
"getPowerOf2",
"(",
"long",
"value",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"isPowerOf2",
"(",
"value",
")",
")",
";",
"return",
"Long",
".",
"SIZE",
"-",
"(",
"Long",
".",
"numberOfLeadingZeros",
"(",
"value",
")"... | Returns an integer X such that 2^X=value. Throws an exception
if value is not a power of 2.
@param value
@return | [
"Returns",
"an",
"integer",
"X",
"such",
"that",
"2^X",
"=",
"value",
".",
"Throws",
"an",
"exception",
"if",
"value",
"is",
"not",
"a",
"power",
"of",
"2",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/util/stats/NumberUtil.java#L21-L24 |
29,133 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/BackendTransaction.java | BackendTransaction.rollback | @Override
public void rollback() throws BackendException {
Throwable excep = null;
for (IndexTransaction itx : indexTx.values()) {
try {
itx.rollback();
} catch (Throwable e) {
excep = e;
}
}
storeTx.rollback();
... | java | @Override
public void rollback() throws BackendException {
Throwable excep = null;
for (IndexTransaction itx : indexTx.values()) {
try {
itx.rollback();
} catch (Throwable e) {
excep = e;
}
}
storeTx.rollback();
... | [
"@",
"Override",
"public",
"void",
"rollback",
"(",
")",
"throws",
"BackendException",
"{",
"Throwable",
"excep",
"=",
"null",
";",
"for",
"(",
"IndexTransaction",
"itx",
":",
"indexTx",
".",
"values",
"(",
")",
")",
"{",
"try",
"{",
"itx",
".",
"rollbac... | Rolls back all transactions and makes sure that this does not get cut short
by exceptions. If exceptions occur, the storage exception takes priority on re-throw.
@throws BackendException | [
"Rolls",
"back",
"all",
"transactions",
"and",
"makes",
"sure",
"that",
"this",
"does",
"not",
"get",
"cut",
"short",
"by",
"exceptions",
".",
"If",
"exceptions",
"occur",
"the",
"storage",
"exception",
"takes",
"priority",
"on",
"re",
"-",
"throw",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/BackendTransaction.java#L144-L159 |
29,134 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java | PartitionIDRange.contains | public boolean contains(int partitionId) {
if (lowerID < upperID) { //"Proper" id range
return lowerID <= partitionId && upperID > partitionId;
} else { //Id range "wraps around"
return (lowerID <= partitionId && partitionId < idUpperBound) ||
(upperID > parti... | java | public boolean contains(int partitionId) {
if (lowerID < upperID) { //"Proper" id range
return lowerID <= partitionId && upperID > partitionId;
} else { //Id range "wraps around"
return (lowerID <= partitionId && partitionId < idUpperBound) ||
(upperID > parti... | [
"public",
"boolean",
"contains",
"(",
"int",
"partitionId",
")",
"{",
"if",
"(",
"lowerID",
"<",
"upperID",
")",
"{",
"//\"Proper\" id range",
"return",
"lowerID",
"<=",
"partitionId",
"&&",
"upperID",
">",
"partitionId",
";",
"}",
"else",
"{",
"//Id range \"w... | Returns true of the given partitionId lies within this partition id range, else false.
@param partitionId
@return | [
"Returns",
"true",
"of",
"the",
"given",
"partitionId",
"lies",
"within",
"this",
"partition",
"id",
"range",
"else",
"false",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java#L88-L95 |
29,135 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java | PartitionIDRange.getRandomID | public int getRandomID() {
//Compute the width of the partition...
int partitionWidth;
if (lowerID < upperID) partitionWidth = upperID - lowerID; //... for "proper" ranges
else partitionWidth = (idUpperBound - lowerID) + upperID; //... and those that "wrap around"
Preconditions.c... | java | public int getRandomID() {
//Compute the width of the partition...
int partitionWidth;
if (lowerID < upperID) partitionWidth = upperID - lowerID; //... for "proper" ranges
else partitionWidth = (idUpperBound - lowerID) + upperID; //... and those that "wrap around"
Preconditions.c... | [
"public",
"int",
"getRandomID",
"(",
")",
"{",
"//Compute the width of the partition...",
"int",
"partitionWidth",
";",
"if",
"(",
"lowerID",
"<",
"upperID",
")",
"partitionWidth",
"=",
"upperID",
"-",
"lowerID",
";",
"//... for \"proper\" ranges",
"else",
"partitionW... | Returns a random partition id that lies within this partition id range.
@return | [
"Returns",
"a",
"random",
"partition",
"id",
"that",
"lies",
"within",
"this",
"partition",
"id",
"range",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner/placement/PartitionIDRange.java#L107-L114 |
29,136 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/util/stats/ObjectAccumulator.java | ObjectAccumulator.incBy | public double incBy(K o, double inc) {
Counter c = countMap.get(o);
if (c == null) {
c = new Counter();
countMap.put(o, c);
}
c.count += inc;
return c.count;
} | java | public double incBy(K o, double inc) {
Counter c = countMap.get(o);
if (c == null) {
c = new Counter();
countMap.put(o, c);
}
c.count += inc;
return c.count;
} | [
"public",
"double",
"incBy",
"(",
"K",
"o",
",",
"double",
"inc",
")",
"{",
"Counter",
"c",
"=",
"countMap",
".",
"get",
"(",
"o",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"c",
"=",
"new",
"Counter",
"(",
")",
";",
"countMap",
".",
"... | Increases the count of object o by inc and returns the new count value
@param o
@param inc
@return | [
"Increases",
"the",
"count",
"of",
"object",
"o",
"by",
"inc",
"and",
"returns",
"the",
"new",
"count",
"value"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/util/stats/ObjectAccumulator.java#L36-L44 |
29,137 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/configuration/GraphDatabaseConfiguration.java | GraphDatabaseConfiguration.getHomeDirectory | public File getHomeDirectory() {
if (!configuration.has(STORAGE_DIRECTORY))
throw new UnsupportedOperationException("No home directory specified");
File dir = new File(configuration.get(STORAGE_DIRECTORY));
Preconditions.checkArgument(dir.isDirectory(), "Not a directory");
re... | java | public File getHomeDirectory() {
if (!configuration.has(STORAGE_DIRECTORY))
throw new UnsupportedOperationException("No home directory specified");
File dir = new File(configuration.get(STORAGE_DIRECTORY));
Preconditions.checkArgument(dir.isDirectory(), "Not a directory");
re... | [
"public",
"File",
"getHomeDirectory",
"(",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"has",
"(",
"STORAGE_DIRECTORY",
")",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"No home directory specified\"",
")",
";",
"File",
"dir",
"=",
"new",
"F... | Returns the home directory for the graph database initialized in this configuration
@return Home directory for this graph database configuration | [
"Returns",
"the",
"home",
"directory",
"for",
"the",
"graph",
"database",
"initialized",
"in",
"this",
"configuration"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/configuration/GraphDatabaseConfiguration.java#L1858-L1864 |
29,138 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/kcvs/KCVSLog.java | KCVSLog.close | @Override
public synchronized void close() throws BackendException {
if (!isOpen) return;
this.isOpen = false;
if (readExecutor!=null) readExecutor.shutdown();
if (sendThread!=null) sendThread.close(CLOSE_DOWN_WAIT);
if (readExecutor!=null) {
try {
... | java | @Override
public synchronized void close() throws BackendException {
if (!isOpen) return;
this.isOpen = false;
if (readExecutor!=null) readExecutor.shutdown();
if (sendThread!=null) sendThread.close(CLOSE_DOWN_WAIT);
if (readExecutor!=null) {
try {
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"BackendException",
"{",
"if",
"(",
"!",
"isOpen",
")",
"return",
";",
"this",
".",
"isOpen",
"=",
"false",
";",
"if",
"(",
"readExecutor",
"!=",
"null",
")",
"readExecutor",
... | Closes the log by terminating all threads and waiting for their termination.
@throws com.thinkaurelius.titan.diskstorage.BackendException | [
"Closes",
"the",
"log",
"by",
"terminating",
"all",
"threads",
"and",
"waiting",
"for",
"their",
"termination",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/kcvs/KCVSLog.java#L272-L296 |
29,139 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/kcvs/KCVSLog.java | KCVSLog.sendMessages | private void sendMessages(final List<MessageEnvelope> msgEnvelopes) {
try {
boolean success=BackendOperation.execute(new BackendOperation.Transactional<Boolean>() {
@Override
public Boolean call(StoreTransaction txh) throws BackendException {
ListM... | java | private void sendMessages(final List<MessageEnvelope> msgEnvelopes) {
try {
boolean success=BackendOperation.execute(new BackendOperation.Transactional<Boolean>() {
@Override
public Boolean call(StoreTransaction txh) throws BackendException {
ListM... | [
"private",
"void",
"sendMessages",
"(",
"final",
"List",
"<",
"MessageEnvelope",
">",
"msgEnvelopes",
")",
"{",
"try",
"{",
"boolean",
"success",
"=",
"BackendOperation",
".",
"execute",
"(",
"new",
"BackendOperation",
".",
"Transactional",
"<",
"Boolean",
">",
... | Sends a batch of messages by persisting them to the storage backend.
@param msgEnvelopes | [
"Sends",
"a",
"batch",
"of",
"messages",
"by",
"persisting",
"them",
"to",
"the",
"storage",
"backend",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/kcvs/KCVSLog.java#L456-L491 |
29,140 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java | Mutation.addition | public void addition(E entry) {
if (additions==null) additions = new ArrayList<E>();
additions.add(entry);
} | java | public void addition(E entry) {
if (additions==null) additions = new ArrayList<E>();
additions.add(entry);
} | [
"public",
"void",
"addition",
"(",
"E",
"entry",
")",
"{",
"if",
"(",
"additions",
"==",
"null",
")",
"additions",
"=",
"new",
"ArrayList",
"<",
"E",
">",
"(",
")",
";",
"additions",
".",
"add",
"(",
"entry",
")",
";",
"}"
] | Adds a new entry as an addition to this mutation
@param entry | [
"Adds",
"a",
"new",
"entry",
"as",
"an",
"addition",
"to",
"this",
"mutation"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java#L79-L82 |
29,141 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java | Mutation.deletion | public void deletion(K key) {
if (deletions==null) deletions = new ArrayList<K>();
deletions.add(key);
} | java | public void deletion(K key) {
if (deletions==null) deletions = new ArrayList<K>();
deletions.add(key);
} | [
"public",
"void",
"deletion",
"(",
"K",
"key",
")",
"{",
"if",
"(",
"deletions",
"==",
"null",
")",
"deletions",
"=",
"new",
"ArrayList",
"<",
"K",
">",
"(",
")",
";",
"deletions",
".",
"add",
"(",
"key",
")",
";",
"}"
] | Adds a new key as a deletion to this mutation
@param key | [
"Adds",
"a",
"new",
"key",
"as",
"a",
"deletion",
"to",
"this",
"mutation"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java#L89-L92 |
29,142 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java | Mutation.merge | public void merge(Mutation<E,K> m) {
Preconditions.checkNotNull(m);
if (null != m.additions) {
if (null == additions) additions = m.additions;
else additions.addAll(m.additions);
}
if (null != m.deletions) {
if (null == deletions) deletions = m.delet... | java | public void merge(Mutation<E,K> m) {
Preconditions.checkNotNull(m);
if (null != m.additions) {
if (null == additions) additions = m.additions;
else additions.addAll(m.additions);
}
if (null != m.deletions) {
if (null == deletions) deletions = m.delet... | [
"public",
"void",
"merge",
"(",
"Mutation",
"<",
"E",
",",
"K",
">",
"m",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"m",
")",
";",
"if",
"(",
"null",
"!=",
"m",
".",
"additions",
")",
"{",
"if",
"(",
"null",
"==",
"additions",
")",
"ad... | Merges another mutation into this mutation. Ensures that all additions and deletions
are added to this mutation. Does not remove duplicates if such exist - this needs to be ensured by the caller.
@param m | [
"Merges",
"another",
"mutation",
"into",
"this",
"mutation",
".",
"Ensures",
"that",
"all",
"additions",
"and",
"deletions",
"are",
"added",
"to",
"this",
"mutation",
".",
"Does",
"not",
"remove",
"duplicates",
"if",
"such",
"exist",
"-",
"this",
"needs",
"t... | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Mutation.java#L100-L112 |
29,143 | thinkaurelius/titan | titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionFactory.java | CTConnectionFactory.makeRawConnection | public CTConnection makeRawConnection() throws TTransportException {
final Config cfg = cfgRef.get();
String hostname = cfg.getRandomHost();
log.debug("Creating TSocket({}, {}, {}, {}, {})", hostname, cfg.port, cfg.username, cfg.password, cfg.timeoutMS);
TSocket socket;
if (nu... | java | public CTConnection makeRawConnection() throws TTransportException {
final Config cfg = cfgRef.get();
String hostname = cfg.getRandomHost();
log.debug("Creating TSocket({}, {}, {}, {}, {})", hostname, cfg.port, cfg.username, cfg.password, cfg.timeoutMS);
TSocket socket;
if (nu... | [
"public",
"CTConnection",
"makeRawConnection",
"(",
")",
"throws",
"TTransportException",
"{",
"final",
"Config",
"cfg",
"=",
"cfgRef",
".",
"get",
"(",
")",
";",
"String",
"hostname",
"=",
"cfg",
".",
"getRandomHost",
"(",
")",
";",
"log",
".",
"debug",
"... | Create a Cassandra-Thrift connection, but do not attempt to
set a keyspace on the connection.
@return A CTConnection ready to talk to a Cassandra cluster
@throws TTransportException on any Thrift transport failure | [
"Create",
"a",
"Cassandra",
"-",
"Thrift",
"connection",
"but",
"do",
"not",
"attempt",
"to",
"set",
"a",
"keyspace",
"on",
"the",
"connection",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionFactory.java#L66-L104 |
29,144 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/query/vertex/BasicVertexCentricQueryBuilder.java | BasicVertexCentricQueryBuilder.profiler | public Q profiler(QueryProfiler profiler) {
Preconditions.checkNotNull(profiler);
this.profiler=profiler;
return getThis();
} | java | public Q profiler(QueryProfiler profiler) {
Preconditions.checkNotNull(profiler);
this.profiler=profiler;
return getThis();
} | [
"public",
"Q",
"profiler",
"(",
"QueryProfiler",
"profiler",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"profiler",
")",
";",
"this",
".",
"profiler",
"=",
"profiler",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Sets the query profiler to observe this query. Must be set before the query is executed to take effect.
@param profiler
@return | [
"Sets",
"the",
"query",
"profiler",
"to",
"observe",
"this",
"query",
".",
"Must",
"be",
"set",
"before",
"the",
"query",
"is",
"executed",
"to",
"take",
"effect",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/query/vertex/BasicVertexCentricQueryBuilder.java#L105-L109 |
29,145 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/attribute/Geoshape.java | Geoshape.point | public static final Geoshape point(final float latitude, final float longitude) {
Preconditions.checkArgument(isValidCoordinate(latitude,longitude),"Invalid coordinate provided");
return new Geoshape(new float[][]{ new float[]{latitude}, new float[]{longitude}});
} | java | public static final Geoshape point(final float latitude, final float longitude) {
Preconditions.checkArgument(isValidCoordinate(latitude,longitude),"Invalid coordinate provided");
return new Geoshape(new float[][]{ new float[]{latitude}, new float[]{longitude}});
} | [
"public",
"static",
"final",
"Geoshape",
"point",
"(",
"final",
"float",
"latitude",
",",
"final",
"float",
"longitude",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"isValidCoordinate",
"(",
"latitude",
",",
"longitude",
")",
",",
"\"Invalid coordinate p... | Constructs a point from its latitude and longitude information
@param latitude
@param longitude
@return | [
"Constructs",
"a",
"point",
"from",
"its",
"latitude",
"and",
"longitude",
"information"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/attribute/Geoshape.java#L244-L247 |
29,146 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/attribute/Geoshape.java | Geoshape.circle | public static final Geoshape circle(final float latitude, final float longitude, final float radiusInKM) {
Preconditions.checkArgument(isValidCoordinate(latitude,longitude),"Invalid coordinate provided");
Preconditions.checkArgument(radiusInKM>0,"Invalid radius provided [%s]",radiusInKM);
return... | java | public static final Geoshape circle(final float latitude, final float longitude, final float radiusInKM) {
Preconditions.checkArgument(isValidCoordinate(latitude,longitude),"Invalid coordinate provided");
Preconditions.checkArgument(radiusInKM>0,"Invalid radius provided [%s]",radiusInKM);
return... | [
"public",
"static",
"final",
"Geoshape",
"circle",
"(",
"final",
"float",
"latitude",
",",
"final",
"float",
"longitude",
",",
"final",
"float",
"radiusInKM",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"isValidCoordinate",
"(",
"latitude",
",",
"longi... | Constructs a circle from a given center point and a radius in kilometer
@param latitude
@param longitude
@param radiusInKM
@return | [
"Constructs",
"a",
"circle",
"from",
"a",
"given",
"center",
"point",
"and",
"a",
"radius",
"in",
"kilometer"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/attribute/Geoshape.java#L266-L270 |
29,147 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/util/ManagementUtil.java | ManagementUtil.awaitGraphIndexUpdate | public static void awaitGraphIndexUpdate(TitanGraph g, String indexName, long time, TemporalUnit unit) {
awaitIndexUpdate(g,indexName,null,time,unit);
} | java | public static void awaitGraphIndexUpdate(TitanGraph g, String indexName, long time, TemporalUnit unit) {
awaitIndexUpdate(g,indexName,null,time,unit);
} | [
"public",
"static",
"void",
"awaitGraphIndexUpdate",
"(",
"TitanGraph",
"g",
",",
"String",
"indexName",
",",
"long",
"time",
",",
"TemporalUnit",
"unit",
")",
"{",
"awaitIndexUpdate",
"(",
"g",
",",
"indexName",
",",
"null",
",",
"time",
",",
"unit",
")",
... | This method blocks and waits until the provided index has been updated across the entire Titan cluster
and reached a stable state.
This method will wait for the given period of time and throw an exception if the index did not reach a
final state within that time. The method simply returns when the index has reached the... | [
"This",
"method",
"blocks",
"and",
"waits",
"until",
"the",
"provided",
"index",
"has",
"been",
"updated",
"across",
"the",
"entire",
"Titan",
"cluster",
"and",
"reached",
"a",
"stable",
"state",
".",
"This",
"method",
"will",
"wait",
"for",
"the",
"given",
... | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/util/ManagementUtil.java#L42-L44 |
29,148 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/util/TitanCleanup.java | TitanCleanup.clear | public static final void clear(TitanGraph graph) {
Preconditions.checkNotNull(graph);
Preconditions.checkArgument(graph instanceof StandardTitanGraph,"Invalid graph instance detected: %s",graph.getClass());
StandardTitanGraph g = (StandardTitanGraph)graph;
Preconditions.checkArgument(!g.... | java | public static final void clear(TitanGraph graph) {
Preconditions.checkNotNull(graph);
Preconditions.checkArgument(graph instanceof StandardTitanGraph,"Invalid graph instance detected: %s",graph.getClass());
StandardTitanGraph g = (StandardTitanGraph)graph;
Preconditions.checkArgument(!g.... | [
"public",
"static",
"final",
"void",
"clear",
"(",
"TitanGraph",
"graph",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"graph",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"graph",
"instanceof",
"StandardTitanGraph",
",",
"\"Invalid graph instance ... | Clears out the entire graph. This will delete ALL of the data stored in this graph and the data will NOT be
recoverable. This method is intended only for development and testing use.
@param graph
@throws IllegalArgumentException if the graph has not been shut down
@throws com.thinkaurelius.titan.core.TitanException if... | [
"Clears",
"out",
"the",
"entire",
"graph",
".",
"This",
"will",
"delete",
"ALL",
"of",
"the",
"data",
"stored",
"in",
"this",
"graph",
"and",
"the",
"data",
"will",
"NOT",
"be",
"recoverable",
".",
"This",
"method",
"is",
"intended",
"only",
"for",
"deve... | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/util/TitanCleanup.java#L29-L44 |
29,149 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/util/ElementHelper.java | ElementHelper.attachProperties | public static void attachProperties(final TitanVertex vertex, final Object... propertyKeyValues) {
if (null == vertex)
throw Graph.Exceptions.argumentCanNotBeNull("vertex");
for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
if (!propertyKeyValues[i].equals(T.id) && !pro... | java | public static void attachProperties(final TitanVertex vertex, final Object... propertyKeyValues) {
if (null == vertex)
throw Graph.Exceptions.argumentCanNotBeNull("vertex");
for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
if (!propertyKeyValues[i].equals(T.id) && !pro... | [
"public",
"static",
"void",
"attachProperties",
"(",
"final",
"TitanVertex",
"vertex",
",",
"final",
"Object",
"...",
"propertyKeyValues",
")",
"{",
"if",
"(",
"null",
"==",
"vertex",
")",
"throw",
"Graph",
".",
"Exceptions",
".",
"argumentCanNotBeNull",
"(",
... | This is essentially an adjusted copy&paste from TinkerPop's ElementHelper class.
The reason for copying it is so that we can determine the cardinality of a property key based on
Titan's schema which is tied to this particular transaction and not the graph.
@param vertex
@param propertyKeyValues | [
"This",
"is",
"essentially",
"an",
"adjusted",
"copy&paste",
"from",
"TinkerPop",
"s",
"ElementHelper",
"class",
".",
"The",
"reason",
"for",
"copying",
"it",
"is",
"so",
"that",
"we",
"can",
"determine",
"the",
"cardinality",
"of",
"a",
"property",
"key",
"... | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/util/ElementHelper.java#L60-L68 |
29,150 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/internal/OrderList.java | OrderList.hasCommonOrder | public boolean hasCommonOrder() {
Order lastOrder = null;
for (OrderEntry oe : list) {
if (lastOrder==null) lastOrder=oe.order;
else if (lastOrder!=oe.order) return false;
}
return true;
} | java | public boolean hasCommonOrder() {
Order lastOrder = null;
for (OrderEntry oe : list) {
if (lastOrder==null) lastOrder=oe.order;
else if (lastOrder!=oe.order) return false;
}
return true;
} | [
"public",
"boolean",
"hasCommonOrder",
"(",
")",
"{",
"Order",
"lastOrder",
"=",
"null",
";",
"for",
"(",
"OrderEntry",
"oe",
":",
"list",
")",
"{",
"if",
"(",
"lastOrder",
"==",
"null",
")",
"lastOrder",
"=",
"oe",
".",
"order",
";",
"else",
"if",
"... | Whether all individual orders are the same
@return | [
"Whether",
"all",
"individual",
"orders",
"are",
"the",
"same"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/internal/OrderList.java#L64-L71 |
29,151 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/ReadMarker.java | ReadMarker.getStartTime | public synchronized Instant getStartTime(TimestampProvider times) {
if (startTime==null) {
startTime = times.getTime();
}
return startTime;
} | java | public synchronized Instant getStartTime(TimestampProvider times) {
if (startTime==null) {
startTime = times.getTime();
}
return startTime;
} | [
"public",
"synchronized",
"Instant",
"getStartTime",
"(",
"TimestampProvider",
"times",
")",
"{",
"if",
"(",
"startTime",
"==",
"null",
")",
"{",
"startTime",
"=",
"times",
".",
"getTime",
"(",
")",
";",
"}",
"return",
"startTime",
";",
"}"
] | Returns the start time of this marker if such has been defined or the current time if not
@return | [
"Returns",
"the",
"start",
"time",
"of",
"this",
"marker",
"if",
"such",
"has",
"been",
"defined",
"or",
"the",
"current",
"time",
"if",
"not"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/log/ReadMarker.java#L50-L55 |
29,152 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/util/datastructures/CompactMap.java | CompactMap.deduplicateKeys | private static final String[] deduplicateKeys(String[] keys) {
synchronized (KEY_CACHE) {
KEY_HULL.setKeys(keys);
KeyContainer retrieved = KEY_CACHE.get(KEY_HULL);
if (retrieved==null) {
retrieved = new KeyContainer(keys);
KEY_CACHE.put(retriev... | java | private static final String[] deduplicateKeys(String[] keys) {
synchronized (KEY_CACHE) {
KEY_HULL.setKeys(keys);
KeyContainer retrieved = KEY_CACHE.get(KEY_HULL);
if (retrieved==null) {
retrieved = new KeyContainer(keys);
KEY_CACHE.put(retriev... | [
"private",
"static",
"final",
"String",
"[",
"]",
"deduplicateKeys",
"(",
"String",
"[",
"]",
"keys",
")",
"{",
"synchronized",
"(",
"KEY_CACHE",
")",
"{",
"KEY_HULL",
".",
"setKeys",
"(",
"keys",
")",
";",
"KeyContainer",
"retrieved",
"=",
"KEY_CACHE",
".... | Deduplicates keys arrays to keep the memory footprint on CompactMap to a minimum.
This implementation is blocking for simplicity. To improve performance in multi-threaded
environments, use a thread-local KEY_HULL and a concurrent hash map for KEY_CACHE.
@param keys String array to deduplicate by checking against KEY_... | [
"Deduplicates",
"keys",
"arrays",
"to",
"keep",
"the",
"memory",
"footprint",
"on",
"CompactMap",
"to",
"a",
"minimum",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/util/datastructures/CompactMap.java#L47-L57 |
29,153 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java | KCVSUtil.get | public static StaticBuffer get(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
KeySliceQuery query = new KeySliceQuery(key, column, BufferUtil.nextBiggerBuffer(column)).setLimit(2);
List<Entry> result = store.getSlice(query, txh);
... | java | public static StaticBuffer get(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
KeySliceQuery query = new KeySliceQuery(key, column, BufferUtil.nextBiggerBuffer(column)).setLimit(2);
List<Entry> result = store.getSlice(query, txh);
... | [
"public",
"static",
"StaticBuffer",
"get",
"(",
"KeyColumnValueStore",
"store",
",",
"StaticBuffer",
"key",
",",
"StaticBuffer",
"column",
",",
"StoreTransaction",
"txh",
")",
"throws",
"BackendException",
"{",
"KeySliceQuery",
"query",
"=",
"new",
"KeySliceQuery",
... | Retrieves the value for the specified column and key under the given transaction
from the store if such exists, otherwise returns NULL
@param store Store
@param key Key
@param column Column
@param txh Transaction
@return Value for key and column or NULL if such does not exist | [
"Retrieves",
"the",
"value",
"for",
"the",
"specified",
"column",
"and",
"key",
"under",
"the",
"given",
"transaction",
"from",
"the",
"store",
"if",
"such",
"exists",
"otherwise",
"returns",
"NULL"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java#L37-L46 |
29,154 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java | KCVSUtil.containsKeyColumn | public static boolean containsKeyColumn(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
return get(store, key, column, txh) != null;
} | java | public static boolean containsKeyColumn(KeyColumnValueStore store, StaticBuffer key, StaticBuffer column, StoreTransaction txh) throws BackendException {
return get(store, key, column, txh) != null;
} | [
"public",
"static",
"boolean",
"containsKeyColumn",
"(",
"KeyColumnValueStore",
"store",
",",
"StaticBuffer",
"key",
",",
"StaticBuffer",
"column",
",",
"StoreTransaction",
"txh",
")",
"throws",
"BackendException",
"{",
"return",
"get",
"(",
"store",
",",
"key",
"... | Returns true if the specified key-column pair exists in the store.
@param store Store
@param key Key
@param column Column
@param txh Transaction
@return TRUE, if key has at least one column-value pair, else FALSE | [
"Returns",
"true",
"if",
"the",
"specified",
"key",
"-",
"column",
"pair",
"exists",
"in",
"the",
"store",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/keycolumnvalue/KCVSUtil.java#L70-L72 |
29,155 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/configuration/backend/KCVSConfiguration.java | KCVSConfiguration.get | @Override
public <O> O get(final String key, final Class<O> datatype) {
StaticBuffer column = string2StaticBuffer(key);
final KeySliceQuery query = new KeySliceQuery(rowKey,column, BufferUtil.nextBiggerBuffer(column));
StaticBuffer result = BackendOperation.execute(new BackendOperation.Trans... | java | @Override
public <O> O get(final String key, final Class<O> datatype) {
StaticBuffer column = string2StaticBuffer(key);
final KeySliceQuery query = new KeySliceQuery(rowKey,column, BufferUtil.nextBiggerBuffer(column));
StaticBuffer result = BackendOperation.execute(new BackendOperation.Trans... | [
"@",
"Override",
"public",
"<",
"O",
">",
"O",
"get",
"(",
"final",
"String",
"key",
",",
"final",
"Class",
"<",
"O",
">",
"datatype",
")",
"{",
"StaticBuffer",
"column",
"=",
"string2StaticBuffer",
"(",
"key",
")",
";",
"final",
"KeySliceQuery",
"query"... | Reads the configuration property for this StoreManager
@param key Key identifying the configuration property
@return Value stored for the key or null if the configuration property has not (yet) been defined.
@throws com.thinkaurelius.titan.diskstorage.BackendException | [
"Reads",
"the",
"configuration",
"property",
"for",
"this",
"StoreManager"
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/configuration/backend/KCVSConfiguration.java#L84-L103 |
29,156 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/configuration/backend/KCVSConfiguration.java | KCVSConfiguration.set | @Override
public <O> void set(String key, O value) {
set(key,value,null,false);
} | java | @Override
public <O> void set(String key, O value) {
set(key,value,null,false);
} | [
"@",
"Override",
"public",
"<",
"O",
">",
"void",
"set",
"(",
"String",
"key",
",",
"O",
"value",
")",
"{",
"set",
"(",
"key",
",",
"value",
",",
"null",
",",
"false",
")",
";",
"}"
] | Sets a configuration property for this StoreManager.
@param key Key identifying the configuration property
@param value Value to be stored for the key
@throws com.thinkaurelius.titan.diskstorage.BackendException | [
"Sets",
"a",
"configuration",
"property",
"for",
"this",
"StoreManager",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/configuration/backend/KCVSConfiguration.java#L116-L119 |
29,157 | thinkaurelius/titan | titan-hbase-parent/titan-hbase-core/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java | HBaseStoreManager.convertToCommands | private Map<StaticBuffer, Pair<Put, Delete>> convertToCommands(Map<String, Map<StaticBuffer, KCVMutation>> mutations,
final long putTimestamp,
final long delTimestamp) throws PermanentBa... | java | private Map<StaticBuffer, Pair<Put, Delete>> convertToCommands(Map<String, Map<StaticBuffer, KCVMutation>> mutations,
final long putTimestamp,
final long delTimestamp) throws PermanentBa... | [
"private",
"Map",
"<",
"StaticBuffer",
",",
"Pair",
"<",
"Put",
",",
"Delete",
">",
">",
"convertToCommands",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"StaticBuffer",
",",
"KCVMutation",
">",
">",
"mutations",
",",
"final",
"long",
"putTimestamp",
",",
... | Convert Titan internal Mutation representation into HBase native commands.
@param mutations Mutations to convert into HBase commands.
@param putTimestamp The timestamp to use for Put commands.
@param delTimestamp The timestamp to use for Delete commands.
@return Commands sorted by key converted from Titan internal ... | [
"Convert",
"Titan",
"internal",
"Mutation",
"representation",
"into",
"HBase",
"native",
"commands",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-hbase-parent/titan-hbase-core/src/main/java/com/thinkaurelius/titan/diskstorage/hbase/HBaseStoreManager.java#L895-L945 |
29,158 | thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/job/IndexRepairJob.java | IndexRepairJob.validateIndexStatus | @Override
protected void validateIndexStatus() {
TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus();
boolean isValidIndex = true;
String invalidIndexHint;
if (index instanceof Relatio... | java | @Override
protected void validateIndexStatus() {
TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus();
boolean isValidIndex = true;
String invalidIndexHint;
if (index instanceof Relatio... | [
"@",
"Override",
"protected",
"void",
"validateIndexStatus",
"(",
")",
"{",
"TitanSchemaVertex",
"schemaVertex",
"=",
"mgmt",
".",
"getSchemaVertex",
"(",
"index",
")",
";",
"Set",
"<",
"SchemaStatus",
">",
"acceptableStatuses",
"=",
"SchemaAction",
".",
"REINDEX"... | Check that our target index is in either the ENABLED or REGISTERED state. | [
"Check",
"that",
"our",
"target",
"index",
"is",
"in",
"either",
"the",
"ENABLED",
"or",
"REGISTERED",
"state",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/job/IndexRepairJob.java#L73-L112 |
29,159 | thinkaurelius/titan | titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java | SolrIndex.register | @Override
public void register(String store, String key, KeyInformation information, BaseTransaction tx) throws BackendException {
if (mode==Mode.CLOUD) {
CloudSolrClient client = (CloudSolrClient) solrClient;
try {
createCollectionIfNotExists(client, configuration, s... | java | @Override
public void register(String store, String key, KeyInformation information, BaseTransaction tx) throws BackendException {
if (mode==Mode.CLOUD) {
CloudSolrClient client = (CloudSolrClient) solrClient;
try {
createCollectionIfNotExists(client, configuration, s... | [
"@",
"Override",
"public",
"void",
"register",
"(",
"String",
"store",
",",
"String",
"key",
",",
"KeyInformation",
"information",
",",
"BaseTransaction",
"tx",
")",
"throws",
"BackendException",
"{",
"if",
"(",
"mode",
"==",
"Mode",
".",
"CLOUD",
")",
"{",
... | Unlike the ElasticSearch Index, which is schema free, Solr requires a schema to
support searching. This means that you will need to modify the solr schema with the
appropriate field definitions in order to work properly. If you have a running instance
of Solr and you modify its schema with new fields, don't forget to ... | [
"Unlike",
"the",
"ElasticSearch",
"Index",
"which",
"is",
"schema",
"free",
"Solr",
"requires",
"a",
"schema",
"to",
"support",
"searching",
".",
"This",
"means",
"that",
"you",
"will",
"need",
"to",
"modify",
"the",
"solr",
"schema",
"with",
"the",
"appropr... | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java#L224-L241 |
29,160 | thinkaurelius/titan | titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java | SolrIndex.checkIfCollectionExists | private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
ZkStateReader zkStateReader = server.getZkStateReader();
zkStateReader.updateClusterState(true);
ClusterState clusterState = zkStateReader.getClusterState();
... | java | private static boolean checkIfCollectionExists(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
ZkStateReader zkStateReader = server.getZkStateReader();
zkStateReader.updateClusterState(true);
ClusterState clusterState = zkStateReader.getClusterState();
... | [
"private",
"static",
"boolean",
"checkIfCollectionExists",
"(",
"CloudSolrClient",
"server",
",",
"String",
"collection",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"ZkStateReader",
"zkStateReader",
"=",
"server",
".",
"getZkStateReader",
"(",
"... | Checks if the collection has already been created in Solr. | [
"Checks",
"if",
"the",
"collection",
"has",
"already",
"been",
"created",
"in",
"Solr",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java#L896-L901 |
29,161 | thinkaurelius/titan | titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java | SolrIndex.waitForRecoveriesToFinish | private static void waitForRecoveriesToFinish(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
ZkStateReader zkStateReader = server.getZkStateReader();
try {
boolean cont = true;
while (cont) {
boolean sawLiveRecovering = ... | java | private static void waitForRecoveriesToFinish(CloudSolrClient server, String collection) throws KeeperException, InterruptedException {
ZkStateReader zkStateReader = server.getZkStateReader();
try {
boolean cont = true;
while (cont) {
boolean sawLiveRecovering = ... | [
"private",
"static",
"void",
"waitForRecoveriesToFinish",
"(",
"CloudSolrClient",
"server",
",",
"String",
"collection",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"ZkStateReader",
"zkStateReader",
"=",
"server",
".",
"getZkStateReader",
"(",
")... | Wait for all the collection shards to be ready. | [
"Wait",
"for",
"all",
"the",
"collection",
"shards",
"to",
"be",
"ready",
"."
] | ee226e52415b8bf43b700afac75fa5b9767993a5 | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-solr/src/main/java/com/thinkaurelius/titan/diskstorage/solr/SolrIndex.java#L906-L942 |
29,162 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/AbstractExecMojo.java | AbstractExecMojo.parseCommandlineArgs | protected String[] parseCommandlineArgs()
throws MojoExecutionException
{
if ( commandlineArgs == null )
{
return null;
}
else
{
try
{
return CommandLineUtils.translateCommandline( commandlineArgs );
}
... | java | protected String[] parseCommandlineArgs()
throws MojoExecutionException
{
if ( commandlineArgs == null )
{
return null;
}
else
{
try
{
return CommandLineUtils.translateCommandline( commandlineArgs );
}
... | [
"protected",
"String",
"[",
"]",
"parseCommandlineArgs",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"commandlineArgs",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"try",
"{",
"return",
"CommandLineUtils",
".",
"translate... | Parses the argument string given by the user. Strings are recognized as everything between STRING_WRAPPER.
PARAMETER_DELIMITER is ignored inside a string. STRING_WRAPPER and PARAMETER_DELIMITER can be escaped using
ESCAPE_CHAR.
@return Array of String representing the arguments
@throws MojoExecutionException for wrong... | [
"Parses",
"the",
"argument",
"string",
"given",
"by",
"the",
"user",
".",
"Strings",
"are",
"recognized",
"as",
"everything",
"between",
"STRING_WRAPPER",
".",
"PARAMETER_DELIMITER",
"is",
"ignored",
"inside",
"a",
"string",
".",
"STRING_WRAPPER",
"and",
"PARAMETE... | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/AbstractExecMojo.java#L134-L152 |
29,163 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/AbstractExecMojo.java | AbstractExecMojo.registerSourceRoots | protected void registerSourceRoots()
{
if ( sourceRoot != null )
{
getLog().info( "Registering compile source root " + sourceRoot );
project.addCompileSourceRoot( sourceRoot.toString() );
}
if ( testSourceRoot != null )
{
getLog().info( "R... | java | protected void registerSourceRoots()
{
if ( sourceRoot != null )
{
getLog().info( "Registering compile source root " + sourceRoot );
project.addCompileSourceRoot( sourceRoot.toString() );
}
if ( testSourceRoot != null )
{
getLog().info( "R... | [
"protected",
"void",
"registerSourceRoots",
"(",
")",
"{",
"if",
"(",
"sourceRoot",
"!=",
"null",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Registering compile source root \"",
"+",
"sourceRoot",
")",
";",
"project",
".",
"addCompileSourceRoot",
"(",
... | Register compile and compile tests source roots if necessary | [
"Register",
"compile",
"and",
"compile",
"tests",
"source",
"roots",
"if",
"necessary"
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/AbstractExecMojo.java#L165-L178 |
29,164 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/TemplateCodeGenerator.java | TemplateCodeGenerator.genImportCode | private void genImportCode() {
Set<String> imports = new HashSet<String>();
imports.add("java.util.*");
imports.add("java.io.IOException");
imports.add("java.lang.reflect.*");
imports.add("com.baidu.bjf.remoting.protobuf.code.*");
imports.add("com.baidu.bjf.remoting... | java | private void genImportCode() {
Set<String> imports = new HashSet<String>();
imports.add("java.util.*");
imports.add("java.io.IOException");
imports.add("java.lang.reflect.*");
imports.add("com.baidu.bjf.remoting.protobuf.code.*");
imports.add("com.baidu.bjf.remoting... | [
"private",
"void",
"genImportCode",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"imports",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"imports",
".",
"add",
"(",
"\"java.util.*\"",
")",
";",
"imports",
".",
"add",
"(",
"\"java.io.IOException... | Gen import code. | [
"Gen",
"import",
"code",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/TemplateCodeGenerator.java#L397-L415 |
29,165 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.reset | public void reset() {
if (varValuesTab == null) {
varValuesTab = new String[mtp.varTabCnt];
} else {
for (int varNo = 0; varNo < mtp.varTabCnt; varNo++) {
varValuesTab[varNo] = null;
}
}
if (blockDynTab == null) {
b... | java | public void reset() {
if (varValuesTab == null) {
varValuesTab = new String[mtp.varTabCnt];
} else {
for (int varNo = 0; varNo < mtp.varTabCnt; varNo++) {
varValuesTab[varNo] = null;
}
}
if (blockDynTab == null) {
b... | [
"public",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"varValuesTab",
"==",
"null",
")",
"{",
"varValuesTab",
"=",
"new",
"String",
"[",
"mtp",
".",
"varTabCnt",
"]",
";",
"}",
"else",
"{",
"for",
"(",
"int",
"varNo",
"=",
"0",
";",
"varNo",
"<",
... | Resets the MiniTemplator object to the initial state. All variable values are cleared and all added block
instances are deleted. This method can be used to produce another HTML page with the same template. It is faster
than creating another MiniTemplator object, because the template does not have to be read and parsed ... | [
"Resets",
"the",
"MiniTemplator",
"object",
"to",
"the",
"initial",
"state",
".",
"All",
"variable",
"values",
"are",
"cleared",
"and",
"all",
"added",
"block",
"instances",
"are",
"deleted",
".",
"This",
"method",
"can",
"be",
"used",
"to",
"produce",
"anot... | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L312-L334 |
29,166 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.getVariables | public Map<String, String> getVariables() {
HashMap<String, String> map = new HashMap<String, String>(mtp.varTabCnt);
for (int varNo = 0; varNo < mtp.varTabCnt; varNo++)
map.put(mtp.varTab[varNo], varValuesTab[varNo]);
return map;
} | java | public Map<String, String> getVariables() {
HashMap<String, String> map = new HashMap<String, String>(mtp.varTabCnt);
for (int varNo = 0; varNo < mtp.varTabCnt; varNo++)
map.put(mtp.varTab[varNo], varValuesTab[varNo]);
return map;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getVariables",
"(",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
"mtp",
".",
"varTabCnt",
")",
";",
"for",
"(",
"i... | Returns a map with the names and current values of the template variables. | [
"Returns",
"a",
"map",
"with",
"the",
"names",
"and",
"current",
"values",
"of",
"the",
"template",
"variables",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L501-L506 |
29,167 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.registerBlockInstance | private int registerBlockInstance() {
int blockInstNo = blockInstTabCnt++;
if (blockInstTab == null) {
blockInstTab = new BlockInstTabRec[64];
}
if (blockInstTabCnt > blockInstTab.length) {
blockInstTab = (BlockInstTabRec[]) MiniTemplatorParser.resizeArray(b... | java | private int registerBlockInstance() {
int blockInstNo = blockInstTabCnt++;
if (blockInstTab == null) {
blockInstTab = new BlockInstTabRec[64];
}
if (blockInstTabCnt > blockInstTab.length) {
blockInstTab = (BlockInstTabRec[]) MiniTemplatorParser.resizeArray(b... | [
"private",
"int",
"registerBlockInstance",
"(",
")",
"{",
"int",
"blockInstNo",
"=",
"blockInstTabCnt",
"++",
";",
"if",
"(",
"blockInstTab",
"==",
"null",
")",
"{",
"blockInstTab",
"=",
"new",
"BlockInstTabRec",
"[",
"64",
"]",
";",
"}",
"if",
"(",
"block... | Returns the block instance number. | [
"Returns",
"the",
"block",
"instance",
"number",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L590-L600 |
29,168 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.generateOutput | public void generateOutput(String outputFileName) throws IOException {
FileOutputStream stream = null;
OutputStreamWriter writer = null;
try {
stream = new FileOutputStream(outputFileName);
writer = new OutputStreamWriter(stream, charset);
generateOutput... | java | public void generateOutput(String outputFileName) throws IOException {
FileOutputStream stream = null;
OutputStreamWriter writer = null;
try {
stream = new FileOutputStream(outputFileName);
writer = new OutputStreamWriter(stream, charset);
generateOutput... | [
"public",
"void",
"generateOutput",
"(",
"String",
"outputFileName",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"stream",
"=",
"null",
";",
"OutputStreamWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"stream",
"=",
"new",
"FileOutputStream",
"(",
"... | Generates the HTML page and writes it into a file.
@param outputFileName name of the file to which the generated HTML page will be written.
@throws IOException when an i/o error occurs while writing to the file. | [
"Generates",
"the",
"HTML",
"page",
"and",
"writes",
"it",
"into",
"a",
"file",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L621-L636 |
29,169 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.generateOutput | public void generateOutput(Writer outputWriter) throws IOException {
String s = generateOutput();
outputWriter.write(s);
} | java | public void generateOutput(Writer outputWriter) throws IOException {
String s = generateOutput();
outputWriter.write(s);
} | [
"public",
"void",
"generateOutput",
"(",
"Writer",
"outputWriter",
")",
"throws",
"IOException",
"{",
"String",
"s",
"=",
"generateOutput",
"(",
")",
";",
"outputWriter",
".",
"write",
"(",
"s",
")",
";",
"}"
] | Generates the HTML page and writes it to a character stream.
@param outputWriter a character stream (<code>writer</code>) to which the HTML page will be written.
@throws IOException when an i/o error occurs while writing to the stream. | [
"Generates",
"the",
"HTML",
"page",
"and",
"writes",
"it",
"to",
"a",
"character",
"stream",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L644-L647 |
29,170 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.generateOutput | public String generateOutput() {
if (blockDynTab[0].instances == 0) {
addBlockByNo(0);
} // add main block
for (int blockNo = 0; blockNo < mtp.blockTabCnt; blockNo++) {
BlockDynTabRec bdtr = blockDynTab[blockNo];
bdtr.currBlockInstNo = bdtr.firstBlockIns... | java | public String generateOutput() {
if (blockDynTab[0].instances == 0) {
addBlockByNo(0);
} // add main block
for (int blockNo = 0; blockNo < mtp.blockTabCnt; blockNo++) {
BlockDynTabRec bdtr = blockDynTab[blockNo];
bdtr.currBlockInstNo = bdtr.firstBlockIns... | [
"public",
"String",
"generateOutput",
"(",
")",
"{",
"if",
"(",
"blockDynTab",
"[",
"0",
"]",
".",
"instances",
"==",
"0",
")",
"{",
"addBlockByNo",
"(",
"0",
")",
";",
"}",
"// add main block\r",
"for",
"(",
"int",
"blockNo",
"=",
"0",
";",
"blockNo",... | Generates the HTML page and returns it as a string.
@return A string that contains the generated HTML page. | [
"Generates",
"the",
"HTML",
"page",
"and",
"returns",
"it",
"as",
"a",
"string",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L654-L665 |
29,171 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.writeBlockInstances | private void writeBlockInstances(StringBuilder out, int blockNo, int parentInstLevel) {
BlockDynTabRec bdtr = blockDynTab[blockNo];
while (true) {
int blockInstNo = bdtr.currBlockInstNo;
if (blockInstNo == -1) {
break;
}
BlockInstTab... | java | private void writeBlockInstances(StringBuilder out, int blockNo, int parentInstLevel) {
BlockDynTabRec bdtr = blockDynTab[blockNo];
while (true) {
int blockInstNo = bdtr.currBlockInstNo;
if (blockInstNo == -1) {
break;
}
BlockInstTab... | [
"private",
"void",
"writeBlockInstances",
"(",
"StringBuilder",
"out",
",",
"int",
"blockNo",
",",
"int",
"parentInstLevel",
")",
"{",
"BlockDynTabRec",
"bdtr",
"=",
"blockDynTab",
"[",
"blockNo",
"]",
";",
"while",
"(",
"true",
")",
"{",
"int",
"blockInstNo",... | Called recursively. | [
"Called",
"recursively",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L670-L687 |
29,172 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.beginMainBlock | private void beginMainBlock() {
int blockNo = registerBlock(null); // =0
BlockTabRec btr = blockTab[blockNo];
btr.tPosBegin = 0;
btr.tPosContentsBegin = 0;
openBlocksTab[currentNestingLevel] = blockNo;
currentNestingLevel++;
} | java | private void beginMainBlock() {
int blockNo = registerBlock(null); // =0
BlockTabRec btr = blockTab[blockNo];
btr.tPosBegin = 0;
btr.tPosContentsBegin = 0;
openBlocksTab[currentNestingLevel] = blockNo;
currentNestingLevel++;
} | [
"private",
"void",
"beginMainBlock",
"(",
")",
"{",
"int",
"blockNo",
"=",
"registerBlock",
"(",
"null",
")",
";",
"// =0\r",
"BlockTabRec",
"btr",
"=",
"blockTab",
"[",
"blockNo",
"]",
";",
"btr",
".",
"tPosBegin",
"=",
"0",
";",
"btr",
".",
"tPosConten... | The main block is an implicitly defined block that covers the whole template. | [
"The",
"main",
"block",
"is",
"an",
"implicitly",
"defined",
"block",
"that",
"covers",
"the",
"whole",
"template",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L992-L999 |
29,173 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.endMainBlock | private void endMainBlock() {
BlockTabRec btr = blockTab[0];
btr.tPosContentsEnd = templateText.length();
btr.tPosEnd = templateText.length();
btr.definitionIsOpen = false;
currentNestingLevel--;
} | java | private void endMainBlock() {
BlockTabRec btr = blockTab[0];
btr.tPosContentsEnd = templateText.length();
btr.tPosEnd = templateText.length();
btr.definitionIsOpen = false;
currentNestingLevel--;
} | [
"private",
"void",
"endMainBlock",
"(",
")",
"{",
"BlockTabRec",
"btr",
"=",
"blockTab",
"[",
"0",
"]",
";",
"btr",
".",
"tPosContentsEnd",
"=",
"templateText",
".",
"length",
"(",
")",
";",
"btr",
".",
"tPosEnd",
"=",
"templateText",
".",
"length",
"(",... | Completes the main block registration. | [
"Completes",
"the",
"main",
"block",
"registration",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1002-L1008 |
29,174 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.processTemplateCommand | private boolean processTemplateCommand(String cmdLine, int cmdTPosBegin, int cmdTPosEnd)
throws MiniTemplator.TemplateSyntaxException {
int p0 = skipBlanks(cmdLine, 0);
if (p0 >= cmdLine.length()) {
return false;
}
int p = skipNonBlanks(cmdLine, p0);
... | java | private boolean processTemplateCommand(String cmdLine, int cmdTPosBegin, int cmdTPosEnd)
throws MiniTemplator.TemplateSyntaxException {
int p0 = skipBlanks(cmdLine, 0);
if (p0 >= cmdLine.length()) {
return false;
}
int p = skipNonBlanks(cmdLine, p0);
... | [
"private",
"boolean",
"processTemplateCommand",
"(",
"String",
"cmdLine",
",",
"int",
"cmdTPosBegin",
",",
"int",
"cmdTPosEnd",
")",
"throws",
"MiniTemplator",
".",
"TemplateSyntaxException",
"{",
"int",
"p0",
"=",
"skipBlanks",
"(",
"cmdLine",
",",
"0",
")",
";... | Returns false if the command should be treatet as normal template text. | [
"Returns",
"false",
"if",
"the",
"command",
"should",
"be",
"treatet",
"as",
"normal",
"template",
"text",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1069-L1102 |
29,175 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.processShortFormTemplateCommand | private boolean processShortFormTemplateCommand(String cmdLine, int cmdTPosBegin, int cmdTPosEnd)
throws MiniTemplator.TemplateSyntaxException {
int p0 = skipBlanks(cmdLine, 0);
if (p0 >= cmdLine.length()) {
return false;
}
int p = p0;
char cmd1 = c... | java | private boolean processShortFormTemplateCommand(String cmdLine, int cmdTPosBegin, int cmdTPosEnd)
throws MiniTemplator.TemplateSyntaxException {
int p0 = skipBlanks(cmdLine, 0);
if (p0 >= cmdLine.length()) {
return false;
}
int p = p0;
char cmd1 = c... | [
"private",
"boolean",
"processShortFormTemplateCommand",
"(",
"String",
"cmdLine",
",",
"int",
"cmdTPosBegin",
",",
"int",
"cmdTPosEnd",
")",
"throws",
"MiniTemplator",
".",
"TemplateSyntaxException",
"{",
"int",
"p0",
"=",
"skipBlanks",
"(",
"cmdLine",
",",
"0",
... | Returns false if the command is not recognized and should be treatet as normal temlate text. | [
"Returns",
"false",
"if",
"the",
"command",
"is",
"not",
"recognized",
"and",
"should",
"be",
"treatet",
"as",
"normal",
"temlate",
"text",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1105-L1133 |
29,176 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.registerBlock | private int registerBlock(String blockName) {
int blockNo = blockTabCnt++;
if (blockTabCnt > blockTab.length) {
blockTab = (BlockTabRec[]) resizeArray(blockTab, 2 * blockTabCnt);
}
BlockTabRec btr = new BlockTabRec();
blockTab[blockNo] = btr;
btr.blockN... | java | private int registerBlock(String blockName) {
int blockNo = blockTabCnt++;
if (blockTabCnt > blockTab.length) {
blockTab = (BlockTabRec[]) resizeArray(blockTab, 2 * blockTabCnt);
}
BlockTabRec btr = new BlockTabRec();
blockTab[blockNo] = btr;
btr.blockN... | [
"private",
"int",
"registerBlock",
"(",
"String",
"blockName",
")",
"{",
"int",
"blockNo",
"=",
"blockTabCnt",
"++",
";",
"if",
"(",
"blockTabCnt",
">",
"blockTab",
".",
"length",
")",
"{",
"blockTab",
"=",
"(",
"BlockTabRec",
"[",
"]",
")",
"resizeArray",... | Returns the block number of the newly registered block. | [
"Returns",
"the",
"block",
"number",
"of",
"the",
"newly",
"registered",
"block",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1203-L1231 |
29,177 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.excludeTemplateRange | private void excludeTemplateRange(int tPosBegin, int tPosEnd) {
if (blockTabCnt > 0) {
// Check whether we can extend the previous block.
BlockTabRec btr = blockTab[blockTabCnt - 1];
if (btr.dummy && btr.tPosEnd == tPosBegin) {
btr.tPosContentsEnd = tPosE... | java | private void excludeTemplateRange(int tPosBegin, int tPosEnd) {
if (blockTabCnt > 0) {
// Check whether we can extend the previous block.
BlockTabRec btr = blockTab[blockTabCnt - 1];
if (btr.dummy && btr.tPosEnd == tPosBegin) {
btr.tPosContentsEnd = tPosE... | [
"private",
"void",
"excludeTemplateRange",
"(",
"int",
"tPosBegin",
",",
"int",
"tPosEnd",
")",
"{",
"if",
"(",
"blockTabCnt",
">",
"0",
")",
"{",
"// Check whether we can extend the previous block.\r",
"BlockTabRec",
"btr",
"=",
"blockTab",
"[",
"blockTabCnt",
"-",... | Registers a dummy block to exclude a range within the template text. | [
"Registers",
"a",
"dummy",
"block",
"to",
"exclude",
"a",
"range",
"within",
"the",
"template",
"text",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1234-L1252 |
29,178 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.checkBlockDefinitionsComplete | private void checkBlockDefinitionsComplete() throws MiniTemplator.TemplateSyntaxException {
for (int blockNo = 0; blockNo < blockTabCnt; blockNo++) {
BlockTabRec btr = blockTab[blockNo];
if (btr.definitionIsOpen) {
throw new MiniTemplator.TemplateSyntaxException(
... | java | private void checkBlockDefinitionsComplete() throws MiniTemplator.TemplateSyntaxException {
for (int blockNo = 0; blockNo < blockTabCnt; blockNo++) {
BlockTabRec btr = blockTab[blockNo];
if (btr.definitionIsOpen) {
throw new MiniTemplator.TemplateSyntaxException(
... | [
"private",
"void",
"checkBlockDefinitionsComplete",
"(",
")",
"throws",
"MiniTemplator",
".",
"TemplateSyntaxException",
"{",
"for",
"(",
"int",
"blockNo",
"=",
"0",
";",
"blockNo",
"<",
"blockTabCnt",
";",
"blockNo",
"++",
")",
"{",
"BlockTabRec",
"btr",
"=",
... | Checks that all block definitions are closed. | [
"Checks",
"that",
"all",
"block",
"definitions",
"are",
"closed",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1255-L1266 |
29,179 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.conditionalExclude | private boolean conditionalExclude(int tPosBegin, int tPosEnd) {
if (isCondEnabled(condLevel)) {
return false;
}
excludeTemplateRange(tPosBegin, tPosEnd);
return true;
} | java | private boolean conditionalExclude(int tPosBegin, int tPosEnd) {
if (isCondEnabled(condLevel)) {
return false;
}
excludeTemplateRange(tPosBegin, tPosEnd);
return true;
} | [
"private",
"boolean",
"conditionalExclude",
"(",
"int",
"tPosBegin",
",",
"int",
"tPosEnd",
")",
"{",
"if",
"(",
"isCondEnabled",
"(",
"condLevel",
")",
")",
"{",
"return",
"false",
";",
"}",
"excludeTemplateRange",
"(",
"tPosBegin",
",",
"tPosEnd",
")",
";"... | Otherwise nothing is done and false is returned. | [
"Otherwise",
"nothing",
"is",
"done",
"and",
"false",
"is",
"returned",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1335-L1341 |
29,180 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.evaluateConditionFlags | private boolean evaluateConditionFlags(String flags) {
int p = 0;
while (true) {
p = skipBlanks(flags, p);
if (p >= flags.length()) {
break;
}
boolean complement = false;
if (flags.charAt(p) == '!') {
co... | java | private boolean evaluateConditionFlags(String flags) {
int p = 0;
while (true) {
p = skipBlanks(flags, p);
if (p >= flags.length()) {
break;
}
boolean complement = false;
if (flags.charAt(p) == '!') {
co... | [
"private",
"boolean",
"evaluateConditionFlags",
"(",
"String",
"flags",
")",
"{",
"int",
"p",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"p",
"=",
"skipBlanks",
"(",
"flags",
",",
"p",
")",
";",
"if",
"(",
"p",
">=",
"flags",
".",
"length",
"("... | Returns true the condition is met. | [
"Returns",
"true",
"the",
"condition",
"is",
"met",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1346-L1370 |
29,181 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.associateVariablesWithBlocks | private void associateVariablesWithBlocks() {
int varRefNo = 0;
int activeBlockNo = 0;
int nextBlockNo = 1;
while (varRefNo < varRefTabCnt) {
VarRefTabRec vrtr = varRefTab[varRefNo];
int varRefTPos = vrtr.tPosBegin;
int varNo = vrtr.varNo;
... | java | private void associateVariablesWithBlocks() {
int varRefNo = 0;
int activeBlockNo = 0;
int nextBlockNo = 1;
while (varRefNo < varRefTabCnt) {
VarRefTabRec vrtr = varRefTab[varRefNo];
int varRefTPos = vrtr.tPosBegin;
int varNo = vrtr.varNo;
... | [
"private",
"void",
"associateVariablesWithBlocks",
"(",
")",
"{",
"int",
"varRefNo",
"=",
"0",
";",
"int",
"activeBlockNo",
"=",
"0",
";",
"int",
"nextBlockNo",
"=",
"1",
";",
"while",
"(",
"varRefNo",
"<",
"varRefTabCnt",
")",
"{",
"VarRefTabRec",
"vrtr",
... | Associates variable references with blocks. | [
"Associates",
"variable",
"references",
"with",
"blocks",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1432-L1465 |
29,182 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.registerVariable | private int registerVariable(String varName) {
int varNo = varTabCnt++;
if (varTabCnt > varTab.length) {
varTab = (String[]) resizeArray(varTab, 2 * varTabCnt);
}
varTab[varNo] = varName;
varNameToNoMap.put(varName.toUpperCase(), new Integer(varNo));
re... | java | private int registerVariable(String varName) {
int varNo = varTabCnt++;
if (varTabCnt > varTab.length) {
varTab = (String[]) resizeArray(varTab, 2 * varTabCnt);
}
varTab[varNo] = varName;
varNameToNoMap.put(varName.toUpperCase(), new Integer(varNo));
re... | [
"private",
"int",
"registerVariable",
"(",
"String",
"varName",
")",
"{",
"int",
"varNo",
"=",
"varTabCnt",
"++",
";",
"if",
"(",
"varTabCnt",
">",
"varTab",
".",
"length",
")",
"{",
"varTab",
"=",
"(",
"String",
"[",
"]",
")",
"resizeArray",
"(",
"var... | Returns the variable number of the newly registered variable. | [
"Returns",
"the",
"variable",
"number",
"of",
"the",
"newly",
"registered",
"variable",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1509-L1517 |
29,183 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.lookupVariableName | public int lookupVariableName(String varName) {
Integer varNoWrapper = varNameToNoMap.get(varName.toUpperCase());
if (varNoWrapper == null) {
return -1;
}
int varNo = varNoWrapper.intValue();
return varNo;
} | java | public int lookupVariableName(String varName) {
Integer varNoWrapper = varNameToNoMap.get(varName.toUpperCase());
if (varNoWrapper == null) {
return -1;
}
int varNo = varNoWrapper.intValue();
return varNo;
} | [
"public",
"int",
"lookupVariableName",
"(",
"String",
"varName",
")",
"{",
"Integer",
"varNoWrapper",
"=",
"varNameToNoMap",
".",
"get",
"(",
"varName",
".",
"toUpperCase",
"(",
")",
")",
";",
"if",
"(",
"varNoWrapper",
"==",
"null",
")",
"{",
"return",
"-... | Returns -1 if the variable name is not found. | [
"Returns",
"-",
"1",
"if",
"the",
"variable",
"name",
"is",
"not",
"found",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1523-L1530 |
29,184 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplatorParser.lookupBlockName | public int lookupBlockName(String blockName) {
Integer blockNoWrapper = blockNameToNoMap.get(blockName.toUpperCase());
if (blockNoWrapper == null) {
return -1;
}
int blockNo = blockNoWrapper.intValue();
return blockNo;
} | java | public int lookupBlockName(String blockName) {
Integer blockNoWrapper = blockNameToNoMap.get(blockName.toUpperCase());
if (blockNoWrapper == null) {
return -1;
}
int blockNo = blockNoWrapper.intValue();
return blockNo;
} | [
"public",
"int",
"lookupBlockName",
"(",
"String",
"blockName",
")",
"{",
"Integer",
"blockNoWrapper",
"=",
"blockNameToNoMap",
".",
"get",
"(",
"blockName",
".",
"toUpperCase",
"(",
")",
")",
";",
"if",
"(",
"blockNoWrapper",
"==",
"null",
")",
"{",
"return... | Returns -1 if the block name is not found. | [
"Returns",
"-",
"1",
"if",
"the",
"block",
"name",
"is",
"not",
"found",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1536-L1543 |
29,185 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/TemplateCodeGenerator.java | TemplateCodeGenerator.initEncodeMethodTemplateVariable | protected void initEncodeMethodTemplateVariable() {
Set<Integer> orders = new HashSet<Integer>();
// encode method
for (FieldInfo field : fields) {
boolean isList = field.isList();
// check type
if (!isList) {
checkType(field.getFieldT... | java | protected void initEncodeMethodTemplateVariable() {
Set<Integer> orders = new HashSet<Integer>();
// encode method
for (FieldInfo field : fields) {
boolean isList = field.isList();
// check type
if (!isList) {
checkType(field.getFieldT... | [
"protected",
"void",
"initEncodeMethodTemplateVariable",
"(",
")",
"{",
"Set",
"<",
"Integer",
">",
"orders",
"=",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",
";",
"// encode method\r",
"for",
"(",
"FieldInfo",
"field",
":",
"fields",
")",
"{",
"boolean... | Inits the encode method template variable. | [
"Inits",
"the",
"encode",
"method",
"template",
"variable",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/TemplateCodeGenerator.java#L136-L182 |
29,186 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getWriteValueToField | public static String getWriteValueToField(FieldType type, String express, boolean isList) {
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
String method = "copyFromUtf8";
if (type == FieldType.BYTES) {
method = "copyFrom";
}
... | java | public static String getWriteValueToField(FieldType type, String express, boolean isList) {
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
String method = "copyFromUtf8";
if (type == FieldType.BYTES) {
method = "copyFrom";
}
... | [
"public",
"static",
"String",
"getWriteValueToField",
"(",
"FieldType",
"type",
",",
"String",
"express",
",",
"boolean",
"isList",
")",
"{",
"if",
"(",
"(",
"type",
"==",
"FieldType",
".",
"STRING",
"||",
"type",
"==",
"FieldType",
".",
"BYTES",
")",
"&&"... | Gets the write value to field.
@param type the type
@param express the express
@param isList the is list
@return the write value to field | [
"Gets",
"the",
"write",
"value",
"to",
"field",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L155-L166 |
29,187 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getRequiredCheck | public static String getRequiredCheck(int order, Field field) {
String fieldName = getFieldName(order);
String code = "if (" + fieldName + "== null) {\n";
code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"))"
+ ClassCode.JAVA_LINE_BR... | java | public static String getRequiredCheck(int order, Field field) {
String fieldName = getFieldName(order);
String code = "if (" + fieldName + "== null) {\n";
code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"))"
+ ClassCode.JAVA_LINE_BR... | [
"public",
"static",
"String",
"getRequiredCheck",
"(",
"int",
"order",
",",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"getFieldName",
"(",
"order",
")",
";",
"String",
"code",
"=",
"\"if (\"",
"+",
"fieldName",
"+",
"\"== null) {\\n\"",
";",
"c... | get required field check java expression.
@param order field order
@param field java field
@return full java expression | [
"get",
"required",
"field",
"check",
"java",
"expression",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L477-L485 |
29,188 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getEnumName | public static String getEnumName(Enum[] e, int value) {
if (e != null) {
int toCompareValue;
for (Enum en : e) {
if (en instanceof EnumReadable) {
toCompareValue = ((EnumReadable) en).value();
} else {
toCompareValue... | java | public static String getEnumName(Enum[] e, int value) {
if (e != null) {
int toCompareValue;
for (Enum en : e) {
if (en instanceof EnumReadable) {
toCompareValue = ((EnumReadable) en).value();
} else {
toCompareValue... | [
"public",
"static",
"String",
"getEnumName",
"(",
"Enum",
"[",
"]",
"e",
",",
"int",
"value",
")",
"{",
"if",
"(",
"e",
"!=",
"null",
")",
"{",
"int",
"toCompareValue",
";",
"for",
"(",
"Enum",
"en",
":",
"e",
")",
"{",
"if",
"(",
"en",
"instance... | Gets the enum name.
@param e the e
@param value the value
@return the enum name | [
"Gets",
"the",
"enum",
"name",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L632-L647 |
29,189 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getEnumValue | public static <T extends Enum<T>> T getEnumValue(Class<T> enumType,
String name) {
if (StringUtils.isEmpty(name)) {
return null;
}
try {
T v = Enum.valueOf(enumType, name);
return v;
} catch (IllegalArgumentException e) {
... | java | public static <T extends Enum<T>> T getEnumValue(Class<T> enumType,
String name) {
if (StringUtils.isEmpty(name)) {
return null;
}
try {
T v = Enum.valueOf(enumType, name);
return v;
} catch (IllegalArgumentException e) {
... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnumValue",
"(",
"Class",
"<",
"T",
">",
"enumType",
",",
"String",
"name",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"name",
")",
")",
"{",
"return",
"nul... | Gets the enumeration value.
@param <T> the generic type
@param enumType the enum type
@param name the name
@return the enum value | [
"Gets",
"the",
"enumeration",
"value",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L658-L670 |
29,190 | jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.convertList | private static List<Integer> convertList(List<String> list) {
if (list == null) {
return null;
}
List<Integer> ret = new ArrayList<Integer>(list.size());
for (String v : list) {
ret.add(StringUtils.toInt(v));
}
return ret;
} | java | private static List<Integer> convertList(List<String> list) {
if (list == null) {
return null;
}
List<Integer> ret = new ArrayList<Integer>(list.size());
for (String v : list) {
ret.add(StringUtils.toInt(v));
}
return ret;
} | [
"private",
"static",
"List",
"<",
"Integer",
">",
"convertList",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"Integer",
">",
"ret",
"=",
"new",
"ArrayList",
... | Convert list.
@param list the list
@return the list | [
"Convert",
"list",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L867-L877 |
29,191 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/JprotobufPreCompileMain.java | JprotobufPreCompileMain.isStartWith | private static boolean isStartWith(String testString, String[] targetStrings) {
for (String s : targetStrings) {
if (testString.startsWith(s)) {
return true;
}
}
return false;
} | java | private static boolean isStartWith(String testString, String[] targetStrings) {
for (String s : targetStrings) {
if (testString.startsWith(s)) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"isStartWith",
"(",
"String",
"testString",
",",
"String",
"[",
"]",
"targetStrings",
")",
"{",
"for",
"(",
"String",
"s",
":",
"targetStrings",
")",
"{",
"if",
"(",
"testString",
".",
"startsWith",
"(",
"s",
")",
")",
"{"... | Checks if is start with.
@param testString the test string
@param targetStrings the target strings
@return true, if is start with | [
"Checks",
"if",
"is",
"start",
"with",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/JprotobufPreCompileMain.java#L112-L120 |
29,192 | jhunters/jprotobuf | jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/JprotobufPreCompileMain.java | JprotobufPreCompileMain.getByClass | private static Class getByClass(String name) {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
} catch (Throwable e) {
}
return null;
} | java | private static Class getByClass(String name) {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
} catch (Throwable e) {
}
return null;
} | [
"private",
"static",
"Class",
"getByClass",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"loadClass",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"Throwable",
... | Gets the by class.
@param name the name
@return the by class | [
"Gets",
"the",
"by",
"class",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/jprotobuf-precompile-plugin/src/main/java/com/baidu/jprotobuf/mojo/JprotobufPreCompileMain.java#L128-L134 |
29,193 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.newDefaultInstance | public static <K, V> MapEntryLite<K, V> newDefaultInstance(WireFormat.FieldType keyType, K defaultKey,
WireFormat.FieldType valueType, V defaultValue) {
return new MapEntryLite<K, V>(keyType, defaultKey, valueType, defaultValue);
} | java | public static <K, V> MapEntryLite<K, V> newDefaultInstance(WireFormat.FieldType keyType, K defaultKey,
WireFormat.FieldType valueType, V defaultValue) {
return new MapEntryLite<K, V>(keyType, defaultKey, valueType, defaultValue);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapEntryLite",
"<",
"K",
",",
"V",
">",
"newDefaultInstance",
"(",
"WireFormat",
".",
"FieldType",
"keyType",
",",
"K",
"defaultKey",
",",
"WireFormat",
".",
"FieldType",
"valueType",
",",
"V",
"defaultValue",
... | Creates a default MapEntryLite message instance.
This method is used by generated code to create the default instance for a map entry message. The created default
instance should be used to create new map entry messages of the same type. For each map entry message, only one
default instance should be created.
@param ... | [
"Creates",
"a",
"default",
"MapEntryLite",
"message",
"instance",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L154-L157 |
29,194 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.writeTo | static <K, V> void writeTo(CodedOutputStream output, Metadata<K, V> metadata, K key, V value) throws IOException {
CodedConstant.writeElement(output, metadata.keyType, KEY_FIELD_NUMBER, key);
CodedConstant.writeElement(output, metadata.valueType, VALUE_FIELD_NUMBER, value);
} | java | static <K, V> void writeTo(CodedOutputStream output, Metadata<K, V> metadata, K key, V value) throws IOException {
CodedConstant.writeElement(output, metadata.keyType, KEY_FIELD_NUMBER, key);
CodedConstant.writeElement(output, metadata.valueType, VALUE_FIELD_NUMBER, value);
} | [
"static",
"<",
"K",
",",
"V",
">",
"void",
"writeTo",
"(",
"CodedOutputStream",
"output",
",",
"Metadata",
"<",
"K",
",",
"V",
">",
"metadata",
",",
"K",
"key",
",",
"V",
"value",
")",
"throws",
"IOException",
"{",
"CodedConstant",
".",
"writeElement",
... | Write to.
@param <K> the key type
@param <V> the value type
@param output the output
@param metadata the metadata
@param key the key
@param value the value
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"to",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L170-L173 |
29,195 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.computeSerializedSize | static <K, V> int computeSerializedSize(Metadata<K, V> metadata, K key, V value) {
return CodedConstant.computeElementSize(metadata.keyType, KEY_FIELD_NUMBER, key)
+ CodedConstant.computeElementSize(metadata.valueType, VALUE_FIELD_NUMBER, value);
} | java | static <K, V> int computeSerializedSize(Metadata<K, V> metadata, K key, V value) {
return CodedConstant.computeElementSize(metadata.keyType, KEY_FIELD_NUMBER, key)
+ CodedConstant.computeElementSize(metadata.valueType, VALUE_FIELD_NUMBER, value);
} | [
"static",
"<",
"K",
",",
"V",
">",
"int",
"computeSerializedSize",
"(",
"Metadata",
"<",
"K",
",",
"V",
">",
"metadata",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"CodedConstant",
".",
"computeElementSize",
"(",
"metadata",
".",
"keyType",
... | Compute serialized size.
@param <K> the key type
@param <V> the value type
@param metadata the metadata
@param key the key
@param value the value
@return the int | [
"Compute",
"serialized",
"size",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L185-L188 |
29,196 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.parseField | @SuppressWarnings("unchecked")
static <T> T parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type,
T value) throws IOException {
switch (type) {
case MESSAGE:
int length = input.readRawVarint32();
final i... | java | @SuppressWarnings("unchecked")
static <T> T parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type,
T value) throws IOException {
switch (type) {
case MESSAGE:
int length = input.readRawVarint32();
final i... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"T",
">",
"T",
"parseField",
"(",
"CodedInputStream",
"input",
",",
"ExtensionRegistryLite",
"extensionRegistry",
",",
"WireFormat",
".",
"FieldType",
"type",
",",
"T",
"value",
")",
"throws",
"I... | Parses the field.
@param <T> the generic type
@param input the input
@param extensionRegistry the extension registry
@param type the type
@param value the value
@return the t
@throws IOException Signals that an I/O exception has occurred. | [
"Parses",
"the",
"field",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L201-L219 |
29,197 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.parseEntry | static <K, V> Map.Entry<K, V> parseEntry(CodedInputStream input, Metadata<K, V> metadata,
ExtensionRegistryLite extensionRegistry) throws IOException {
K key = metadata.defaultKey;
V value = metadata.defaultValue;
while (true) {
int tag = input.readTag();
if (... | java | static <K, V> Map.Entry<K, V> parseEntry(CodedInputStream input, Metadata<K, V> metadata,
ExtensionRegistryLite extensionRegistry) throws IOException {
K key = metadata.defaultKey;
V value = metadata.defaultValue;
while (true) {
int tag = input.readTag();
if (... | [
"static",
"<",
"K",
",",
"V",
">",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"parseEntry",
"(",
"CodedInputStream",
"input",
",",
"Metadata",
"<",
"K",
",",
"V",
">",
"metadata",
",",
"ExtensionRegistryLite",
"extensionRegistry",
")",
"throws",
"IOEx... | Parses the entry.
@param <K> the key type
@param <V> the value type
@param input the input
@param metadata the metadata
@param extensionRegistry the extension registry
@return the map. entry
@throws IOException Signals that an I/O exception has occurred. | [
"Parses",
"the",
"entry",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L277-L297 |
29,198 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java | IDLProxyObject.newInstnace | public IDLProxyObject newInstnace() {
try {
Object object = cls.newInstance();
return new IDLProxyObject(codec, object, cls);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | java | public IDLProxyObject newInstnace() {
try {
Object object = cls.newInstance();
return new IDLProxyObject(codec, object, cls);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
} | [
"public",
"IDLProxyObject",
"newInstnace",
"(",
")",
"{",
"try",
"{",
"Object",
"object",
"=",
"cls",
".",
"newInstance",
"(",
")",
";",
"return",
"new",
"IDLProxyObject",
"(",
"codec",
",",
"object",
",",
"cls",
")",
";",
"}",
"catch",
"(",
"Exception",... | New instnace.
@return the IDL proxy object | [
"New",
"instnace",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java#L97-L104 |
29,199 | jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java | IDLProxyObject.doSetFieldValue | private IDLProxyObject doSetFieldValue(String fullField, String field, Object value, Object object,
boolean useCache, Map<String, ReflectInfo> cachedFields) {
Field f;
// check cache
if (useCache) {
ReflectInfo info = cachedFields.get(fullField);
if (inf... | java | private IDLProxyObject doSetFieldValue(String fullField, String field, Object value, Object object,
boolean useCache, Map<String, ReflectInfo> cachedFields) {
Field f;
// check cache
if (useCache) {
ReflectInfo info = cachedFields.get(fullField);
if (inf... | [
"private",
"IDLProxyObject",
"doSetFieldValue",
"(",
"String",
"fullField",
",",
"String",
"field",
",",
"Object",
"value",
",",
"Object",
"object",
",",
"boolean",
"useCache",
",",
"Map",
"<",
"String",
",",
"ReflectInfo",
">",
"cachedFields",
")",
"{",
"Fiel... | Do set field value.
@param fullField the full field
@param field the field
@param value the value
@param object the object
@param useCache the use cache
@param cachedFields the cached fields
@return the IDL proxy object | [
"Do",
"set",
"field",
"value",
"."
] | 55832c9b4792afb128e5b35139d8a3891561d8a3 | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/IDLProxyObject.java#L117-L174 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.