repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG5.java | WFG5.t1 | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
for (int i = 0; i < z.length; i++) {
result[i] = (new Transformations()).sDecept(z[i], (float) 0.35, (float) 0.001, (float) 0.05);
}
return result;
} | java | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
for (int i = 0; i < z.length; i++) {
result[i] = (new Transformations()).sDecept(z[i], (float) 0.35, (float) 0.001, (float) 0.05);
}
return result;
} | [
"public",
"float",
"[",
"]",
"t1",
"(",
"float",
"[",
"]",
"z",
",",
"int",
"k",
")",
"{",
"float",
"[",
"]",
"result",
"=",
"new",
"float",
"[",
"z",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"z",
".",
"le... | WFG5 t1 transformation | [
"WFG5",
"t1",
"transformation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG5.java#L67-L75 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java | IBEA.calculateHypervolumeIndicator | double calculateHypervolumeIndicator(Solution<?> solutionA, Solution<?> solutionB, int d,
double maximumValues[], double minimumValues[]) {
double a, b, r, max;
double volume ;
double rho = 2.0;
r = rho * (maximumValues[d - 1] - minimumValues[d - 1]);
max = minimumValues[d - 1] + r;
a = ... | java | double calculateHypervolumeIndicator(Solution<?> solutionA, Solution<?> solutionB, int d,
double maximumValues[], double minimumValues[]) {
double a, b, r, max;
double volume ;
double rho = 2.0;
r = rho * (maximumValues[d - 1] - minimumValues[d - 1]);
max = minimumValues[d - 1] + r;
a = ... | [
"double",
"calculateHypervolumeIndicator",
"(",
"Solution",
"<",
"?",
">",
"solutionA",
",",
"Solution",
"<",
"?",
">",
"solutionB",
",",
"int",
"d",
",",
"double",
"maximumValues",
"[",
"]",
",",
"double",
"minimumValues",
"[",
"]",
")",
"{",
"double",
"a... | Calculates the hypervolume of that portion of the objective space that
is dominated by individual a but not by individual b | [
"Calculates",
"the",
"hypervolume",
"of",
"that",
"portion",
"of",
"the",
"objective",
"space",
"that",
"is",
"dominated",
"by",
"individual",
"a",
"but",
"not",
"by",
"individual",
"b"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java#L126-L164 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java | IBEA.computeIndicatorValuesHD | public void computeIndicatorValuesHD(List<S> solutionSet, double[] maximumValues,
double[] minimumValues) {
List<S> A, B;
// Initialize the structures
indicatorValues = new ArrayList<List<Double>>();
maxIndicatorValue = -Double.MAX_VALUE;
for (int j = 0; j < solutionSet.size(); j++) {
A... | java | public void computeIndicatorValuesHD(List<S> solutionSet, double[] maximumValues,
double[] minimumValues) {
List<S> A, B;
// Initialize the structures
indicatorValues = new ArrayList<List<Double>>();
maxIndicatorValue = -Double.MAX_VALUE;
for (int j = 0; j < solutionSet.size(); j++) {
A... | [
"public",
"void",
"computeIndicatorValuesHD",
"(",
"List",
"<",
"S",
">",
"solutionSet",
",",
"double",
"[",
"]",
"maximumValues",
",",
"double",
"[",
"]",
"minimumValues",
")",
"{",
"List",
"<",
"S",
">",
"A",
",",
"B",
";",
"// Initialize the structures",
... | This structure stores the indicator values of each pair of elements | [
"This",
"structure",
"stores",
"the",
"indicator",
"values",
"of",
"each",
"pair",
"of",
"elements"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java#L169-L205 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java | IBEA.fitness | public void fitness(List<S> solutionSet, int pos) {
double fitness = 0.0;
double kappa = 0.05;
for (int i = 0; i < solutionSet.size(); i++) {
if (i != pos) {
fitness += Math.exp((-1 * indicatorValues.get(i).get(pos) / maxIndicatorValue) / kappa);
}
}
solutionFitness.setAttribute... | java | public void fitness(List<S> solutionSet, int pos) {
double fitness = 0.0;
double kappa = 0.05;
for (int i = 0; i < solutionSet.size(); i++) {
if (i != pos) {
fitness += Math.exp((-1 * indicatorValues.get(i).get(pos) / maxIndicatorValue) / kappa);
}
}
solutionFitness.setAttribute... | [
"public",
"void",
"fitness",
"(",
"List",
"<",
"S",
">",
"solutionSet",
",",
"int",
"pos",
")",
"{",
"double",
"fitness",
"=",
"0.0",
";",
"double",
"kappa",
"=",
"0.05",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"solutionSet",
".",
"... | Calculate the fitness for the individual at position pos | [
"Calculate",
"the",
"fitness",
"for",
"the",
"individual",
"at",
"position",
"pos"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java#L210-L220 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java | IBEA.calculateFitness | public void calculateFitness(List<S> solutionSet) {
// Obtains the lower and upper bounds of the population
double[] maximumValues = new double[problem.getNumberOfObjectives()];
double[] minimumValues = new double[problem.getNumberOfObjectives()];
for (int i = 0; i < problem.getNumberOfObjectives(); i+... | java | public void calculateFitness(List<S> solutionSet) {
// Obtains the lower and upper bounds of the population
double[] maximumValues = new double[problem.getNumberOfObjectives()];
double[] minimumValues = new double[problem.getNumberOfObjectives()];
for (int i = 0; i < problem.getNumberOfObjectives(); i+... | [
"public",
"void",
"calculateFitness",
"(",
"List",
"<",
"S",
">",
"solutionSet",
")",
"{",
"// Obtains the lower and upper bounds of the population",
"double",
"[",
"]",
"maximumValues",
"=",
"new",
"double",
"[",
"problem",
".",
"getNumberOfObjectives",
"(",
")",
"... | Calculate the fitness for the entire population. | [
"Calculate",
"the",
"fitness",
"for",
"the",
"entire",
"population",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java#L225-L251 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java | IBEA.removeWorst | public void removeWorst(List<S> solutionSet) {
// Find the worst;
double worst = (double) solutionFitness.getAttribute(solutionSet.get(0));
int worstIndex = 0;
double kappa = 0.05;
for (int i = 1; i < solutionSet.size(); i++) {
if ((double) solutionFitness.getAttribute(solutionSet.get(i)) > ... | java | public void removeWorst(List<S> solutionSet) {
// Find the worst;
double worst = (double) solutionFitness.getAttribute(solutionSet.get(0));
int worstIndex = 0;
double kappa = 0.05;
for (int i = 1; i < solutionSet.size(); i++) {
if ((double) solutionFitness.getAttribute(solutionSet.get(i)) > ... | [
"public",
"void",
"removeWorst",
"(",
"List",
"<",
"S",
">",
"solutionSet",
")",
"{",
"// Find the worst;",
"double",
"worst",
"=",
"(",
"double",
")",
"solutionFitness",
".",
"getAttribute",
"(",
"solutionSet",
".",
"get",
"(",
"0",
")",
")",
";",
"int",
... | Update the fitness before removing an individual | [
"Update",
"the",
"fitness",
"before",
"removing",
"an",
"individual"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/ibea/IBEA.java#L256-L286 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/SetCoverage.java | SetCoverage.evaluate | public double evaluate(List<? extends Solution<?>> set1, List<? extends Solution<?>> set2) {
double result ;
int sum = 0 ;
if (set2.size()==0) {
if (set1.size()==0) {
result = 0.0 ;
} else {
result = 1.0 ;
}
} else {
for (Solution<?> solution : set2) {
if... | java | public double evaluate(List<? extends Solution<?>> set1, List<? extends Solution<?>> set2) {
double result ;
int sum = 0 ;
if (set2.size()==0) {
if (set1.size()==0) {
result = 0.0 ;
} else {
result = 1.0 ;
}
} else {
for (Solution<?> solution : set2) {
if... | [
"public",
"double",
"evaluate",
"(",
"List",
"<",
"?",
"extends",
"Solution",
"<",
"?",
">",
">",
"set1",
",",
"List",
"<",
"?",
"extends",
"Solution",
"<",
"?",
">",
">",
"set2",
")",
"{",
"double",
"result",
";",
"int",
"sum",
"=",
"0",
";",
"i... | Calculates the set coverage of set1 over set2
@param set1
@param set2
@return The value of the set coverage | [
"Calculates",
"the",
"set",
"coverage",
"of",
"set1",
"over",
"set2"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/SetCoverage.java#L52-L71 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/algorithm/impl/AbstractGeneticAlgorithm.java | AbstractGeneticAlgorithm.checkNumberOfParents | protected void checkNumberOfParents(List<S> population, int numberOfParentsForCrossover) {
if ((population.size() % numberOfParentsForCrossover) != 0) {
throw new JMetalException("Wrong number of parents: the remainder if the " +
"population size (" + population.size() + ") is not divisible by "... | java | protected void checkNumberOfParents(List<S> population, int numberOfParentsForCrossover) {
if ((population.size() % numberOfParentsForCrossover) != 0) {
throw new JMetalException("Wrong number of parents: the remainder if the " +
"population size (" + population.size() + ") is not divisible by "... | [
"protected",
"void",
"checkNumberOfParents",
"(",
"List",
"<",
"S",
">",
"population",
",",
"int",
"numberOfParentsForCrossover",
")",
"{",
"if",
"(",
"(",
"population",
".",
"size",
"(",
")",
"%",
"numberOfParentsForCrossover",
")",
"!=",
"0",
")",
"{",
"th... | A crossover operator is applied to a number of parents, and it assumed that the population contains
a valid number of solutions. This method checks that.
@param population
@param numberOfParentsForCrossover | [
"A",
"crossover",
"operator",
"is",
"applied",
"to",
"a",
"number",
"of",
"parents",
"and",
"it",
"assumed",
"that",
"the",
"population",
"contains",
"a",
"valid",
"number",
"of",
"solutions",
".",
"This",
"method",
"checks",
"that",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/algorithm/impl/AbstractGeneticAlgorithm.java#L122-L128 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.location | public int location(S solution) {
//Create a int [] to store the range of each objective
int[] position = new int[numberOfObjectives];
//Calculate the position for each objective
for (int obj = 0; obj < numberOfObjectives; obj++) {
if ((solution.getObjective(obj) > gridUpperLimits[obj])
... | java | public int location(S solution) {
//Create a int [] to store the range of each objective
int[] position = new int[numberOfObjectives];
//Calculate the position for each objective
for (int obj = 0; obj < numberOfObjectives; obj++) {
if ((solution.getObjective(obj) > gridUpperLimits[obj])
... | [
"public",
"int",
"location",
"(",
"S",
"solution",
")",
"{",
"//Create a int [] to store the range of each objective\r",
"int",
"[",
"]",
"position",
"=",
"new",
"int",
"[",
"numberOfObjectives",
"]",
";",
"//Calculate the position for each objective\r",
"for",
"(",
"in... | Calculates the hypercube of a solution
@param solution The <code>Solution</code>. | [
"Calculates",
"the",
"hypercube",
"of",
"a",
"solution"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L175-L210 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.removeSolution | public void removeSolution(int location) {
//Decrease the solutions in the location specified.
hypercubes[location]--;
//Update the most populated hypercube
if (location == mostPopulatedHypercube) {
for (int i = 0; i < hypercubes.length; i++) {
if (hypercubes[i] > hypercubes[mostPo... | java | public void removeSolution(int location) {
//Decrease the solutions in the location specified.
hypercubes[location]--;
//Update the most populated hypercube
if (location == mostPopulatedHypercube) {
for (int i = 0; i < hypercubes.length; i++) {
if (hypercubes[i] > hypercubes[mostPo... | [
"public",
"void",
"removeSolution",
"(",
"int",
"location",
")",
"{",
"//Decrease the solutions in the location specified.\r",
"hypercubes",
"[",
"location",
"]",
"--",
";",
"//Update the most populated hypercube\r",
"if",
"(",
"location",
"==",
"mostPopulatedHypercube",
")... | Decreases the number of solutions into a specific hypercube.
@param location Number of hypercube. | [
"Decreases",
"the",
"number",
"of",
"solutions",
"into",
"a",
"specific",
"hypercube",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L236-L253 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.addSolution | public void addSolution(int location) {
//Increase the solutions in the location specified.
hypercubes[location]++;
//Update the most populated hypercube
if (hypercubes[location] > hypercubes[mostPopulatedHypercube]) {
mostPopulatedHypercube = location;
}
//if hypercubes[locatio... | java | public void addSolution(int location) {
//Increase the solutions in the location specified.
hypercubes[location]++;
//Update the most populated hypercube
if (hypercubes[location] > hypercubes[mostPopulatedHypercube]) {
mostPopulatedHypercube = location;
}
//if hypercubes[locatio... | [
"public",
"void",
"addSolution",
"(",
"int",
"location",
")",
"{",
"//Increase the solutions in the location specified.\r",
"hypercubes",
"[",
"location",
"]",
"++",
";",
"//Update the most populated hypercube\r",
"if",
"(",
"hypercubes",
"[",
"location",
"]",
">",
"hyp... | Increases the number of solutions into a specific hypercube.
@param location Number of hypercube. | [
"Increases",
"the",
"number",
"of",
"solutions",
"into",
"a",
"specific",
"hypercube",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L260-L274 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.rouletteWheel | public int rouletteWheel(BoundedRandomGenerator<Double> randomGenerator) {
//Calculate the inverse sum
double inverseSum = 0.0;
for (int hypercube : hypercubes) {
if (hypercube > 0) {
inverseSum += 1.0 / (double) hypercube;
}
}
//Calculate a random value between 0 and s... | java | public int rouletteWheel(BoundedRandomGenerator<Double> randomGenerator) {
//Calculate the inverse sum
double inverseSum = 0.0;
for (int hypercube : hypercubes) {
if (hypercube > 0) {
inverseSum += 1.0 / (double) hypercube;
}
}
//Calculate a random value between 0 and s... | [
"public",
"int",
"rouletteWheel",
"(",
"BoundedRandomGenerator",
"<",
"Double",
">",
"randomGenerator",
")",
"{",
"//Calculate the inverse sum\r",
"double",
"inverseSum",
"=",
"0.0",
";",
"for",
"(",
"int",
"hypercube",
":",
"hypercubes",
")",
"{",
"if",
"(",
"h... | Returns a random hypercube using a rouleteWheel method.
@param randomGenerator the {@link BoundedRandomGenerator} to use for the roulette
@return the number of the selected hypercube. | [
"Returns",
"a",
"random",
"hypercube",
"using",
"a",
"rouleteWheel",
"method",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L315-L341 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.calculateOccupied | public void calculateOccupied() {
int total = 0;
for (int hypercube : hypercubes) {
if (hypercube > 0) {
total++;
}
}
occupied = new int[total];
int base = 0;
for (int i = 0; i < hypercubes.length; i++) {
if (hypercubes[i] > 0) {
occupied[base] = i;... | java | public void calculateOccupied() {
int total = 0;
for (int hypercube : hypercubes) {
if (hypercube > 0) {
total++;
}
}
occupied = new int[total];
int base = 0;
for (int i = 0; i < hypercubes.length; i++) {
if (hypercubes[i] > 0) {
occupied[base] = i;... | [
"public",
"void",
"calculateOccupied",
"(",
")",
"{",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"hypercube",
":",
"hypercubes",
")",
"{",
"if",
"(",
"hypercube",
">",
"0",
")",
"{",
"total",
"++",
";",
"}",
"}",
"occupied",
"=",
"new",
"int... | Calculates the number of hypercubes having one or more solutions.
return the number of hypercubes with more than zero solutions. | [
"Calculates",
"the",
"number",
"of",
"hypercubes",
"having",
"one",
"or",
"more",
"solutions",
".",
"return",
"the",
"number",
"of",
"hypercubes",
"with",
"more",
"than",
"zero",
"solutions",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L347-L363 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.randomOccupiedHypercube | public int randomOccupiedHypercube(BoundedRandomGenerator<Integer> randomGenerator) {
int rand = randomGenerator.getRandomValue(0, occupied.length - 1);
return occupied[rand];
} | java | public int randomOccupiedHypercube(BoundedRandomGenerator<Integer> randomGenerator) {
int rand = randomGenerator.getRandomValue(0, occupied.length - 1);
return occupied[rand];
} | [
"public",
"int",
"randomOccupiedHypercube",
"(",
"BoundedRandomGenerator",
"<",
"Integer",
">",
"randomGenerator",
")",
"{",
"int",
"rand",
"=",
"randomGenerator",
".",
"getRandomValue",
"(",
"0",
",",
"occupied",
".",
"length",
"-",
"1",
")",
";",
"return",
"... | Returns a random hypercube that has more than zero solutions.
@param randomGenerator the {@link BoundedRandomGenerator} to use for selecting the hypercube
@return The hypercube. | [
"Returns",
"a",
"random",
"hypercube",
"that",
"has",
"more",
"than",
"zero",
"solutions",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L391-L394 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java | AdaptiveGrid.getAverageOccupation | public double getAverageOccupation() {
calculateOccupied();
double result;
if (occupiedHypercubes() == 0) {
result = 0.0;
} else {
double sum = 0.0;
for (int value : occupied) {
sum += hypercubes[value];
}
result = sum / occupiedHypercubes();
}
... | java | public double getAverageOccupation() {
calculateOccupied();
double result;
if (occupiedHypercubes() == 0) {
result = 0.0;
} else {
double sum = 0.0;
for (int value : occupied) {
sum += hypercubes[value];
}
result = sum / occupiedHypercubes();
}
... | [
"public",
"double",
"getAverageOccupation",
"(",
")",
"{",
"calculateOccupied",
"(",
")",
";",
"double",
"result",
";",
"if",
"(",
"occupiedHypercubes",
"(",
")",
"==",
"0",
")",
"{",
"result",
"=",
"0.0",
";",
"}",
"else",
"{",
"double",
"sum",
"=",
"... | Return the average number of solutions in the occupied hypercubes | [
"Return",
"the",
"average",
"number",
"of",
"solutions",
"in",
"the",
"occupied",
"hypercubes"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AdaptiveGrid.java#L399-L415 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.getMaximumValues | public static double[] getMaximumValues(Front front) {
if (front == null) {
throw new NullFrontException() ;
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException() ;
}
int numberOfObjectives = front.getPoint(0).getDimension() ;
double[] maximumValue = new double[n... | java | public static double[] getMaximumValues(Front front) {
if (front == null) {
throw new NullFrontException() ;
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException() ;
}
int numberOfObjectives = front.getPoint(0).getDimension() ;
double[] maximumValue = new double[n... | [
"public",
"static",
"double",
"[",
"]",
"getMaximumValues",
"(",
"Front",
"front",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"else",
"if",
"(",
"front",
".",
"getNumberOfPoints",
"(",
... | Gets the maximum values for each objectives in a front
@param front A front of objective values
@return double [] An array with the maximum values for each objective | [
"Gets",
"the",
"maximum",
"values",
"for",
"each",
"objectives",
"in",
"a",
"front"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L28-L51 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.getMinimumValues | public static double[] getMinimumValues(Front front) {
if (front == null) {
throw new NullFrontException() ;
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException() ;
}
int numberOfObjectives = front.getPoint(0).getDimension() ;
double[] minimumValue = new double[n... | java | public static double[] getMinimumValues(Front front) {
if (front == null) {
throw new NullFrontException() ;
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException() ;
}
int numberOfObjectives = front.getPoint(0).getDimension() ;
double[] minimumValue = new double[n... | [
"public",
"static",
"double",
"[",
"]",
"getMinimumValues",
"(",
"Front",
"front",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"else",
"if",
"(",
"front",
".",
"getNumberOfPoints",
"(",
... | Gets the minimum values for each objectives in a given front
@param front The front
@return double [] An array with the minimum value for each objective | [
"Gets",
"the",
"minimum",
"values",
"for",
"each",
"objectives",
"in",
"a",
"given",
"front"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L59-L82 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.distanceToNearestPoint | public static double distanceToNearestPoint(Point point, Front front, PointDistance distance) {
if (front == null) {
throw new NullFrontException();
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException();
} else if (point == null) {
throw new JMetalException("The poin... | java | public static double distanceToNearestPoint(Point point, Front front, PointDistance distance) {
if (front == null) {
throw new NullFrontException();
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException();
} else if (point == null) {
throw new JMetalException("The poin... | [
"public",
"static",
"double",
"distanceToNearestPoint",
"(",
"Point",
"point",
",",
"Front",
"front",
",",
"PointDistance",
"distance",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"else",
... | Gets the distance between a point and the nearest one in a front. If a distance equals to 0
is found, that means that the point is in the front, so it is excluded
@param point The point
@param front The front that contains the other points to calculate the distances
@return The minimum distance between the point and t... | [
"Gets",
"the",
"distance",
"between",
"a",
"point",
"and",
"the",
"nearest",
"one",
"in",
"a",
"front",
".",
"If",
"a",
"distance",
"equals",
"to",
"0",
"is",
"found",
"that",
"means",
"that",
"the",
"point",
"is",
"in",
"the",
"front",
"so",
"it",
"... | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L104-L123 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.getInvertedFront | public static Front getInvertedFront(Front front) {
if (front == null) {
throw new NullFrontException();
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException();
}
int numberOfDimensions = front.getPoint(0).getDimension() ;
Front invertedFront = new ArrayFront(front... | java | public static Front getInvertedFront(Front front) {
if (front == null) {
throw new NullFrontException();
} else if (front.getNumberOfPoints() == 0) {
throw new EmptyFrontException();
}
int numberOfDimensions = front.getPoint(0).getDimension() ;
Front invertedFront = new ArrayFront(front... | [
"public",
"static",
"Front",
"getInvertedFront",
"(",
"Front",
"front",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"else",
"if",
"(",
"front",
".",
"getNumberOfPoints",
"(",
")",
"==",
... | This method receives a normalized pareto front and return the inverted one.
This method is for minimization problems
@param front The pareto front to inverse
@return The inverted pareto front | [
"This",
"method",
"receives",
"a",
"normalized",
"pareto",
"front",
"and",
"return",
"the",
"inverted",
"one",
".",
"This",
"method",
"is",
"for",
"minimization",
"problems"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L174-L197 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.convertFrontToArray | public static double[][] convertFrontToArray(Front front) {
if (front == null) {
throw new NullFrontException();
}
double[][] arrayFront = new double[front.getNumberOfPoints()][] ;
for (int i = 0; i < front.getNumberOfPoints(); i++) {
arrayFront[i] = new double[front.getPoint(i).getDimensi... | java | public static double[][] convertFrontToArray(Front front) {
if (front == null) {
throw new NullFrontException();
}
double[][] arrayFront = new double[front.getNumberOfPoints()][] ;
for (int i = 0; i < front.getNumberOfPoints(); i++) {
arrayFront[i] = new double[front.getPoint(i).getDimensi... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"convertFrontToArray",
"(",
"Front",
"front",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"double",
"[",
"]",
"[",
"]",
"arrayFront",
... | Given a front, converts it to an array of double values
@param front
@return A front as double[][] array | [
"Given",
"a",
"front",
"converts",
"it",
"to",
"an",
"array",
"of",
"double",
"values"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L205-L220 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java | FrontUtils.convertFrontToSolutionList | public static List<PointSolution> convertFrontToSolutionList(Front front) {
if (front == null) {
throw new NullFrontException();
}
int numberOfObjectives ;
int solutionSetSize = front.getNumberOfPoints() ;
if (front.getNumberOfPoints() == 0) {
numberOfObjectives = 0 ;
} else {
... | java | public static List<PointSolution> convertFrontToSolutionList(Front front) {
if (front == null) {
throw new NullFrontException();
}
int numberOfObjectives ;
int solutionSetSize = front.getNumberOfPoints() ;
if (front.getNumberOfPoints() == 0) {
numberOfObjectives = 0 ;
} else {
... | [
"public",
"static",
"List",
"<",
"PointSolution",
">",
"convertFrontToSolutionList",
"(",
"Front",
"front",
")",
"{",
"if",
"(",
"front",
"==",
"null",
")",
"{",
"throw",
"new",
"NullFrontException",
"(",
")",
";",
"}",
"int",
"numberOfObjectives",
";",
"int... | Given a front, converts it to a Solution set of PointSolutions
@param front
@return A front as a List<FrontSolution> | [
"Given",
"a",
"front",
"converts",
"it",
"to",
"a",
"Solution",
"set",
"of",
"PointSolutions"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/front/util/FrontUtils.java#L262-L286 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/operator/impl/crossover/PMXCrossover.java | PMXCrossover.execute | public List<PermutationSolution<Integer>> execute(List<PermutationSolution<Integer>> parents) {
if (null == parents) {
throw new JMetalException("Null parameter") ;
} else if (parents.size() != 2) {
throw new JMetalException("There must be two parents instead of " + parents.size()) ;
}
... | java | public List<PermutationSolution<Integer>> execute(List<PermutationSolution<Integer>> parents) {
if (null == parents) {
throw new JMetalException("Null parameter") ;
} else if (parents.size() != 2) {
throw new JMetalException("There must be two parents instead of " + parents.size()) ;
}
... | [
"public",
"List",
"<",
"PermutationSolution",
"<",
"Integer",
">",
">",
"execute",
"(",
"List",
"<",
"PermutationSolution",
"<",
"Integer",
">",
">",
"parents",
")",
"{",
"if",
"(",
"null",
"==",
"parents",
")",
"{",
"throw",
"new",
"JMetalException",
"(",... | Executes the operation
@param parents An object containing an array of two solutions | [
"Executes",
"the",
"operation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/crossover/PMXCrossover.java#L67-L75 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/point/util/comparator/PointComparator.java | PointComparator.compare | @Override
public int compare(Point pointOne, Point pointTwo) {
if (pointOne == null) {
throw new JMetalException("PointOne is null") ;
} else if (pointTwo == null) {
throw new JMetalException("PointTwo is null") ;
} else if (pointOne.getDimension() != pointTwo.getDimension()) {
throw ne... | java | @Override
public int compare(Point pointOne, Point pointTwo) {
if (pointOne == null) {
throw new JMetalException("PointOne is null") ;
} else if (pointTwo == null) {
throw new JMetalException("PointTwo is null") ;
} else if (pointOne.getDimension() != pointTwo.getDimension()) {
throw ne... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"Point",
"pointOne",
",",
"Point",
"pointTwo",
")",
"{",
"if",
"(",
"pointOne",
"==",
"null",
")",
"{",
"throw",
"new",
"JMetalException",
"(",
"\"PointOne is null\"",
")",
";",
"}",
"else",
"if",
"(",
"p... | Compares two Point objects
@param pointOne An object that reference a Point
@param pointTwo An object that reference a Point
@return -1 if o1 < o1, 1 if o1 > o2 or 0 in other case. | [
"Compares",
"two",
"Point",
"objects"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/point/util/comparator/PointComparator.java#L34-L54 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/Spread.java | Spread.spread | public double spread(Front front, Front referenceFront) {
PointDistance distance = new EuclideanDistance() ;
// STEP 1. Sort normalizedFront and normalizedParetoFront;
front.sort(new LexicographicalPointComparator());
referenceFront.sort(new LexicographicalPointComparator());
// STEP 2. Compute df... | java | public double spread(Front front, Front referenceFront) {
PointDistance distance = new EuclideanDistance() ;
// STEP 1. Sort normalizedFront and normalizedParetoFront;
front.sort(new LexicographicalPointComparator());
referenceFront.sort(new LexicographicalPointComparator());
// STEP 2. Compute df... | [
"public",
"double",
"spread",
"(",
"Front",
"front",
",",
"Front",
"referenceFront",
")",
"{",
"PointDistance",
"distance",
"=",
"new",
"EuclideanDistance",
"(",
")",
";",
"// STEP 1. Sort normalizedFront and normalizedParetoFront;",
"front",
".",
"sort",
"(",
"new",
... | Calculates the Spread metric.
@param front The front.
@param referenceFront The true pareto front. | [
"Calculates",
"the",
"Spread",
"metric",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/Spread.java#L65-L101 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java | PISAHypervolume.hypervolume | private double hypervolume(Front front, Front referenceFront) {
Front invertedFront;
invertedFront = FrontUtils.getInvertedFront(front);
int numberOfObjectives = referenceFront.getPoint(0).getDimension() ;
// STEP4. The hypervolume (control is passed to the Java version of Zitzler code)
return th... | java | private double hypervolume(Front front, Front referenceFront) {
Front invertedFront;
invertedFront = FrontUtils.getInvertedFront(front);
int numberOfObjectives = referenceFront.getPoint(0).getDimension() ;
// STEP4. The hypervolume (control is passed to the Java version of Zitzler code)
return th... | [
"private",
"double",
"hypervolume",
"(",
"Front",
"front",
",",
"Front",
"referenceFront",
")",
"{",
"Front",
"invertedFront",
";",
"invertedFront",
"=",
"FrontUtils",
".",
"getInvertedFront",
"(",
"front",
")",
";",
"int",
"numberOfObjectives",
"=",
"referenceFro... | Returns the hypervolume value of a front of points
@param front The front
@param referenceFront The true pareto front | [
"Returns",
"the",
"hypervolume",
"value",
"of",
"a",
"front",
"of",
"points"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java#L209-L219 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java | PISAHypervolume.hvContributions | private double[] hvContributions(double[][] front) {
int numberOfObjectives = front[0].length ;
double[] contributions = new double[front.length];
double[][] frontSubset = new double[front.length - 1][front[0].length];
LinkedList<double[]> frontCopy = new LinkedList<double[]>();
Collections.addAll(... | java | private double[] hvContributions(double[][] front) {
int numberOfObjectives = front[0].length ;
double[] contributions = new double[front.length];
double[][] frontSubset = new double[front.length - 1][front[0].length];
LinkedList<double[]> frontCopy = new LinkedList<double[]>();
Collections.addAll(... | [
"private",
"double",
"[",
"]",
"hvContributions",
"(",
"double",
"[",
"]",
"[",
"]",
"front",
")",
"{",
"int",
"numberOfObjectives",
"=",
"front",
"[",
"0",
"]",
".",
"length",
";",
"double",
"[",
"]",
"contributions",
"=",
"new",
"double",
"[",
"front... | Calculates how much hypervolume each point dominates exclusively. The points
have to be transformed beforehand, to accommodate the assumptions of Zitzler's
hypervolume code.
@param front transformed objective values
@return HV contributions | [
"Calculates",
"how",
"much",
"hypervolume",
"each",
"point",
"dominates",
"exclusively",
".",
"The",
"points",
"have",
"to",
"be",
"transformed",
"beforehand",
"to",
"accommodate",
"the",
"assumptions",
"of",
"Zitzler",
"s",
"hypervolume",
"code",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java#L290-L311 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/InvertedGenerationalDistancePlus.java | InvertedGenerationalDistancePlus.invertedGenerationalDistancePlus | public double invertedGenerationalDistancePlus(Front front, Front referenceFront) {
double sum = 0.0;
for (int i = 0 ; i < referenceFront.getNumberOfPoints(); i++) {
sum += FrontUtils.distanceToClosestPoint(referenceFront.getPoint(i),
front, new DominanceDistance());
}
// STEP 4. Divid... | java | public double invertedGenerationalDistancePlus(Front front, Front referenceFront) {
double sum = 0.0;
for (int i = 0 ; i < referenceFront.getNumberOfPoints(); i++) {
sum += FrontUtils.distanceToClosestPoint(referenceFront.getPoint(i),
front, new DominanceDistance());
}
// STEP 4. Divid... | [
"public",
"double",
"invertedGenerationalDistancePlus",
"(",
"Front",
"front",
",",
"Front",
"referenceFront",
")",
"{",
"double",
"sum",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"referenceFront",
".",
"getNumberOfPoints",
"(",
")",
... | Returns the inverted generational distance plus value for a given front
@param front The front
@param referenceFront The reference pareto front | [
"Returns",
"the",
"inverted",
"generational",
"distance",
"plus",
"value",
"for",
"a",
"given",
"front"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/InvertedGenerationalDistancePlus.java#L67-L77 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/experiment/component/GenerateLatexTablesWithStatistics.java | GenerateLatexTablesWithStatistics.computeStatistics | private Map<String, Double> computeStatistics(List<Double> values) {
Map<String, Double> results = new HashMap<>() ;
DescriptiveStatistics stats = new DescriptiveStatistics();
for (Double value : values) {
stats.addValue(value);
}
results.put("mean", stats.getMean()) ;
results.put("media... | java | private Map<String, Double> computeStatistics(List<Double> values) {
Map<String, Double> results = new HashMap<>() ;
DescriptiveStatistics stats = new DescriptiveStatistics();
for (Double value : values) {
stats.addValue(value);
}
results.put("mean", stats.getMean()) ;
results.put("media... | [
"private",
"Map",
"<",
"String",
",",
"Double",
">",
"computeStatistics",
"(",
"List",
"<",
"Double",
">",
"values",
")",
"{",
"Map",
"<",
"String",
",",
"Double",
">",
"results",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"DescriptiveStatistics",
"stat... | Computes the statistical values
@param values
@return | [
"Computes",
"the",
"statistical",
"values"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/experiment/component/GenerateLatexTablesWithStatistics.java#L156-L173 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/gwasfga/util/GWASFGARanking.java | GWASFGARanking.rankUnfeasibleSolutions | protected int[] rankUnfeasibleSolutions(List<S> population){
int numberOfViolatedConstraintsBySolution1, numberOfViolatedConstraintsBySolution2;
int indexOfFirstSolution, indexOfSecondSolution, indexOfWeight;
double overallConstraintViolationSolution1, overallConstraintViolationSolution2;
... | java | protected int[] rankUnfeasibleSolutions(List<S> population){
int numberOfViolatedConstraintsBySolution1, numberOfViolatedConstraintsBySolution2;
int indexOfFirstSolution, indexOfSecondSolution, indexOfWeight;
double overallConstraintViolationSolution1, overallConstraintViolationSolution2;
... | [
"protected",
"int",
"[",
"]",
"rankUnfeasibleSolutions",
"(",
"List",
"<",
"S",
">",
"population",
")",
"{",
"int",
"numberOfViolatedConstraintsBySolution1",
",",
"numberOfViolatedConstraintsBySolution2",
";",
"int",
"indexOfFirstSolution",
",",
"indexOfSecondSolution",
"... | Obtain the rank of each solution in a list of unfeasible solutions
@param population List of unfeasible solutions
@return The rank of each unfeasible solutions | [
"Obtain",
"the",
"rank",
"of",
"each",
"solution",
"in",
"a",
"list",
"of",
"unfeasible",
"solutions"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/gwasfga/util/GWASFGARanking.java#L162-L235 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/NonUniformMutation.java | NonUniformMutation.delta | private double delta(double y, double bMutationParameter) {
double rand = randomGenenerator.getRandomValue();
int it, maxIt;
it = currentIteration;
maxIt = maxIterations;
return (y * (1.0 -
Math.pow(rand,
Math.pow((1.0 - it / (double) maxIt), bMutationParameter)
)));
} | java | private double delta(double y, double bMutationParameter) {
double rand = randomGenenerator.getRandomValue();
int it, maxIt;
it = currentIteration;
maxIt = maxIterations;
return (y * (1.0 -
Math.pow(rand,
Math.pow((1.0 - it / (double) maxIt), bMutationParameter)
)));
} | [
"private",
"double",
"delta",
"(",
"double",
"y",
",",
"double",
"bMutationParameter",
")",
"{",
"double",
"rand",
"=",
"randomGenenerator",
".",
"getRandomValue",
"(",
")",
";",
"int",
"it",
",",
"maxIt",
";",
"it",
"=",
"currentIteration",
";",
"maxIt",
... | Calculates the delta value used in NonUniform mutation operator | [
"Calculates",
"the",
"delta",
"value",
"used",
"in",
"NonUniform",
"mutation",
"operator"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/NonUniformMutation.java#L122-L132 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java | EnergyArchive.scaleToPositive | private void scaleToPositive() {
// Obtain min value
double minScalarization = Double.MAX_VALUE;
for (S solution : getSolutionList()) {
if (scalarization.getAttribute(solution) < minScalarization) {
minScalarization = scalarization.getAttribute(solution);
}
}
if (minScala... | java | private void scaleToPositive() {
// Obtain min value
double minScalarization = Double.MAX_VALUE;
for (S solution : getSolutionList()) {
if (scalarization.getAttribute(solution) < minScalarization) {
minScalarization = scalarization.getAttribute(solution);
}
}
if (minScala... | [
"private",
"void",
"scaleToPositive",
"(",
")",
"{",
"// Obtain min value\r",
"double",
"minScalarization",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",
"(",
"S",
"solution",
":",
"getSolutionList",
"(",
")",
")",
"{",
"if",
"(",
"scalarization",
".",
"getAttr... | The niching mechanism of ESPEA only works if the scalarization values are
positive. Otherwise scalarization values cannot be interpreted as charges
of a physical system that signal desirability.
<p>
Scalarization values are scaled to positive values by subtracting the
minimum scalariaztion value from all archive membe... | [
"The",
"niching",
"mechanism",
"of",
"ESPEA",
"only",
"works",
"if",
"the",
"scalarization",
"values",
"are",
"positive",
".",
"Otherwise",
"scalarization",
"values",
"cannot",
"be",
"interpreted",
"as",
"charges",
"of",
"a",
"physical",
"system",
"that",
"signa... | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java#L240-L255 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java | EnergyArchive.energyVector | private double[] energyVector(double[][] distanceMatrix) {
// Ignore the set (maxSize + 1)'th archive member since it's the new
// solution that is tested for eligibility of replacement.
double[] energyVector = new double[distanceMatrix.length - 1];
for (int i = 0; i < energyVector.length - 1; i++) ... | java | private double[] energyVector(double[][] distanceMatrix) {
// Ignore the set (maxSize + 1)'th archive member since it's the new
// solution that is tested for eligibility of replacement.
double[] energyVector = new double[distanceMatrix.length - 1];
for (int i = 0; i < energyVector.length - 1; i++) ... | [
"private",
"double",
"[",
"]",
"energyVector",
"(",
"double",
"[",
"]",
"[",
"]",
"distanceMatrix",
")",
"{",
"// Ignore the set (maxSize + 1)'th archive member since it's the new\r",
"// solution that is tested for eligibility of replacement.\r",
"double",
"[",
"]",
"energyVec... | Computes the energy contribution of each archive member. Note that the
archive member at position maxSize + 1 is the new solution that is tested
for eligibility of replacement.
@param distanceMatrix Distance between archive members
@return The amount of energy that each member contributes to the archive. | [
"Computes",
"the",
"energy",
"contribution",
"of",
"each",
"archive",
"member",
".",
"Note",
"that",
"the",
"archive",
"member",
"at",
"position",
"maxSize",
"+",
"1",
"is",
"the",
"new",
"solution",
"that",
"is",
"tested",
"for",
"eligibility",
"of",
"repla... | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java#L265-L277 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java | EnergyArchive.replacementVector | private double[] replacementVector(double[][] distanceMatrix) {
double[] replacementVector = new double[distanceMatrix.length - 1];
// Energy between archive member k and new solution
double[] individualEnergy = new double[distanceMatrix.length - 1];
// Sum of all individual energies
double tot... | java | private double[] replacementVector(double[][] distanceMatrix) {
double[] replacementVector = new double[distanceMatrix.length - 1];
// Energy between archive member k and new solution
double[] individualEnergy = new double[distanceMatrix.length - 1];
// Sum of all individual energies
double tot... | [
"private",
"double",
"[",
"]",
"replacementVector",
"(",
"double",
"[",
"]",
"[",
"]",
"distanceMatrix",
")",
"{",
"double",
"[",
"]",
"replacementVector",
"=",
"new",
"double",
"[",
"distanceMatrix",
".",
"length",
"-",
"1",
"]",
";",
"// Energy between arc... | Computes the replacement energy vector. Each component k of the
replacement vector states how much energy the new solution would
introduce into the archive instead of the archive member at position k.
@param distanceMatrix Distance between archive members
@return The replacement energy vector. | [
"Computes",
"the",
"replacement",
"energy",
"vector",
".",
"Each",
"component",
"k",
"of",
"the",
"replacement",
"vector",
"states",
"how",
"much",
"energy",
"the",
"new",
"solution",
"would",
"introduce",
"into",
"the",
"archive",
"instead",
"of",
"the",
"arc... | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/espea/util/EnergyArchive.java#L287-L302 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java | AbstractAlgorithmRunner.printFinalSolutionSet | public static void printFinalSolutionSet(List<? extends Solution<?>> population) {
new SolutionListOutput(population)
.setSeparator("\t")
.setVarFileOutputContext(new DefaultFileOutputContext("VAR.tsv"))
.setFunFileOutputContext(new DefaultFileOutputContext("FUN.tsv"))
.print();
... | java | public static void printFinalSolutionSet(List<? extends Solution<?>> population) {
new SolutionListOutput(population)
.setSeparator("\t")
.setVarFileOutputContext(new DefaultFileOutputContext("VAR.tsv"))
.setFunFileOutputContext(new DefaultFileOutputContext("FUN.tsv"))
.print();
... | [
"public",
"static",
"void",
"printFinalSolutionSet",
"(",
"List",
"<",
"?",
"extends",
"Solution",
"<",
"?",
">",
">",
"population",
")",
"{",
"new",
"SolutionListOutput",
"(",
"population",
")",
".",
"setSeparator",
"(",
"\"\\t\"",
")",
".",
"setVarFileOutput... | Write the population into two files and prints some data on screen
@param population | [
"Write",
"the",
"population",
"into",
"two",
"files",
"and",
"prints",
"some",
"data",
"on",
"screen"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java#L28-L39 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java | AbstractAlgorithmRunner.printQualityIndicators | public static <S extends Solution<?>> void printQualityIndicators(List<S> population, String paretoFrontFile)
throws FileNotFoundException {
Front referenceFront = new ArrayFront(paretoFrontFile);
FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront) ;
Front normalizedReferenceFront =... | java | public static <S extends Solution<?>> void printQualityIndicators(List<S> population, String paretoFrontFile)
throws FileNotFoundException {
Front referenceFront = new ArrayFront(paretoFrontFile);
FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront) ;
Front normalizedReferenceFront =... | [
"public",
"static",
"<",
"S",
"extends",
"Solution",
"<",
"?",
">",
">",
"void",
"printQualityIndicators",
"(",
"List",
"<",
"S",
">",
"population",
",",
"String",
"paretoFrontFile",
")",
"throws",
"FileNotFoundException",
"{",
"Front",
"referenceFront",
"=",
... | Print all the available quality indicators
@param population
@param paretoFrontFile
@throws FileNotFoundException | [
"Print",
"all",
"the",
"available",
"quality",
"indicators"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/AbstractAlgorithmRunner.java#L47-L91 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/PermutationSwapMutation.java | PermutationSwapMutation.doMutation | public void doMutation(PermutationSolution<T> solution) {
int permutationLength ;
permutationLength = solution.getNumberOfVariables() ;
if ((permutationLength != 0) && (permutationLength != 1)) {
if (mutationRandomGenerator.getRandomValue() < mutationProbability) {
int pos1 = positionRandomGe... | java | public void doMutation(PermutationSolution<T> solution) {
int permutationLength ;
permutationLength = solution.getNumberOfVariables() ;
if ((permutationLength != 0) && (permutationLength != 1)) {
if (mutationRandomGenerator.getRandomValue() < mutationProbability) {
int pos1 = positionRandomGe... | [
"public",
"void",
"doMutation",
"(",
"PermutationSolution",
"<",
"T",
">",
"solution",
")",
"{",
"int",
"permutationLength",
";",
"permutationLength",
"=",
"solution",
".",
"getNumberOfVariables",
"(",
")",
";",
"if",
"(",
"(",
"permutationLength",
"!=",
"0",
... | Performs the operation | [
"Performs",
"the",
"operation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/PermutationSwapMutation.java#L73-L94 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/SimpleRandomMutation.java | SimpleRandomMutation.doMutation | private void doMutation(double probability, DoubleSolution solution) {
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
if (randomGenerator.getRandomValue() <= probability) {
Double value = solution.getLowerBound(i) +
((solution.getUpperBound(i) - solution.getLowerBound(i)) * random... | java | private void doMutation(double probability, DoubleSolution solution) {
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
if (randomGenerator.getRandomValue() <= probability) {
Double value = solution.getLowerBound(i) +
((solution.getUpperBound(i) - solution.getLowerBound(i)) * random... | [
"private",
"void",
"doMutation",
"(",
"double",
"probability",
",",
"DoubleSolution",
"solution",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"solution",
".",
"getNumberOfVariables",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"random... | Implements the mutation operation | [
"Implements",
"the",
"mutation",
"operation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/SimpleRandomMutation.java#L57-L66 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/ProblemUtils.java | ProblemUtils.loadProblem | @SuppressWarnings("unchecked")
public static <S> Problem<S> loadProblem(String problemName) {
Problem<S> problem ;
try {
problem = (Problem<S>)Class.forName(problemName).getConstructor().newInstance() ;
} catch (InstantiationException e) {
throw new JMetalException("newInstance() cannot instan... | java | @SuppressWarnings("unchecked")
public static <S> Problem<S> loadProblem(String problemName) {
Problem<S> problem ;
try {
problem = (Problem<S>)Class.forName(problemName).getConstructor().newInstance() ;
} catch (InstantiationException e) {
throw new JMetalException("newInstance() cannot instan... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"S",
">",
"Problem",
"<",
"S",
">",
"loadProblem",
"(",
"String",
"problemName",
")",
"{",
"Problem",
"<",
"S",
">",
"problem",
";",
"try",
"{",
"problem",
"=",
"(",
"Problem",
... | Create an instance of problem passed as argument
@param problemName A full qualified problem name
@return An instance of the problem | [
"Create",
"an",
"instance",
"of",
"problem",
"passed",
"as",
"argument"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/ProblemUtils.java#L17-L35 | train |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG4.java | WFG4.t1 | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
for (int i = 0; i < z.length; i++) {
result[i] = (new Transformations()).sMulti(z[i], 30, 10, (float) 0.35);
}
return result;
} | java | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
for (int i = 0; i < z.length; i++) {
result[i] = (new Transformations()).sMulti(z[i], 30, 10, (float) 0.35);
}
return result;
} | [
"public",
"float",
"[",
"]",
"t1",
"(",
"float",
"[",
"]",
"z",
",",
"int",
"k",
")",
"{",
"float",
"[",
"]",
"result",
"=",
"new",
"float",
"[",
"z",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"z",
".",
"le... | WFG4 t1 transformation | [
"WFG4",
"t1",
"transformation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG4.java#L68-L76 | train |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT5.java | ZDT5.evalG | public double evalG(BinarySolution solution) {
double res = 0.0;
for (int i = 1; i < solution.getNumberOfVariables(); i++) {
res += evalV(u(solution.getVariableValue(i)));
}
return res;
} | java | public double evalG(BinarySolution solution) {
double res = 0.0;
for (int i = 1; i < solution.getNumberOfVariables(); i++) {
res += evalV(u(solution.getVariableValue(i)));
}
return res;
} | [
"public",
"double",
"evalG",
"(",
"BinarySolution",
"solution",
")",
"{",
"double",
"res",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"solution",
".",
"getNumberOfVariables",
"(",
")",
";",
"i",
"++",
")",
"{",
"res",
"+=",
"... | Returns the value of the ZDT5 function G.
@param solution The solution. | [
"Returns",
"the",
"value",
"of",
"the",
"ZDT5",
"function",
"G",
"."
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/zdt/ZDT5.java#L85-L92 | train |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java | FieldsFilter.withFields | public FieldsFilter withFields(String fields, boolean includeFields) {
parameters.put("fields", fields);
parameters.put("include_fields", includeFields);
return this;
} | java | public FieldsFilter withFields(String fields, boolean includeFields) {
parameters.put("fields", fields);
parameters.put("include_fields", includeFields);
return this;
} | [
"public",
"FieldsFilter",
"withFields",
"(",
"String",
"fields",
",",
"boolean",
"includeFields",
")",
"{",
"parameters",
".",
"put",
"(",
"\"fields\"",
",",
"fields",
")",
";",
"parameters",
".",
"put",
"(",
"\"include_fields\"",
",",
"includeFields",
")",
";... | Only retrieve certain fields from the item.
@param fields a list of comma separated fields to retrieve.
@param includeFields whether to include or exclude in the response the fields that were given.
@return this filter instance | [
"Only",
"retrieve",
"certain",
"fields",
"from",
"the",
"item",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/FieldsFilter.java#L15-L19 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/users/User.java | User.getCreatedAt | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("created_at")
public Date getCreatedAt() {
return createdAt;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("created_at")
public Date getCreatedAt() {
return createdAt;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"created_at\"",
")",
"public",
"Date",
"getCreatedAt",
"(",
")",
"{",
"return",
"createdAt"... | Getter for the date this user was created on.
@return the created at. | [
"Getter",
"for",
"the",
"date",
"this",
"user",
"was",
"created",
"on",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/users/User.java#L333-L337 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/users/User.java | User.getUpdatedAt | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("updated_at")
public Date getUpdatedAt() {
return updatedAt;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("updated_at")
public Date getUpdatedAt() {
return updatedAt;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"updated_at\"",
")",
"public",
"Date",
"getUpdatedAt",
"(",
")",
"{",
"return",
"updatedAt"... | Getter for the date this user was last updated on.
@return the updated at. | [
"Getter",
"for",
"the",
"date",
"this",
"user",
"was",
"last",
"updated",
"on",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/users/User.java#L344-L348 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/users/User.java | User.getLastLogin | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("last_login")
public Date getLastLogin() {
return lastLogin;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("last_login")
public Date getLastLogin() {
return lastLogin;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"last_login\"",
")",
"public",
"Date",
"getLastLogin",
"(",
")",
"{",
"return",
"lastLogin"... | Getter for the last login date.
@return the last login. | [
"Getter",
"for",
"the",
"last",
"login",
"date",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/users/User.java#L425-L429 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java | TwilioFactorProvider.setFrom | @Deprecated
@JsonProperty("from")
public void setFrom(String from) throws IllegalArgumentException {
if (messagingServiceSID != null) {
throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
}
this.from = from;
} | java | @Deprecated
@JsonProperty("from")
public void setFrom(String from) throws IllegalArgumentException {
if (messagingServiceSID != null) {
throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
}
this.from = from;
} | [
"@",
"Deprecated",
"@",
"JsonProperty",
"(",
"\"from\"",
")",
"public",
"void",
"setFrom",
"(",
"String",
"from",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"messagingServiceSID",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Setter for the Twilio From number.
@param from the from number to set.
@throws IllegalArgumentException when both `from` and `messagingServiceSID` are set
@deprecated use the constructor instead | [
"Setter",
"for",
"the",
"Twilio",
"From",
"number",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java#L75-L82 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java | TwilioFactorProvider.setMessagingServiceSID | @Deprecated
@JsonProperty("messaging_service_sid")
public void setMessagingServiceSID(String messagingServiceSID) throws IllegalArgumentException {
if (from != null) {
throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
}
... | java | @Deprecated
@JsonProperty("messaging_service_sid")
public void setMessagingServiceSID(String messagingServiceSID) throws IllegalArgumentException {
if (from != null) {
throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
}
... | [
"@",
"Deprecated",
"@",
"JsonProperty",
"(",
"\"messaging_service_sid\"",
")",
"public",
"void",
"setMessagingServiceSID",
"(",
"String",
"messagingServiceSID",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"throw",
"new"... | Setter for the Twilio Messaging Service SID.
@param messagingServiceSID the messaging service SID.
@throws IllegalArgumentException when both `from` and `messagingServiceSID` are set
@deprecated use the constructor instead | [
"Setter",
"for",
"the",
"Twilio",
"Messaging",
"Service",
"SID",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/TwilioFactorProvider.java#L101-L108 | train |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java | QueryFilter.withQuery | public QueryFilter withQuery(String query) {
try {
String encodedQuery = urlEncode(query);
parameters.put(KEY_QUERY, encodedQuery);
return this;
} catch (UnsupportedEncodingException ex) {
//"Every implementation of the Java platform is required to support... | java | public QueryFilter withQuery(String query) {
try {
String encodedQuery = urlEncode(query);
parameters.put(KEY_QUERY, encodedQuery);
return this;
} catch (UnsupportedEncodingException ex) {
//"Every implementation of the Java platform is required to support... | [
"public",
"QueryFilter",
"withQuery",
"(",
"String",
"query",
")",
"{",
"try",
"{",
"String",
"encodedQuery",
"=",
"urlEncode",
"(",
"query",
")",
";",
"parameters",
".",
"put",
"(",
"KEY_QUERY",
",",
"encodedQuery",
")",
";",
"return",
"this",
";",
"}",
... | Filter by a query
@param query the query expression to use
@return this filter instance | [
"Filter",
"by",
"a",
"query"
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/QueryFilter.java#L16-L26 | train |
auth0/auth0-java | src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java | LogoutUrlBuilder.build | public String build() {
for (Map.Entry<String, String> p : parameters.entrySet()) {
builder.addQueryParameter(p.getKey(), p.getValue());
}
return builder.build().toString();
} | java | public String build() {
for (Map.Entry<String, String> p : parameters.entrySet()) {
builder.addQueryParameter(p.getKey(), p.getValue());
}
return builder.build().toString();
} | [
"public",
"String",
"build",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"p",
":",
"parameters",
".",
"entrySet",
"(",
")",
")",
"{",
"builder",
".",
"addQueryParameter",
"(",
"p",
".",
"getKey",
"(",
")",
","... | Creates a string representation of the URL with the configured parameters.
@return the string URL | [
"Creates",
"a",
"string",
"representation",
"of",
"the",
"URL",
"with",
"the",
"configured",
"parameters",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java#L67-L72 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java | Enrollment.getEnrolledAt | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("enrolled_at")
public Date getEnrolledAt() {
return enrolledAt;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("enrolled_at")
public Date getEnrolledAt() {
return enrolledAt;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"enrolled_at\"",
")",
"public",
"Date",
"getEnrolledAt",
"(",
")",
"{",
"return",
"enrolled... | Getter for the enrolled at.
@return the enrolled at. | [
"Getter",
"for",
"the",
"enrolled",
"at",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java#L114-L118 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java | Enrollment.getLastAuth | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("last_auth")
public Date getLastAuth() {
return lastAuth;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("last_auth")
public Date getLastAuth() {
return lastAuth;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"last_auth\"",
")",
"public",
"Date",
"getLastAuth",
"(",
")",
"{",
"return",
"lastAuth",
... | Getter for the last authentication.
@return the last authentication. | [
"Getter",
"for",
"the",
"last",
"authentication",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java#L125-L129 | train |
auth0/auth0-java | src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java | AuthorizeUrlBuilder.withParameter | public AuthorizeUrlBuilder withParameter(String name, String value) {
assertNotNull(name, "name");
assertNotNull(value, "value");
parameters.put(name, value);
return this;
} | java | public AuthorizeUrlBuilder withParameter(String name, String value) {
assertNotNull(name, "name");
assertNotNull(value, "value");
parameters.put(name, value);
return this;
} | [
"public",
"AuthorizeUrlBuilder",
"withParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"assertNotNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"assertNotNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"parameters",
".",
"put",
"(",
"nam... | Sets an additional parameter.
@param name name of the parameter
@param value value of the parameter to set
@return the builder instance | [
"Sets",
"an",
"additional",
"parameter",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java#L111-L116 | train |
auth0/auth0-java | src/main/java/com/auth0/exception/APIException.java | APIException.getValue | public Object getValue(String key) {
if (values == null) {
return null;
}
return values.get(key);
} | java | public Object getValue(String key) {
if (values == null) {
return null;
}
return values.get(key);
} | [
"public",
"Object",
"getValue",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"values",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Returns a value from the error map, if any.
@param key key of the value to return
@return the value if found or null | [
"Returns",
"a",
"value",
"from",
"the",
"error",
"map",
"if",
"any",
"."
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/exception/APIException.java#L67-L72 | train |
auth0/auth0-java | src/main/java/com/auth0/json/mgmt/DailyStats.java | DailyStats.getDate | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("date")
public Date getDate() {
return date;
} | java | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
@JsonProperty("date")
public Date getDate() {
return date;
} | [
"@",
"JsonFormat",
"(",
"shape",
"=",
"JsonFormat",
".",
"Shape",
".",
"STRING",
",",
"pattern",
"=",
"\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"",
")",
"@",
"JsonProperty",
"(",
"\"date\"",
")",
"public",
"Date",
"getDate",
"(",
")",
"{",
"return",
"date",
";",
"}"
] | Getter for the date to which the stats belong
@return the date to which the stats belong | [
"Getter",
"for",
"the",
"date",
"to",
"which",
"the",
"stats",
"belong"
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/DailyStats.java#L39-L43 | train |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java | LogEventFilter.withCheckpoint | public LogEventFilter withCheckpoint(String from, int take) {
parameters.put("from", from);
parameters.put("take", take);
return this;
} | java | public LogEventFilter withCheckpoint(String from, int take) {
parameters.put("from", from);
parameters.put("take", take);
return this;
} | [
"public",
"LogEventFilter",
"withCheckpoint",
"(",
"String",
"from",
",",
"int",
"take",
")",
"{",
"parameters",
".",
"put",
"(",
"\"from\"",
",",
"from",
")",
";",
"parameters",
".",
"put",
"(",
"\"take\"",
",",
"take",
")",
";",
"return",
"this",
";",
... | Filter by checkpoint
@param from the log event id to start retrieving logs from.
@param take the limit of items to retrieve.
@return this filter instance | [
"Filter",
"by",
"checkpoint"
] | b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java#L15-L19 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/example/streaming/TwitterToSolrStreamProcessor.java | TwitterToSolrStreamProcessor.setup | @Override
public void setup(JavaStreamingContext jssc, CommandLine cli) throws Exception {
String filtersArg = cli.getOptionValue("tweetFilters");
String[] filters = (filtersArg != null) ? filtersArg.split(",") : new String[0];
// start receiving a stream of tweets ...
JavaReceiverInputDStream<Status... | java | @Override
public void setup(JavaStreamingContext jssc, CommandLine cli) throws Exception {
String filtersArg = cli.getOptionValue("tweetFilters");
String[] filters = (filtersArg != null) ? filtersArg.split(",") : new String[0];
// start receiving a stream of tweets ...
JavaReceiverInputDStream<Status... | [
"@",
"Override",
"public",
"void",
"setup",
"(",
"JavaStreamingContext",
"jssc",
",",
"CommandLine",
"cli",
")",
"throws",
"Exception",
"{",
"String",
"filtersArg",
"=",
"cli",
".",
"getOptionValue",
"(",
"\"tweetFilters\"",
")",
";",
"String",
"[",
"]",
"filt... | Sends a stream of tweets to Solr. | [
"Sends",
"a",
"stream",
"of",
"tweets",
"to",
"Solr",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/example/streaming/TwitterToSolrStreamProcessor.java#L30-L74 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/SparkApp.java | SparkApp.main | public static void main(String[] args) throws Exception {
if (args == null || args.length == 0 || args[0] == null || args[0].trim().length() == 0) {
System.err.println("Invalid command-line args! Must pass the name of a processor to run.\n"
+ "Supported processors:\n");
displayProcessorOptions... | java | public static void main(String[] args) throws Exception {
if (args == null || args.length == 0 || args[0] == null || args[0].trim().length() == 0) {
System.err.println("Invalid command-line args! Must pass the name of a processor to run.\n"
+ "Supported processors:\n");
displayProcessorOptions... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
"==",
"null",
"||",
"args",
".",
"length",
"==",
"0",
"||",
"args",
"[",
"0",
"]",
"==",
"null",
"||",
"args",
"[",
"0",
"]",... | Runs a stream processor implementation. | [
"Runs",
"a",
"stream",
"processor",
"implementation",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L118-L164 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/SparkApp.java | SparkApp.getCommonOptions | public static Option[] getCommonOptions() {
return new Option[] {
Option.builder()
.hasArg()
.required(false)
.desc("Batch interval (seconds) for streaming applications; default is 1 second")
.longOpt("batchInterval")
.build(),
Option... | java | public static Option[] getCommonOptions() {
return new Option[] {
Option.builder()
.hasArg()
.required(false)
.desc("Batch interval (seconds) for streaming applications; default is 1 second")
.longOpt("batchInterval")
.build(),
Option... | [
"public",
"static",
"Option",
"[",
"]",
"getCommonOptions",
"(",
")",
"{",
"return",
"new",
"Option",
"[",
"]",
"{",
"Option",
".",
"builder",
"(",
")",
".",
"hasArg",
"(",
")",
".",
"required",
"(",
"false",
")",
".",
"desc",
"(",
"\"Batch interval (s... | Support options common to all tools. | [
"Support",
"options",
"common",
"to",
"all",
"tools",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L192-L237 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/SparkApp.java | SparkApp.newProcessor | private static RDDProcessor newProcessor(String streamProcType) throws Exception {
streamProcType = streamProcType.trim();
if ("twitter-to-solr".equals(streamProcType))
return new TwitterToSolrStreamProcessor();
else if ("word-count".equals(streamProcType))
return new WordCount();
else if ... | java | private static RDDProcessor newProcessor(String streamProcType) throws Exception {
streamProcType = streamProcType.trim();
if ("twitter-to-solr".equals(streamProcType))
return new TwitterToSolrStreamProcessor();
else if ("word-count".equals(streamProcType))
return new WordCount();
else if ... | [
"private",
"static",
"RDDProcessor",
"newProcessor",
"(",
"String",
"streamProcType",
")",
"throws",
"Exception",
"{",
"streamProcType",
"=",
"streamProcType",
".",
"trim",
"(",
")",
";",
"if",
"(",
"\"twitter-to-solr\"",
".",
"equals",
"(",
"streamProcType",
")",... | Creates an instance of the requested tool, using classpath scanning if necessary | [
"Creates",
"an",
"instance",
"of",
"the",
"requested",
"tool",
"using",
"classpath",
"scanning",
"if",
"necessary"
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L240-L277 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/SparkApp.java | SparkApp.processCommandLineArgs | public static CommandLine processCommandLineArgs(Option[] customOptions, String[] args) {
Options options = new Options();
options.addOption("h", "help", false, "Print this message");
options.addOption("v", "verbose", false, "Generate verbose log messages");
if (customOptions != null) {
for (int... | java | public static CommandLine processCommandLineArgs(Option[] customOptions, String[] args) {
Options options = new Options();
options.addOption("h", "help", false, "Print this message");
options.addOption("v", "verbose", false, "Generate verbose log messages");
if (customOptions != null) {
for (int... | [
"public",
"static",
"CommandLine",
"processCommandLineArgs",
"(",
"Option",
"[",
"]",
"customOptions",
",",
"String",
"[",
"]",
"args",
")",
"{",
"Options",
"options",
"=",
"new",
"Options",
"(",
")",
";",
"options",
".",
"addOption",
"(",
"\"h\"",
",",
"\... | Parses the command-line arguments passed by the user. | [
"Parses",
"the",
"command",
"-",
"line",
"arguments",
"passed",
"by",
"the",
"user",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L331-L370 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/SparkApp.java | SparkApp.findProcessorClassesInPackage | @SuppressWarnings("unchecked")
private static List<Class<RDDProcessor>> findProcessorClassesInPackage(String packageName) {
List<Class<RDDProcessor>> streamProcClasses = new ArrayList<Class<RDDProcessor>>();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String pat... | java | @SuppressWarnings("unchecked")
private static List<Class<RDDProcessor>> findProcessorClassesInPackage(String packageName) {
List<Class<RDDProcessor>> streamProcClasses = new ArrayList<Class<RDDProcessor>>();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String pat... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"List",
"<",
"Class",
"<",
"RDDProcessor",
">",
">",
"findProcessorClassesInPackage",
"(",
"String",
"packageName",
")",
"{",
"List",
"<",
"Class",
"<",
"RDDProcessor",
">>",
"streamProcClass... | Scans Jar files on the classpath for RDDProcessor implementations to activate. | [
"Scans",
"Jar",
"files",
"on",
"the",
"classpath",
"for",
"RDDProcessor",
"implementations",
"to",
"activate",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L375-L397 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/query/sql/SolrSQLSupport.java | SolrSQLSupport.parseColumns | public static Map<String,String> parseColumns(String sqlStmt) throws Exception {
// NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex
// for this basic task and pulled in unwanted / incompatible dependencies, e.g. presto requires a different
// version of g... | java | public static Map<String,String> parseColumns(String sqlStmt) throws Exception {
// NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex
// for this basic task and pulled in unwanted / incompatible dependencies, e.g. presto requires a different
// version of g... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"parseColumns",
"(",
"String",
"sqlStmt",
")",
"throws",
"Exception",
"{",
"// NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex",
"// for this basic task and pulled in u... | Given a valid Solr SQL statement, parse out the columns and aliases as a map. | [
"Given",
"a",
"valid",
"Solr",
"SQL",
"statement",
"parse",
"out",
"the",
"columns",
"and",
"aliases",
"as",
"a",
"map",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/sql/SolrSQLSupport.java#L20-L68 | train |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/query/SolrTermVector.java | SolrTermVector.newInstance | public static SolrTermVector newInstance(String docId, HashingTF hashingTF, NamedList<Object> termList) {
int termCount = termList.size();
int[] indices = new int[termCount];
double[] weights = new double[termCount];
String[] terms = new String[termCount];
Iterator<Map.Entry<String,Object>> termsIt... | java | public static SolrTermVector newInstance(String docId, HashingTF hashingTF, NamedList<Object> termList) {
int termCount = termList.size();
int[] indices = new int[termCount];
double[] weights = new double[termCount];
String[] terms = new String[termCount];
Iterator<Map.Entry<String,Object>> termsIt... | [
"public",
"static",
"SolrTermVector",
"newInstance",
"(",
"String",
"docId",
",",
"HashingTF",
"hashingTF",
",",
"NamedList",
"<",
"Object",
">",
"termList",
")",
"{",
"int",
"termCount",
"=",
"termList",
".",
"size",
"(",
")",
";",
"int",
"[",
"]",
"indic... | Converts doc-level term vector information the Solr QueryResponse into a SolrTermVector. | [
"Converts",
"doc",
"-",
"level",
"term",
"vector",
"information",
"the",
"Solr",
"QueryResponse",
"into",
"a",
"SolrTermVector",
"."
] | 8ff1b3cdd99041be6070077c18ec9c1cd7257cc3 | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/SolrTermVector.java#L31-L58 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForCRUDInsert.java | AbstractOptionsForCRUDInsert.getOverridenStrategy | public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) {
final InsertStrategy insertStrategy = OverridingOptional
.from(this.insertStrategy)
.defaultValue(property.insertStrategy())
.get();
if (LOGGER.isTraceEnabled()) {
... | java | public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) {
final InsertStrategy insertStrategy = OverridingOptional
.from(this.insertStrategy)
.defaultValue(property.insertStrategy())
.get();
if (LOGGER.isTraceEnabled()) {
... | [
"public",
"InsertStrategy",
"getOverridenStrategy",
"(",
"AbstractEntityProperty",
"<",
"?",
">",
"property",
")",
"{",
"final",
"InsertStrategy",
"insertStrategy",
"=",
"OverridingOptional",
".",
"from",
"(",
"this",
".",
"insertStrategy",
")",
".",
"defaultValue",
... | Determine the insert strategy for the given
entity using static configuration and runtime option
@param property entity property
@return overriden InsertStrategy | [
"Determine",
"the",
"insert",
"strategy",
"for",
"the",
"given",
"entity",
"using",
"static",
"configuration",
"and",
"runtime",
"option"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForCRUDInsert.java#L137-L150 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/delete/cassandra3_0/DeleteWhereDSLCodeGen3_0.java | DeleteWhereDSLCodeGen3_0.buildDeleteWhereForClusteringColumn | @Override
public TypeSpec buildDeleteWhereForClusteringColumn(EntityMetaSignature signature,
List<FieldSignatureInfo> clusteringCols,
List<ClassSignatureInfo> classesSignature,
... | java | @Override
public TypeSpec buildDeleteWhereForClusteringColumn(EntityMetaSignature signature,
List<FieldSignatureInfo> clusteringCols,
List<ClassSignatureInfo> classesSignature,
... | [
"@",
"Override",
"public",
"TypeSpec",
"buildDeleteWhereForClusteringColumn",
"(",
"EntityMetaSignature",
"signature",
",",
"List",
"<",
"FieldSignatureInfo",
">",
"clusteringCols",
",",
"List",
"<",
"ClassSignatureInfo",
">",
"classesSignature",
",",
"ClassSignatureInfo",
... | Generate extra method to extends the AbstractDeleteEnd class
@param signature
@param clusteringCols
@param classesSignature
@param lastSignature
@return | [
"Generate",
"extra",
"method",
"to",
"extends",
"the",
"AbstractDeleteEnd",
"class"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/delete/cassandra3_0/DeleteWhereDSLCodeGen3_0.java#L77-L119 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withDefaultReadConsistencyMap | public T withDefaultReadConsistencyMap(Map<String, ConsistencyLevel> readConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_READ_MAP, readConsistencyMap);
return getThis();
} | java | public T withDefaultReadConsistencyMap(Map<String, ConsistencyLevel> readConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_READ_MAP, readConsistencyMap);
return getThis();
} | [
"public",
"T",
"withDefaultReadConsistencyMap",
"(",
"Map",
"<",
"String",
",",
"ConsistencyLevel",
">",
"readConsistencyMap",
")",
"{",
"configMap",
".",
"put",
"(",
"CONSISTENCY_LEVEL_READ_MAP",
",",
"readConsistencyMap",
")",
";",
"return",
"getThis",
"(",
")",
... | Define the default Consistency level map to be used for all READ
operations The map keys represent table names and values represent
the corresponding consistency level
@return ManagerFactoryBuilder
@see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consistency-level" target="_blank">Con... | [
"Define",
"the",
"default",
"Consistency",
"level",
"map",
"to",
"be",
"used",
"for",
"all",
"READ",
"operations",
"The",
"map",
"keys",
"represent",
"table",
"names",
"and",
"values",
"represent",
"the",
"corresponding",
"consistency",
"level"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L135-L138 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withDefaultWriteConsistencyMap | public T withDefaultWriteConsistencyMap(Map<String, ConsistencyLevel> writeConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_WRITE_MAP, writeConsistencyMap);
return getThis();
} | java | public T withDefaultWriteConsistencyMap(Map<String, ConsistencyLevel> writeConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_WRITE_MAP, writeConsistencyMap);
return getThis();
} | [
"public",
"T",
"withDefaultWriteConsistencyMap",
"(",
"Map",
"<",
"String",
",",
"ConsistencyLevel",
">",
"writeConsistencyMap",
")",
"{",
"configMap",
".",
"put",
"(",
"CONSISTENCY_LEVEL_WRITE_MAP",
",",
"writeConsistencyMap",
")",
";",
"return",
"getThis",
"(",
")... | Define the default Consistency level map to be used for all WRITE
operations The map keys represent table names and values represent
the corresponding consistency level
@return ManagerFactoryBuilder
@see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consistency-level" target="_blank">Co... | [
"Define",
"the",
"default",
"Consistency",
"level",
"map",
"to",
"be",
"used",
"for",
"all",
"WRITE",
"operations",
"The",
"map",
"keys",
"represent",
"table",
"names",
"and",
"values",
"represent",
"the",
"corresponding",
"consistency",
"level"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L148-L151 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withDefaultSerialConsistencyMap | public T withDefaultSerialConsistencyMap(Map<String, ConsistencyLevel> serialConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_SERIAL_MAP, serialConsistencyMap);
return getThis();
} | java | public T withDefaultSerialConsistencyMap(Map<String, ConsistencyLevel> serialConsistencyMap) {
configMap.put(CONSISTENCY_LEVEL_SERIAL_MAP, serialConsistencyMap);
return getThis();
} | [
"public",
"T",
"withDefaultSerialConsistencyMap",
"(",
"Map",
"<",
"String",
",",
"ConsistencyLevel",
">",
"serialConsistencyMap",
")",
"{",
"configMap",
".",
"put",
"(",
"CONSISTENCY_LEVEL_SERIAL_MAP",
",",
"serialConsistencyMap",
")",
";",
"return",
"getThis",
"(",
... | Define the default Consistency level map to be used for all LightWeightTransaction operations
operations The map keys represent table names and values represent
the corresponding consistency level
@return ManagerFactoryBuilder
@see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consisten... | [
"Define",
"the",
"default",
"Consistency",
"level",
"map",
"to",
"be",
"used",
"for",
"all",
"LightWeightTransaction",
"operations",
"operations",
"The",
"map",
"keys",
"represent",
"table",
"names",
"and",
"values",
"represent",
"the",
"corresponding",
"consistency... | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L161-L164 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withEventInterceptors | public T withEventInterceptors(List<Interceptor<?>> interceptors) {
configMap.put(EVENT_INTERCEPTORS, interceptors);
return getThis();
} | java | public T withEventInterceptors(List<Interceptor<?>> interceptors) {
configMap.put(EVENT_INTERCEPTORS, interceptors);
return getThis();
} | [
"public",
"T",
"withEventInterceptors",
"(",
"List",
"<",
"Interceptor",
"<",
"?",
">",
">",
"interceptors",
")",
"{",
"configMap",
".",
"put",
"(",
"EVENT_INTERCEPTORS",
",",
"interceptors",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Provide a list of event interceptors
@return ManagerFactoryBuilder
@see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#events-interceptors" target="_blank">Event interceptors</a> | [
"Provide",
"a",
"list",
"of",
"event",
"interceptors"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L222-L225 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withParameter | public T withParameter(ConfigurationParameters parameter, Object value) {
configMap.put(parameter, value);
return getThis();
} | java | public T withParameter(ConfigurationParameters parameter, Object value) {
configMap.put(parameter, value);
return getThis();
} | [
"public",
"T",
"withParameter",
"(",
"ConfigurationParameters",
"parameter",
",",
"Object",
"value",
")",
"{",
"configMap",
".",
"put",
"(",
"parameter",
",",
"value",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Pass an arbitrary parameter to configure Achilles
@param parameter an instance of the ConfigurationParameters enum
@param value the value of the parameter
@return ManagerFactoryBuilder | [
"Pass",
"an",
"arbitrary",
"parameter",
"to",
"configure",
"Achilles"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L471-L474 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/runtime/AbstractManager.java | AbstractManager.mapFromRow | public ENTITY mapFromRow(Row row) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(format("Map row %s back to entity of type %s", row, entityClass.getCanonicalName()));
}
validateNotNull(row, "Row object should not be null");
final String tableName = row.getColumnDefinitions().... | java | public ENTITY mapFromRow(Row row) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(format("Map row %s back to entity of type %s", row, entityClass.getCanonicalName()));
}
validateNotNull(row, "Row object should not be null");
final String tableName = row.getColumnDefinitions().... | [
"public",
"ENTITY",
"mapFromRow",
"(",
"Row",
"row",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"format",
"(",
"\"Map row %s back to entity of type %s\"",
",",
"row",
",",
"entityClass",
".",
"getCa... | Map a given row back to an entity instance.
This method provides a raw object mapping facility. Advanced features like interceptors are not available.
User codecs are taken into account though.
@param row given Cassandra row
@return entity instance | [
"Map",
"a",
"given",
"row",
"back",
"to",
"an",
"entity",
"instance",
".",
"This",
"method",
"provides",
"a",
"raw",
"object",
"mapping",
"facility",
".",
"Advanced",
"features",
"like",
"interceptors",
"are",
"not",
"available",
".",
"User",
"codecs",
"are"... | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/runtime/AbstractManager.java#L65-L77 | train |
doanduyhai/Achilles | achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java | CassandraEmbeddedServerBuilder.withScript | public CassandraEmbeddedServerBuilder withScript(String scriptLocation) {
Validator.validateNotBlank(scriptLocation, "The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()");
scriptLocations.add(scriptLocation.trim());
return this;
} | java | public CassandraEmbeddedServerBuilder withScript(String scriptLocation) {
Validator.validateNotBlank(scriptLocation, "The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()");
scriptLocations.add(scriptLocation.trim());
return this;
} | [
"public",
"CassandraEmbeddedServerBuilder",
"withScript",
"(",
"String",
"scriptLocation",
")",
"{",
"Validator",
".",
"validateNotBlank",
"(",
"scriptLocation",
",",
"\"The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()\"",
")",
";",
... | Load an CQL script in the class path and execute it upon initialization
of the embedded Cassandra server
<br/>
Call this method as many times as there are CQL scripts to be executed.
<br/>
Example:
<br/>
<pre class="code"><code class="java">
CassandraEmbeddedServerBuilder
.withScript("script1.cql")
.withScript("scri... | [
"Load",
"an",
"CQL",
"script",
"in",
"the",
"class",
"path",
"and",
"execute",
"it",
"upon",
"initialization",
"of",
"the",
"embedded",
"Cassandra",
"server"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java#L429-L433 | train |
doanduyhai/Achilles | achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java | CassandraEmbeddedServerBuilder.withScriptTemplate | public CassandraEmbeddedServerBuilder withScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
Validator.validateNotBlank(scriptTemplateLocation, "The script template should not be blank while executing CassandraEmbeddedServerBuilder.withScriptTemplate()");
Validator.validateNotEm... | java | public CassandraEmbeddedServerBuilder withScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
Validator.validateNotBlank(scriptTemplateLocation, "The script template should not be blank while executing CassandraEmbeddedServerBuilder.withScriptTemplate()");
Validator.validateNotEm... | [
"public",
"CassandraEmbeddedServerBuilder",
"withScriptTemplate",
"(",
"String",
"scriptTemplateLocation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"Validator",
".",
"validateNotBlank",
"(",
"scriptTemplateLocation",
",",
"\"The script template s... | Load an CQL script template in the class path, inject the values into the template
to produce the final script and execute it upon initialization
of the embedded Cassandra server
<br/>
Call this method as many times as there are CQL templates to be executed.
<br/>
Example:
<br/>
<pre class="code"><code class="java">
... | [
"Load",
"an",
"CQL",
"script",
"template",
"in",
"the",
"class",
"path",
"inject",
"the",
"values",
"into",
"the",
"template",
"to",
"produce",
"the",
"final",
"script",
"and",
"execute",
"it",
"upon",
"initialization",
"of",
"the",
"embedded",
"Cassandra",
... | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java#L465-L470 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/select/SelectWhereDSLCodeGen.java | SelectWhereDSLCodeGen.buildWhereClasses | public List<TypeSpec> buildWhereClasses(GlobalParsingContext context, EntityMetaSignature signature) {
SelectWhereDSLCodeGen selectWhereDSLCodeGen = context.selectWhereDSLCodeGen();
final List<FieldSignatureInfo> partitionKeys = getPartitionKeysSignatureInfo(signature.fieldMetaSignatures);
fina... | java | public List<TypeSpec> buildWhereClasses(GlobalParsingContext context, EntityMetaSignature signature) {
SelectWhereDSLCodeGen selectWhereDSLCodeGen = context.selectWhereDSLCodeGen();
final List<FieldSignatureInfo> partitionKeys = getPartitionKeysSignatureInfo(signature.fieldMetaSignatures);
fina... | [
"public",
"List",
"<",
"TypeSpec",
">",
"buildWhereClasses",
"(",
"GlobalParsingContext",
"context",
",",
"EntityMetaSignature",
"signature",
")",
"{",
"SelectWhereDSLCodeGen",
"selectWhereDSLCodeGen",
"=",
"context",
".",
"selectWhereDSLCodeGen",
"(",
")",
";",
"final"... | ClassSignatureInfo lastSignature); | [
"ClassSignatureInfo",
"lastSignature",
")",
";"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/select/SelectWhereDSLCodeGen.java#L61-L85 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withConsistencyLevel | public T withConsistencyLevel(ConsistencyLevel consistencyLevel) {
getOptions().setCl(Optional.of(consistencyLevel));
return getThis();
} | java | public T withConsistencyLevel(ConsistencyLevel consistencyLevel) {
getOptions().setCl(Optional.of(consistencyLevel));
return getThis();
} | [
"public",
"T",
"withConsistencyLevel",
"(",
"ConsistencyLevel",
"consistencyLevel",
")",
"{",
"getOptions",
"(",
")",
".",
"setCl",
"(",
"Optional",
".",
"of",
"(",
"consistencyLevel",
")",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Set the given consistency level on the generated statement
@throws NullPointerException if consistencyLevel is null | [
"Set",
"the",
"given",
"consistency",
"level",
"on",
"the",
"generated",
"statement"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L45-L48 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withSerialConsistencyLevel | public T withSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel) {
getOptions().setSerialCL(Optional.of(serialConsistencyLevel));
return getThis();
} | java | public T withSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel) {
getOptions().setSerialCL(Optional.of(serialConsistencyLevel));
return getThis();
} | [
"public",
"T",
"withSerialConsistencyLevel",
"(",
"ConsistencyLevel",
"serialConsistencyLevel",
")",
"{",
"getOptions",
"(",
")",
".",
"setSerialCL",
"(",
"Optional",
".",
"of",
"(",
"serialConsistencyLevel",
")",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}... | Set the given serial consistency level on the generated statement
@throws NullPointerException if serialConsistencyLevel is null | [
"Set",
"the",
"given",
"serial",
"consistency",
"level",
"on",
"the",
"generated",
"statement"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L62-L65 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withOutgoingPayload | public T withOutgoingPayload(Map<String, ByteBuffer> outgoingPayload) {
getOptions().setOutgoingPayLoad(Optional.of(outgoingPayload));
return getThis();
} | java | public T withOutgoingPayload(Map<String, ByteBuffer> outgoingPayload) {
getOptions().setOutgoingPayLoad(Optional.of(outgoingPayload));
return getThis();
} | [
"public",
"T",
"withOutgoingPayload",
"(",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
"outgoingPayload",
")",
"{",
"getOptions",
"(",
")",
".",
"setOutgoingPayLoad",
"(",
"Optional",
".",
"of",
"(",
"outgoingPayload",
")",
")",
";",
"return",
"getThis",
"... | Set the given outgoing payload map on the generated statement
@throws NullPointerException if outgoingPayload is null | [
"Set",
"the",
"given",
"outgoing",
"payload",
"map",
"on",
"the",
"generated",
"statement"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L103-L106 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withOptionalOutgoingPayload | public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) {
getOptions().setOutgoingPayLoad(outgoingPayload);
return getThis();
} | java | public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) {
getOptions().setOutgoingPayLoad(outgoingPayload);
return getThis();
} | [
"public",
"T",
"withOptionalOutgoingPayload",
"(",
"Optional",
"<",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
">",
"outgoingPayload",
")",
"{",
"getOptions",
"(",
")",
".",
"setOutgoingPayLoad",
"(",
"outgoingPayload",
")",
";",
"return",
"getThis",
"(",
"... | Set the given outgoing payload map on the generated statement IF NOT NULL | [
"Set",
"the",
"given",
"outgoing",
"payload",
"map",
"on",
"the",
"generated",
"statement",
"IF",
"NOT",
"NULL"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L111-L114 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withPagingState | public T withPagingState(PagingState pagingState) {
getOptions().setPagingState(Optional.of(pagingState));
return getThis();
} | java | public T withPagingState(PagingState pagingState) {
getOptions().setPagingState(Optional.of(pagingState));
return getThis();
} | [
"public",
"T",
"withPagingState",
"(",
"PagingState",
"pagingState",
")",
"{",
"getOptions",
"(",
")",
".",
"setPagingState",
"(",
"Optional",
".",
"of",
"(",
"pagingState",
")",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Set the given paging state on the generated statement
@throws NullPointerException if pagingState is null | [
"Set",
"the",
"given",
"paging",
"state",
"on",
"the",
"generated",
"statement"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L120-L123 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withOptionalPagingStateString | public T withOptionalPagingStateString(Optional<String> pagingStateString) {
pagingStateString.ifPresent(cl -> getOptions().setPagingState(Optional.of(PagingState.fromString(pagingStateString.get()))));
return getThis();
} | java | public T withOptionalPagingStateString(Optional<String> pagingStateString) {
pagingStateString.ifPresent(cl -> getOptions().setPagingState(Optional.of(PagingState.fromString(pagingStateString.get()))));
return getThis();
} | [
"public",
"T",
"withOptionalPagingStateString",
"(",
"Optional",
"<",
"String",
">",
"pagingStateString",
")",
"{",
"pagingStateString",
".",
"ifPresent",
"(",
"cl",
"->",
"getOptions",
"(",
")",
".",
"setPagingState",
"(",
"Optional",
".",
"of",
"(",
"PagingSta... | Set the given paging state string on the generated statement IF NOT NULL | [
"Set",
"the",
"given",
"paging",
"state",
"string",
"on",
"the",
"generated",
"statement",
"IF",
"NOT",
"NULL"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L147-L150 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withRetryPolicy | public T withRetryPolicy(RetryPolicy retryPolicy) {
getOptions().setRetryPolicy(Optional.of(retryPolicy));
return getThis();
} | java | public T withRetryPolicy(RetryPolicy retryPolicy) {
getOptions().setRetryPolicy(Optional.of(retryPolicy));
return getThis();
} | [
"public",
"T",
"withRetryPolicy",
"(",
"RetryPolicy",
"retryPolicy",
")",
"{",
"getOptions",
"(",
")",
".",
"setRetryPolicy",
"(",
"Optional",
".",
"of",
"(",
"retryPolicy",
")",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Set the given retry policy
@throws NullPointerException if value is null | [
"Set",
"the",
"given",
"retry",
"policy"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L156-L159 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java | TypedQuery.iterator | @Override
public Iterator<ENTITY> iterator() {
StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta,
boundStatement, encodedBoundValues);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(String.format("Generate iterator for typ... | java | @Override
public Iterator<ENTITY> iterator() {
StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta,
boundStatement, encodedBoundValues);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace(String.format("Generate iterator for typ... | [
"@",
"Override",
"public",
"Iterator",
"<",
"ENTITY",
">",
"iterator",
"(",
")",
"{",
"StatementWrapper",
"statementWrapper",
"=",
"new",
"BoundStatementWrapper",
"(",
"getOperationType",
"(",
"boundStatement",
")",
",",
"meta",
",",
"boundStatement",
",",
"encode... | Execute the typed query and return an iterator of entities
@return Iterator<ENTITY> | [
"Execute",
"the",
"typed",
"query",
"and",
"return",
"an",
"iterator",
"of",
"entities"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java#L163-L176 | train |
doanduyhai/Achilles | achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java | ScriptExecutor.executeScriptTemplate | public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
final List<SimpleStatement> statements = buildStatements(loadScriptAsLines(scriptTemplateLocation, values));
for (SimpleStatement statement : statements) {
if (isDMLStatement(statement)) {
... | java | public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
final List<SimpleStatement> statements = buildStatements(loadScriptAsLines(scriptTemplateLocation, values));
for (SimpleStatement statement : statements) {
if (isDMLStatement(statement)) {
... | [
"public",
"void",
"executeScriptTemplate",
"(",
"String",
"scriptTemplateLocation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"final",
"List",
"<",
"SimpleStatement",
">",
"statements",
"=",
"buildStatements",
"(",
"loadScriptAsLines",
"("... | Execute a CQL script template located in the class path and
inject provided values into the template to produce the actual script
@param scriptTemplateLocation the location of the script template in the class path
@param values template values | [
"Execute",
"a",
"CQL",
"script",
"template",
"located",
"in",
"the",
"class",
"path",
"and",
"inject",
"provided",
"values",
"into",
"the",
"template",
"to",
"produce",
"the",
"actual",
"script"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java#L86-L96 | train |
doanduyhai/Achilles | achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java | ScriptExecutor.executeAsync | public CompletableFuture<ResultSet> executeAsync(Statement statement) {
return FutureUtils.toCompletableFuture(session.executeAsync(statement), sameThreadExecutor);
} | java | public CompletableFuture<ResultSet> executeAsync(Statement statement) {
return FutureUtils.toCompletableFuture(session.executeAsync(statement), sameThreadExecutor);
} | [
"public",
"CompletableFuture",
"<",
"ResultSet",
">",
"executeAsync",
"(",
"Statement",
"statement",
")",
"{",
"return",
"FutureUtils",
".",
"toCompletableFuture",
"(",
"session",
".",
"executeAsync",
"(",
"statement",
")",
",",
"sameThreadExecutor",
")",
";",
"}"... | Execute a CQL statement asynchronously
@param statement CQL statement
@return CompletableFuture<ResultSet> | [
"Execute",
"a",
"CQL",
"statement",
"asynchronously"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java#L138-L140 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.getElementValuesWithDefaults | public static Map<ExecutableElement, AnnotationValue> getElementValuesWithDefaults(AnnotationMirror annotMirror) {
Map<ExecutableElement, AnnotationValue> valMap = Optional
.ofNullable((Map<ExecutableElement, AnnotationValue>)annotMirror.getElementValues())
.map(x -> new HashMap<... | java | public static Map<ExecutableElement, AnnotationValue> getElementValuesWithDefaults(AnnotationMirror annotMirror) {
Map<ExecutableElement, AnnotationValue> valMap = Optional
.ofNullable((Map<ExecutableElement, AnnotationValue>)annotMirror.getElementValues())
.map(x -> new HashMap<... | [
"public",
"static",
"Map",
"<",
"ExecutableElement",
",",
"AnnotationValue",
">",
"getElementValuesWithDefaults",
"(",
"AnnotationMirror",
"annotMirror",
")",
"{",
"Map",
"<",
"ExecutableElement",
",",
"AnnotationValue",
">",
"valMap",
"=",
"Optional",
".",
"ofNullabl... | Returns the values of an annotation's attributes, including defaults.
The method with the same name in JavacElements cannot be used directly,
because it includes a cast to Attribute.Compound, which doesn't hold
for annotations generated by the Checker Framework.
@param annotMirror annotation to examine
@return the val... | [
"Returns",
"the",
"values",
"of",
"an",
"annotation",
"s",
"attributes",
"including",
"defaults",
".",
"The",
"method",
"with",
"the",
"same",
"name",
"in",
"JavacElements",
"cannot",
"be",
"used",
"directly",
"because",
"it",
"includes",
"a",
"cast",
"to",
... | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L217-L230 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.getElementValueClass | public static <T> Optional<Class<T>> getElementValueClass(AnnotationMirror anno, CharSequence name,
boolean useDefaults) {
Name cn = getElementValueClassName(anno, name, useDefaults);
try {
Class<?> cls = Class.forName(cn.toString... | java | public static <T> Optional<Class<T>> getElementValueClass(AnnotationMirror anno, CharSequence name,
boolean useDefaults) {
Name cn = getElementValueClassName(anno, name, useDefaults);
try {
Class<?> cls = Class.forName(cn.toString... | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"Class",
"<",
"T",
">",
">",
"getElementValueClass",
"(",
"AnnotationMirror",
"anno",
",",
"CharSequence",
"name",
",",
"boolean",
"useDefaults",
")",
"{",
"Name",
"cn",
"=",
"getElementValueClassName",
"(",
... | Get the Class that is referenced by attribute 'name'.
This method uses Class.forName to load the class. It returns
null if the class wasn't found. | [
"Get",
"the",
"Class",
"that",
"is",
"referenced",
"by",
"attribute",
"name",
".",
"This",
"method",
"uses",
"Class",
".",
"forName",
"to",
"load",
"the",
"class",
".",
"It",
"returns",
"null",
"if",
"the",
"class",
"wasn",
"t",
"found",
"."
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L308-L317 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.getElementValueEnum | public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) {
Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults);
T value = Enum.valueOf(t, vs.getSimpleName().toString());
return value;
... | java | public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) {
Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults);
T value = Enum.valueOf(t, vs.getSimpleName().toString());
return value;
... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getElementValueEnum",
"(",
"AnnotationMirror",
"anno",
",",
"CharSequence",
"name",
",",
"Class",
"<",
"T",
">",
"t",
",",
"boolean",
"useDefaults",
")",
"{",
"Symbol",
".",
"VarS... | Version that is suitable for Enum elements. | [
"Version",
"that",
"is",
"suitable",
"for",
"Enum",
"elements",
"."
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L322-L326 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.enclosingClass | public static TypeElement enclosingClass(final Element elem) {
Element result = elem;
while (result != null && !result.getKind().isClass()
&& !result.getKind().isInterface()) {
Element encl = result.getEnclosingElement();
result = encl;
}
return (T... | java | public static TypeElement enclosingClass(final Element elem) {
Element result = elem;
while (result != null && !result.getKind().isClass()
&& !result.getKind().isInterface()) {
Element encl = result.getEnclosingElement();
result = encl;
}
return (T... | [
"public",
"static",
"TypeElement",
"enclosingClass",
"(",
"final",
"Element",
"elem",
")",
"{",
"Element",
"result",
"=",
"elem",
";",
"while",
"(",
"result",
"!=",
"null",
"&&",
"!",
"result",
".",
"getKind",
"(",
")",
".",
"isClass",
"(",
")",
"&&",
... | Returns the innermost type element enclosing the given element
@param elem the enclosed element of a class
@return the innermost type element | [
"Returns",
"the",
"innermost",
"type",
"element",
"enclosing",
"the",
"given",
"element"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L334-L342 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.findFieldInType | public static VariableElement findFieldInType(TypeElement type, String name) {
for (VariableElement field : ElementFilter.fieldsIn(type.getEnclosedElements())) {
if (field.getSimpleName().toString().equals(name)) {
return field;
}
}
return null;
} | java | public static VariableElement findFieldInType(TypeElement type, String name) {
for (VariableElement field : ElementFilter.fieldsIn(type.getEnclosedElements())) {
if (field.getSimpleName().toString().equals(name)) {
return field;
}
}
return null;
} | [
"public",
"static",
"VariableElement",
"findFieldInType",
"(",
"TypeElement",
"type",
",",
"String",
"name",
")",
"{",
"for",
"(",
"VariableElement",
"field",
":",
"ElementFilter",
".",
"fieldsIn",
"(",
"type",
".",
"getEnclosedElements",
"(",
")",
")",
")",
"... | Returns the field of the class | [
"Returns",
"the",
"field",
"of",
"the",
"class"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L347-L354 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java | NativeQuery.executeAsyncWithStats | @Override
public CompletableFuture<ExecutionInfo> executeAsyncWithStats() {
final StatementWrapper statementWrapper = new NativeStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues);
final String queryString = statementWrapper.getBoundStatement().preparedState... | java | @Override
public CompletableFuture<ExecutionInfo> executeAsyncWithStats() {
final StatementWrapper statementWrapper = new NativeStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues);
final String queryString = statementWrapper.getBoundStatement().preparedState... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"ExecutionInfo",
">",
"executeAsyncWithStats",
"(",
")",
"{",
"final",
"StatementWrapper",
"statementWrapper",
"=",
"new",
"NativeStatementWrapper",
"(",
"getOperationType",
"(",
"boundStatement",
")",
",",
"meta",
... | Execute the native query asynchronously and return the execution info
@return CompletableFuture<ExecutionInfo> | [
"Execute",
"the",
"native",
"query",
"asynchronously",
"and",
"return",
"the",
"execution",
"info"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java#L170-L188 | train |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java | AbstractProperty.decodeFromRaw | public VALUEFROM decodeFromRaw(Object o) {
if (o == null && !isOptional()) return null;
return decodeFromRawInternal(o);
} | java | public VALUEFROM decodeFromRaw(Object o) {
if (o == null && !isOptional()) return null;
return decodeFromRawInternal(o);
} | [
"public",
"VALUEFROM",
"decodeFromRaw",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
"&&",
"!",
"isOptional",
"(",
")",
")",
"return",
"null",
";",
"return",
"decodeFromRawInternal",
"(",
"o",
")",
";",
"}"
] | Decode the given raw object to Java value value using Achilles codec system
@param o
@return | [
"Decode",
"the",
"given",
"raw",
"object",
"to",
"Java",
"value",
"value",
"using",
"Achilles",
"codec",
"system"
] | 8281c33100e72c993e570592ae1a5306afac6813 | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L142-L145 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.heapify | public static SetOperation heapify(final Memory srcMem, final long seed) {
final byte famID = srcMem.getByte(FAMILY_BYTE);
final Family family = idToFamily(famID);
switch (family) {
case UNION : {
return UnionImpl.heapifyInstance(srcMem, seed);
}
case INTERSECTION : {
retur... | java | public static SetOperation heapify(final Memory srcMem, final long seed) {
final byte famID = srcMem.getByte(FAMILY_BYTE);
final Family family = idToFamily(famID);
switch (family) {
case UNION : {
return UnionImpl.heapifyInstance(srcMem, seed);
}
case INTERSECTION : {
retur... | [
"public",
"static",
"SetOperation",
"heapify",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"byte",
"famID",
"=",
"srcMem",
".",
"getByte",
"(",
"FAMILY_BYTE",
")",
";",
"final",
"Family",
"family",
"=",
"idToFamily",
... | Heapify takes the SetOperation image in Memory and instantiates an on-heap
SetOperation using the given seed.
The resulting SetOperation will not retain any link to the source Memory.
@param srcMem an image of a SetOperation where the hash of the given seed matches the image seed hash.
<a href="{@docRoot}/resources/dic... | [
"Heapify",
"takes",
"the",
"SetOperation",
"image",
"in",
"Memory",
"and",
"instantiates",
"an",
"on",
"-",
"heap",
"SetOperation",
"using",
"the",
"given",
"seed",
".",
"The",
"resulting",
"SetOperation",
"will",
"not",
"retain",
"any",
"link",
"to",
"the",
... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L66-L81 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.wrap | public static SetOperation wrap(final Memory srcMem, final long seed) {
final byte famID = srcMem.getByte(FAMILY_BYTE);
final Family family = idToFamily(famID);
final int serVer = srcMem.getByte(SER_VER_BYTE);
if (serVer != 3) {
throw new SketchesArgumentException("SerVer must be 3: " + serVer);
... | java | public static SetOperation wrap(final Memory srcMem, final long seed) {
final byte famID = srcMem.getByte(FAMILY_BYTE);
final Family family = idToFamily(famID);
final int serVer = srcMem.getByte(SER_VER_BYTE);
if (serVer != 3) {
throw new SketchesArgumentException("SerVer must be 3: " + serVer);
... | [
"public",
"static",
"SetOperation",
"wrap",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"byte",
"famID",
"=",
"srcMem",
".",
"getByte",
"(",
"FAMILY_BYTE",
")",
";",
"final",
"Family",
"family",
"=",
"idToFamily",
"("... | Wrap takes the SetOperation image in Memory and refers to it directly.
There is no data copying onto the java heap.
Only "Direct" SetOperations that have been explicitly stored as direct can be wrapped.
@param srcMem an image of a SetOperation where the hash of the given seed matches the image seed hash.
<a href="{@doc... | [
"Wrap",
"takes",
"the",
"SetOperation",
"image",
"in",
"Memory",
"and",
"refers",
"to",
"it",
"directly",
".",
"There",
"is",
"no",
"data",
"copying",
"onto",
"the",
"java",
"heap",
".",
"Only",
"Direct",
"SetOperations",
"that",
"have",
"been",
"explicitly"... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L106-L123 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.getMaxIntersectionBytes | public static int getMaxIntersectionBytes(final int nomEntries) {
final int nomEnt = ceilingPowerOf2(nomEntries);
final int bytes = (nomEnt << 4) + (Family.INTERSECTION.getMaxPreLongs() << 3);
return bytes;
} | java | public static int getMaxIntersectionBytes(final int nomEntries) {
final int nomEnt = ceilingPowerOf2(nomEntries);
final int bytes = (nomEnt << 4) + (Family.INTERSECTION.getMaxPreLongs() << 3);
return bytes;
} | [
"public",
"static",
"int",
"getMaxIntersectionBytes",
"(",
"final",
"int",
"nomEntries",
")",
"{",
"final",
"int",
"nomEnt",
"=",
"ceilingPowerOf2",
"(",
"nomEntries",
")",
";",
"final",
"int",
"bytes",
"=",
"(",
"nomEnt",
"<<",
"4",
")",
"+",
"(",
"Family... | Returns the maximum required storage bytes given a nomEntries parameter for Intersection
operations
@param nomEntries <a href="{@docRoot}/resources/dictionary.html#nomEntries">Nominal Entries</a>
This will become the ceiling power of 2 if it is not.
@return the maximum required storage bytes given a nomEntries paramete... | [
"Returns",
"the",
"maximum",
"required",
"storage",
"bytes",
"given",
"a",
"nomEntries",
"parameter",
"for",
"Intersection",
"operations"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L186-L190 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.createCompactSketch | static final CompactSketch createCompactSketch(final long[] compactCache, boolean empty,
final short seedHash, final int curCount, long thetaLong, final boolean dstOrdered,
final WritableMemory dstMem) {
thetaLong = thetaOnCompact(empty, curCount, thetaLong);
empty = emptyOnCompact(curCount, thetaLo... | java | static final CompactSketch createCompactSketch(final long[] compactCache, boolean empty,
final short seedHash, final int curCount, long thetaLong, final boolean dstOrdered,
final WritableMemory dstMem) {
thetaLong = thetaOnCompact(empty, curCount, thetaLong);
empty = emptyOnCompact(curCount, thetaLo... | [
"static",
"final",
"CompactSketch",
"createCompactSketch",
"(",
"final",
"long",
"[",
"]",
"compactCache",
",",
"boolean",
"empty",
",",
"final",
"short",
"seedHash",
",",
"final",
"int",
"curCount",
",",
"long",
"thetaLong",
",",
"final",
"boolean",
"dstOrdered... | used only by the set operations | [
"used",
"only",
"by",
"the",
"set",
"operations"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L227-L259 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.computeMinLgArrLongsFromCount | static final int computeMinLgArrLongsFromCount(final int count) {
final int upperCount = (int) Math.ceil(count / REBUILD_THRESHOLD);
final int arrLongs = max(ceilingPowerOf2(upperCount), 1 << MIN_LG_ARR_LONGS);
final int newLgArrLongs = Integer.numberOfTrailingZeros(arrLongs);
return newLgArrLongs;
} | java | static final int computeMinLgArrLongsFromCount(final int count) {
final int upperCount = (int) Math.ceil(count / REBUILD_THRESHOLD);
final int arrLongs = max(ceilingPowerOf2(upperCount), 1 << MIN_LG_ARR_LONGS);
final int newLgArrLongs = Integer.numberOfTrailingZeros(arrLongs);
return newLgArrLongs;
} | [
"static",
"final",
"int",
"computeMinLgArrLongsFromCount",
"(",
"final",
"int",
"count",
")",
"{",
"final",
"int",
"upperCount",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"count",
"/",
"REBUILD_THRESHOLD",
")",
";",
"final",
"int",
"arrLongs",
"=",
"... | Used by intersection and AnotB | [
"Used",
"by",
"intersection",
"and",
"AnotB"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L267-L272 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperation.java | SetOperation.isValidSetOpID | static boolean isValidSetOpID(final int id) {
final Family family = Family.idToFamily(id);
final boolean ret = ((family == Family.UNION) || (family == Family.INTERSECTION)
|| (family == Family.A_NOT_B));
return ret;
} | java | static boolean isValidSetOpID(final int id) {
final Family family = Family.idToFamily(id);
final boolean ret = ((family == Family.UNION) || (family == Family.INTERSECTION)
|| (family == Family.A_NOT_B));
return ret;
} | [
"static",
"boolean",
"isValidSetOpID",
"(",
"final",
"int",
"id",
")",
"{",
"final",
"Family",
"family",
"=",
"Family",
".",
"idToFamily",
"(",
"id",
")",
";",
"final",
"boolean",
"ret",
"=",
"(",
"(",
"family",
"==",
"Family",
".",
"UNION",
")",
"||",... | Returns true if given Family id is one of the set operations
@param id the given Family id
@return true if given Family id is one of the set operations | [
"Returns",
"true",
"if",
"given",
"Family",
"id",
"is",
"one",
"of",
"the",
"set",
"operations"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L279-L284 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hll/AbstractHllArray.java | AbstractHllArray.hipAndKxQIncrementalUpdate | static final void hipAndKxQIncrementalUpdate(final AbstractHllArray host, final int oldValue,
final int newValue) {
assert newValue > oldValue;
final int configK = 1 << host.getLgConfigK();
//update hipAccum BEFORE updating kxq0 and kxq1
double kxq0 = host.getKxQ0();
double kxq1 = host.getKxQ1... | java | static final void hipAndKxQIncrementalUpdate(final AbstractHllArray host, final int oldValue,
final int newValue) {
assert newValue > oldValue;
final int configK = 1 << host.getLgConfigK();
//update hipAccum BEFORE updating kxq0 and kxq1
double kxq0 = host.getKxQ0();
double kxq1 = host.getKxQ1... | [
"static",
"final",
"void",
"hipAndKxQIncrementalUpdate",
"(",
"final",
"AbstractHllArray",
"host",
",",
"final",
"int",
"oldValue",
",",
"final",
"int",
"newValue",
")",
"{",
"assert",
"newValue",
">",
"oldValue",
";",
"final",
"int",
"configK",
"=",
"1",
"<<"... | Called here and by Heap and Direct 6 and 8 bit implementations | [
"Called",
"here",
"and",
"by",
"Heap",
"and",
"Direct",
"6",
"and",
"8",
"bit",
"implementations"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/AbstractHllArray.java#L161-L174 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java | SingleItemSketch.heapify | public static SingleItemSketch heapify(final Memory mem) {
final long memPre0 = mem.getLong(0);
checkDefaultBytes0to7(memPre0);
return new SingleItemSketch(mem.getLong(8));
} | java | public static SingleItemSketch heapify(final Memory mem) {
final long memPre0 = mem.getLong(0);
checkDefaultBytes0to7(memPre0);
return new SingleItemSketch(mem.getLong(8));
} | [
"public",
"static",
"SingleItemSketch",
"heapify",
"(",
"final",
"Memory",
"mem",
")",
"{",
"final",
"long",
"memPre0",
"=",
"mem",
".",
"getLong",
"(",
"0",
")",
";",
"checkDefaultBytes0to7",
"(",
"memPre0",
")",
";",
"return",
"new",
"SingleItemSketch",
"(... | Creates a SingleItemSketch on the heap given a Memory and assumes the DEFAULT_UPDATE_SEED.
@param mem the Memory to be heapified. It must be a least 16 bytes.
@return a SingleItemSketch | [
"Creates",
"a",
"SingleItemSketch",
"on",
"the",
"heap",
"given",
"a",
"Memory",
"and",
"assumes",
"the",
"DEFAULT_UPDATE_SEED",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L55-L59 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java | SingleItemSketch.heapify | public static SingleItemSketch heapify(final Memory mem, final long seed) {
final long memPre0 = mem.getLong(0);
checkDefaultBytes0to5(memPre0);
final short seedHashIn = mem.getShort(6);
final short seedHashCk = computeSeedHash(seed);
checkSeedHashes(seedHashIn, seedHashCk);
return new SingleIte... | java | public static SingleItemSketch heapify(final Memory mem, final long seed) {
final long memPre0 = mem.getLong(0);
checkDefaultBytes0to5(memPre0);
final short seedHashIn = mem.getShort(6);
final short seedHashCk = computeSeedHash(seed);
checkSeedHashes(seedHashIn, seedHashCk);
return new SingleIte... | [
"public",
"static",
"SingleItemSketch",
"heapify",
"(",
"final",
"Memory",
"mem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"long",
"memPre0",
"=",
"mem",
".",
"getLong",
"(",
"0",
")",
";",
"checkDefaultBytes0to5",
"(",
"memPre0",
")",
";",
"final"... | Creates a SingleItemSketch on the heap given a Memory.
Checks the seed hash of the given Memory against a hash of the given seed.
@param mem the Memory to be heapified
@param seed a given hash seed
@return a SingleItemSketch | [
"Creates",
"a",
"SingleItemSketch",
"on",
"the",
"heap",
"given",
"a",
"Memory",
".",
"Checks",
"the",
"seed",
"hash",
"of",
"the",
"given",
"Memory",
"against",
"a",
"hash",
"of",
"the",
"given",
"seed",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L68-L75 | train |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java | SingleItemSketch.create | public static SingleItemSketch create(final byte[] data) {
if ((data == null) || (data.length == 0)) { return null; }
return new SingleItemSketch(hash(data, DEFAULT_UPDATE_SEED)[0] >>> 1);
} | java | public static SingleItemSketch create(final byte[] data) {
if ((data == null) || (data.length == 0)) { return null; }
return new SingleItemSketch(hash(data, DEFAULT_UPDATE_SEED)[0] >>> 1);
} | [
"public",
"static",
"SingleItemSketch",
"create",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"(",
"data",
"==",
"null",
")",
"||",
"(",
"data",
".",
"length",
"==",
"0",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
... | Create this sketch with the given byte array.
If the byte array is null or empty no create attempt is made and the method returns null.
@param data The given byte array.
@return a SingleItemSketch or null | [
"Create",
"this",
"sketch",
"with",
"the",
"given",
"byte",
"array",
".",
"If",
"the",
"byte",
"array",
"is",
"null",
"or",
"empty",
"no",
"create",
"attempt",
"is",
"made",
"and",
"the",
"method",
"returns",
"null",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L131-L134 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.