id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
53,100
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/LinearSGD.java
LinearSGD.applyL2Reg
private void applyL2Reg(final double eta_t) { if(lambda0 > 0)//apply L2 regularization for(Vec v : ws) v.mutableMultiply(1-eta_t*lambda0); }
java
private void applyL2Reg(final double eta_t) { if(lambda0 > 0)//apply L2 regularization for(Vec v : ws) v.mutableMultiply(1-eta_t*lambda0); }
[ "private", "void", "applyL2Reg", "(", "final", "double", "eta_t", ")", "{", "if", "(", "lambda0", ">", "0", ")", "//apply L2 regularization", "for", "(", "Vec", "v", ":", "ws", ")", "v", ".", "mutableMultiply", "(", "1", "-", "eta_t", "*", "lambda0", "...
Applies L2 regularization to the model @param eta_t the learning rate in use
[ "Applies", "L2", "regularization", "to", "the", "model" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/LinearSGD.java#L449-L454
53,101
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/LinearSGD.java
LinearSGD.applyL1Reg
private void applyL1Reg(final double eta_t, Vec x) { //apply l1 regularization if(lambda1 > 0) { l1U += eta_t*lambda1;//line 6: in Tsuruoka et al paper, figure 2 for(int k = 0; k < ws.length; k++) { final Vec w_k = ws[k]; fi...
java
private void applyL1Reg(final double eta_t, Vec x) { //apply l1 regularization if(lambda1 > 0) { l1U += eta_t*lambda1;//line 6: in Tsuruoka et al paper, figure 2 for(int k = 0; k < ws.length; k++) { final Vec w_k = ws[k]; fi...
[ "private", "void", "applyL1Reg", "(", "final", "double", "eta_t", ",", "Vec", "x", ")", "{", "//apply l1 regularization", "if", "(", "lambda1", ">", "0", ")", "{", "l1U", "+=", "eta_t", "*", "lambda1", ";", "//line 6: in Tsuruoka et al paper, figure 2", "for", ...
Applies L1 regularization to the model @param eta_t the learning rate in use @param x the input vector the update is from
[ "Applies", "L1", "regularization", "to", "the", "model" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/LinearSGD.java#L461-L486
53,102
EdwardRaff/JSAT
JSAT/src/jsat/linear/vectorcollection/lsh/RandomProjectionLSH.java
RandomProjectionLSH.projectVector
private void projectVector(Vec vec, int slot, int[] projLocation, Vec projected) { randProjMatrix.multiply(vec, 1.0, projected); int pos = 0; int bitsLeft = Integer.SIZE; int curVal = 0; while(pos < slotsPerEntry) { while(bitsLeft > 0) ...
java
private void projectVector(Vec vec, int slot, int[] projLocation, Vec projected) { randProjMatrix.multiply(vec, 1.0, projected); int pos = 0; int bitsLeft = Integer.SIZE; int curVal = 0; while(pos < slotsPerEntry) { while(bitsLeft > 0) ...
[ "private", "void", "projectVector", "(", "Vec", "vec", ",", "int", "slot", ",", "int", "[", "]", "projLocation", ",", "Vec", "projected", ")", "{", "randProjMatrix", ".", "multiply", "(", "vec", ",", "1.0", ",", "projected", ")", ";", "int", "pos", "="...
Projects a given vector into the array of integers. @param vecs the vector to project @param slot the index into the array to start placing the bit values @param projected a vector full of zeros of the same length as {@link #getSignatureBitLength() } to use as a temp space.
[ "Projects", "a", "given", "vector", "into", "the", "array", "of", "integers", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/vectorcollection/lsh/RandomProjectionLSH.java#L223-L244
53,103
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/trees/TreePruner.java
TreePruner.prune
public static void prune(TreeNodeVisitor root, PruningMethod method, ClassificationDataSet testSet) { //TODO add vargs for extra arguments that may be used by pruning methods if(method == PruningMethod.NONE ) return; else if(method == PruningMethod.REDUCED_ERROR) prun...
java
public static void prune(TreeNodeVisitor root, PruningMethod method, ClassificationDataSet testSet) { //TODO add vargs for extra arguments that may be used by pruning methods if(method == PruningMethod.NONE ) return; else if(method == PruningMethod.REDUCED_ERROR) prun...
[ "public", "static", "void", "prune", "(", "TreeNodeVisitor", "root", ",", "PruningMethod", "method", ",", "ClassificationDataSet", "testSet", ")", "{", "//TODO add vargs for extra arguments that may be used by pruning methods", "if", "(", "method", "==", "PruningMethod", "....
Performs pruning starting from the root node of a tree @param root the root node of a decision tree @param method the pruning method to use @param testSet the test set of data points to use for pruning
[ "Performs", "pruning", "starting", "from", "the", "root", "node", "of", "a", "tree" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/TreePruner.java#L66-L77
53,104
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/trees/TreePruner.java
TreePruner.pruneReduceError
private static int pruneReduceError(TreeNodeVisitor parent, int pathFollowed, TreeNodeVisitor current, ClassificationDataSet testSet) { if(current == null) return 0; int nodesPruned = 0; //If we are not a leaf, prune our children if(!current.isLeaf()) { ...
java
private static int pruneReduceError(TreeNodeVisitor parent, int pathFollowed, TreeNodeVisitor current, ClassificationDataSet testSet) { if(current == null) return 0; int nodesPruned = 0; //If we are not a leaf, prune our children if(!current.isLeaf()) { ...
[ "private", "static", "int", "pruneReduceError", "(", "TreeNodeVisitor", "parent", ",", "int", "pathFollowed", ",", "TreeNodeVisitor", "current", ",", "ClassificationDataSet", "testSet", ")", "{", "if", "(", "current", "==", "null", ")", "return", "0", ";", "int"...
Performs pruning to reduce error on the testing set @param parent the parent of the current node, may be null @param pathFollowed the path from the parent that lead to the current node @param current the current node being considered @param testSet the set of testing points to apply to this node @return the number of n...
[ "Performs", "pruning", "to", "reduce", "error", "on", "the", "testing", "set" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/TreePruner.java#L87-L156
53,105
EdwardRaff/JSAT
JSAT/src/jsat/distributions/Levy.java
Levy.setScale
public void setScale(double scale) { if(scale <= 0 || Double.isNaN(scale) || Double.isInfinite(scale)) throw new ArithmeticException("Scale must be a positive value, not " + scale); this.scale = scale; this.logScale = log(scale); }
java
public void setScale(double scale) { if(scale <= 0 || Double.isNaN(scale) || Double.isInfinite(scale)) throw new ArithmeticException("Scale must be a positive value, not " + scale); this.scale = scale; this.logScale = log(scale); }
[ "public", "void", "setScale", "(", "double", "scale", ")", "{", "if", "(", "scale", "<=", "0", "||", "Double", ".", "isNaN", "(", "scale", ")", "||", "Double", ".", "isInfinite", "(", "scale", ")", ")", "throw", "new", "ArithmeticException", "(", "\"Sc...
Sets the scale of the Levy distribution @param scale the new scale value, must be positive
[ "Sets", "the", "scale", "of", "the", "Levy", "distribution" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/Levy.java#L33-L39
53,106
EdwardRaff/JSAT
JSAT/src/jsat/distributions/Levy.java
Levy.setLocation
public void setLocation(double location) { if(Double.isNaN(location) || Double.isInfinite(location)) throw new ArithmeticException("location must be a real number"); this.location = location; }
java
public void setLocation(double location) { if(Double.isNaN(location) || Double.isInfinite(location)) throw new ArithmeticException("location must be a real number"); this.location = location; }
[ "public", "void", "setLocation", "(", "double", "location", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "location", ")", "||", "Double", ".", "isInfinite", "(", "location", ")", ")", "throw", "new", "ArithmeticException", "(", "\"location must be a real ...
Sets location of the Levy distribution. @param location the new location
[ "Sets", "location", "of", "the", "Levy", "distribution", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/Levy.java#L54-L59
53,107
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/svm/extended/CPM.java
CPM.sgdTrain
private void sgdTrain(ClassificationDataSet D, MatrixOfVecs W, Vec b, int sign_mul, boolean parallel) { IntList order = new IntList(D.size()); ListUtils.addRange(order, 0, D.size(), 1); final double lambda_adj = lambda/(D.size()*epochs); int[] owned = new int[K];//h...
java
private void sgdTrain(ClassificationDataSet D, MatrixOfVecs W, Vec b, int sign_mul, boolean parallel) { IntList order = new IntList(D.size()); ListUtils.addRange(order, 0, D.size(), 1); final double lambda_adj = lambda/(D.size()*epochs); int[] owned = new int[K];//h...
[ "private", "void", "sgdTrain", "(", "ClassificationDataSet", "D", ",", "MatrixOfVecs", "W", ",", "Vec", "b", ",", "int", "sign_mul", ",", "boolean", "parallel", ")", "{", "IntList", "order", "=", "new", "IntList", "(", "D", ".", "size", "(", ")", ")", ...
Training procedure that can be applied to each version of the CPM sub-problem. @param D the dataset to train on @param W the weight matrix of vectors to use @param b a vector that stores the associated bias terms for each weigh vector. @param sign_mul Either positive or negative 1. Controls whether or not the positive...
[ "Training", "procedure", "that", "can", "be", "applied", "to", "each", "version", "of", "the", "CPM", "sub", "-", "problem", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/extended/CPM.java#L413-L482
53,108
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/STGD.java
STGD.setLearningRate
public void setLearningRate(double learningRate) { if(Double.isInfinite(learningRate) || Double.isNaN(learningRate) || learningRate <= 0) throw new IllegalArgumentException("Learning rate must be positive, not " + learningRate); this.learningRate = learningRate; }
java
public void setLearningRate(double learningRate) { if(Double.isInfinite(learningRate) || Double.isNaN(learningRate) || learningRate <= 0) throw new IllegalArgumentException("Learning rate must be positive, not " + learningRate); this.learningRate = learningRate; }
[ "public", "void", "setLearningRate", "(", "double", "learningRate", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "learningRate", ")", "||", "Double", ".", "isNaN", "(", "learningRate", ")", "||", "learningRate", "<=", "0", ")", "throw", "new", "I...
Sets the learning rate to use @param learningRate the learning rate &gt; 0.
[ "Sets", "the", "learning", "rate", "to", "use" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L108-L113
53,109
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/STGD.java
STGD.setThreshold
public void setThreshold(double threshold) { if(Double.isNaN(threshold) || threshold <= 0) throw new IllegalArgumentException("Threshold must be positive, not " + threshold); this.threshold = threshold; }
java
public void setThreshold(double threshold) { if(Double.isNaN(threshold) || threshold <= 0) throw new IllegalArgumentException("Threshold must be positive, not " + threshold); this.threshold = threshold; }
[ "public", "void", "setThreshold", "(", "double", "threshold", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "threshold", ")", "||", "threshold", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Threshold must be positive, not \"", "+", "th...
Sets the threshold for a coefficient value to avoid regularization. While a coefficient reaches this magnitude, regularization will not be applied. @param threshold the coefficient regularization threshold in ( 0, Infinity ]
[ "Sets", "the", "threshold", "for", "a", "coefficient", "value", "to", "avoid", "regularization", ".", "While", "a", "coefficient", "reaches", "this", "magnitude", "regularization", "will", "not", "be", "applied", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L130-L135
53,110
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/STGD.java
STGD.setGravity
public void setGravity(double gravity) { if(Double.isInfinite(gravity) || Double.isNaN(gravity) || gravity <= 0) throw new IllegalArgumentException("Gravity must be positive, not " + gravity); this.gravity = gravity; }
java
public void setGravity(double gravity) { if(Double.isInfinite(gravity) || Double.isNaN(gravity) || gravity <= 0) throw new IllegalArgumentException("Gravity must be positive, not " + gravity); this.gravity = gravity; }
[ "public", "void", "setGravity", "(", "double", "gravity", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "gravity", ")", "||", "Double", ".", "isNaN", "(", "gravity", ")", "||", "gravity", "<=", "0", ")", "throw", "new", "IllegalArgumentException",...
Sets the gravity regularization parameter that "weighs down" the coefficient values. Larger gravity values impose stronger regularization, and encourage greater sparsity. @param gravity the regularization parameter in ( 0, Infinity )
[ "Sets", "the", "gravity", "regularization", "parameter", "that", "weighs", "down", "the", "coefficient", "values", ".", "Larger", "gravity", "values", "impose", "stronger", "regularization", "and", "encourage", "greater", "sparsity", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L153-L158
53,111
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/STGD.java
STGD.performUpdate
private void performUpdate(final Vec x, final double y, final double yHat) { for(IndexValue iv : x) { final int j = iv.getIndex(); w.set(j, T(w.get(j)+2*learningRate*(y-yHat)*iv.getValue(), ((time-t[j])/K)*gravity*learningRate, ...
java
private void performUpdate(final Vec x, final double y, final double yHat) { for(IndexValue iv : x) { final int j = iv.getIndex(); w.set(j, T(w.get(j)+2*learningRate*(y-yHat)*iv.getValue(), ((time-t[j])/K)*gravity*learningRate, ...
[ "private", "void", "performUpdate", "(", "final", "Vec", "x", ",", "final", "double", "y", ",", "final", "double", "yHat", ")", "{", "for", "(", "IndexValue", "iv", ":", "x", ")", "{", "final", "int", "j", "=", "iv", ".", "getIndex", "(", ")", ";",...
Performs the sparse update of the weight vector @param x the input vector @param y the true value @param yHat the predicted value
[ "Performs", "the", "sparse", "update", "of", "the", "weight", "vector" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L277-L289
53,112
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/featureselection/SFS.java
SFS.SFSSelectFeature
static protected int SFSSelectFeature(Set<Integer> available, DataSet dataSet, Set<Integer> catToRemove, Set<Integer> numToRemove, Set<Integer> catSelecteed, Set<Integer> numSelected, Object evaluater, int folds, Random rand, double[] PbestScore, int minFeatures) {...
java
static protected int SFSSelectFeature(Set<Integer> available, DataSet dataSet, Set<Integer> catToRemove, Set<Integer> numToRemove, Set<Integer> catSelecteed, Set<Integer> numSelected, Object evaluater, int folds, Random rand, double[] PbestScore, int minFeatures) {...
[ "static", "protected", "int", "SFSSelectFeature", "(", "Set", "<", "Integer", ">", "available", ",", "DataSet", "dataSet", ",", "Set", "<", "Integer", ">", "catToRemove", ",", "Set", "<", "Integer", ">", "numToRemove", ",", "Set", "<", "Integer", ">", "cat...
Attempts to add one feature to the list of features while increasing or maintaining the current accuracy @param available the set of available features from [0, n) to consider for adding @param dataSet the original data set to perform feature selection from @param catToRemove the current set of categorical features to...
[ "Attempts", "to", "add", "one", "feature", "to", "the", "list", "of", "features", "while", "increasing", "or", "maintaining", "the", "current", "accuracy" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/featureselection/SFS.java#L256-L297
53,113
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/featureselection/SFS.java
SFS.getScore
protected static double getScore(DataSet workOn, Object evaluater, int folds, Random rand) { if(workOn instanceof ClassificationDataSet) { ClassificationModelEvaluation cme = new ClassificationModelEvaluation((Classifier)evaluater, (Classification...
java
protected static double getScore(DataSet workOn, Object evaluater, int folds, Random rand) { if(workOn instanceof ClassificationDataSet) { ClassificationModelEvaluation cme = new ClassificationModelEvaluation((Classifier)evaluater, (Classification...
[ "protected", "static", "double", "getScore", "(", "DataSet", "workOn", ",", "Object", "evaluater", ",", "int", "folds", ",", "Random", "rand", ")", "{", "if", "(", "workOn", "instanceof", "ClassificationDataSet", ")", "{", "ClassificationModelEvaluation", "cme", ...
The score function for a data set and a learner by cross validation of a classifier @param workOn the transformed data set to test from with cross validation @param evaluater the learning algorithm to use @param folds the number of cross validation folds to perform @param rand the source of randomness @return the scor...
[ "The", "score", "function", "for", "a", "data", "set", "and", "a", "learner", "by", "cross", "validation", "of", "a", "classifier" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/featureselection/SFS.java#L309-L330
53,114
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/bayesian/AODE.java
AODE.setM
public void setM(double m) { if(m < 0 || Double.isInfinite(m) || Double.isNaN(m)) throw new ArithmeticException("The minimum count must be a non negative number"); this.m = m; }
java
public void setM(double m) { if(m < 0 || Double.isInfinite(m) || Double.isNaN(m)) throw new ArithmeticException("The minimum count must be a non negative number"); this.m = m; }
[ "public", "void", "setM", "(", "double", "m", ")", "{", "if", "(", "m", "<", "0", "||", "Double", ".", "isInfinite", "(", "m", ")", "||", "Double", ".", "isNaN", "(", "m", ")", ")", "throw", "new", "ArithmeticException", "(", "\"The minimum count must ...
Sets the minimum prior observation value needed for an attribute combination to have enough support to be included in the final estimate. @param m the minimum needed score
[ "Sets", "the", "minimum", "prior", "observation", "value", "needed", "for", "an", "attribute", "combination", "to", "have", "enough", "support", "to", "be", "included", "in", "the", "final", "estimate", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/bayesian/AODE.java#L133-L138
53,115
EdwardRaff/JSAT
JSAT/src/jsat/linear/VecPaired.java
VecPaired.extractTrueVec
public static Vec extractTrueVec(Vec b) { while(b instanceof VecPaired) b = ((VecPaired) b).getVector(); return b; }
java
public static Vec extractTrueVec(Vec b) { while(b instanceof VecPaired) b = ((VecPaired) b).getVector(); return b; }
[ "public", "static", "Vec", "extractTrueVec", "(", "Vec", "b", ")", "{", "while", "(", "b", "instanceof", "VecPaired", ")", "b", "=", "(", "(", "VecPaired", ")", "b", ")", ".", "getVector", "(", ")", ";", "return", "b", ";", "}" ]
This method is used assuming multiple VecPaired are used together. The implementation of the vector may have logic to handle the case that the other vector is of the same type. This will go through every layer of VecPaired to return the final base vector. @param b a Vec, that may or may not be an instance of {@link Ve...
[ "This", "method", "is", "used", "assuming", "multiple", "VecPaired", "are", "used", "together", ".", "The", "implementation", "of", "the", "vector", "may", "have", "logic", "to", "handle", "the", "case", "that", "the", "other", "vector", "is", "of", "the", ...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/VecPaired.java#L316-L321
53,116
EdwardRaff/JSAT
JSAT/src/jsat/text/TextDataLoader.java
TextDataLoader.addWord
private boolean addWord(String word, SparseVector vec, Integer value) { Integer indx = wordIndex.get(word); if(indx == null)//this word has never been seen before! { Integer index_for_new_word; if((index_for_new_word = wordIndex.putIfAbsent(word, -1)) == null)//I won ...
java
private boolean addWord(String word, SparseVector vec, Integer value) { Integer indx = wordIndex.get(word); if(indx == null)//this word has never been seen before! { Integer index_for_new_word; if((index_for_new_word = wordIndex.putIfAbsent(word, -1)) == null)//I won ...
[ "private", "boolean", "addWord", "(", "String", "word", ",", "SparseVector", "vec", ",", "Integer", "value", ")", "{", "Integer", "indx", "=", "wordIndex", ".", "get", "(", "word", ")", ";", "if", "(", "indx", "==", "null", ")", "//this word has never been...
Does the work to add a given word to the sparse vector. May not succeed in race conditions when two ore more threads are trying to add a word at the same time. @param word the word to add to the vector @param vec the location to store the word occurrence @param entry the number of times the word occurred @return {@cod...
[ "Does", "the", "work", "to", "add", "a", "given", "word", "to", "the", "sparse", "vector", ".", "May", "not", "succeed", "in", "race", "conditions", "when", "two", "ore", "more", "threads", "are", "trying", "to", "add", "a", "word", "at", "the", "same"...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/TextDataLoader.java#L215-L268
53,117
EdwardRaff/JSAT
JSAT/src/jsat/distributions/discrete/Poisson.java
Poisson.setLambda
public void setLambda(double lambda) { if (Double.isNaN(lambda) || lambda <= 0 || Double.isInfinite(lambda)) throw new IllegalArgumentException("lambda must be positive, not " + lambda); this.lambda = lambda; }
java
public void setLambda(double lambda) { if (Double.isNaN(lambda) || lambda <= 0 || Double.isInfinite(lambda)) throw new IllegalArgumentException("lambda must be positive, not " + lambda); this.lambda = lambda; }
[ "public", "void", "setLambda", "(", "double", "lambda", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "lambda", ")", "||", "lambda", "<=", "0", "||", "Double", ".", "isInfinite", "(", "lambda", ")", ")", "throw", "new", "IllegalArgumentException", "(...
Sets the average rate of the event occurring in a unit of time @param lambda the average rate of the event occurring
[ "Sets", "the", "average", "rate", "of", "the", "event", "occurring", "in", "a", "unit", "of", "time" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/Poisson.java#L58-L63
53,118
EdwardRaff/JSAT
JSAT/src/jsat/linear/vectorcollection/KDTree.java
KDTree.getMedianIndex
public int getMedianIndex(final List<Integer> data, int pivot) { int medianIndex = data.size()/2; //What if more than one point have the samve value? Keep incrementing until that dosn't happen while(medianIndex < data.size()-1 && allVecs.get(data.get(medianIndex)).get(pivot) == allVecs.get(d...
java
public int getMedianIndex(final List<Integer> data, int pivot) { int medianIndex = data.size()/2; //What if more than one point have the samve value? Keep incrementing until that dosn't happen while(medianIndex < data.size()-1 && allVecs.get(data.get(medianIndex)).get(pivot) == allVecs.get(d...
[ "public", "int", "getMedianIndex", "(", "final", "List", "<", "Integer", ">", "data", ",", "int", "pivot", ")", "{", "int", "medianIndex", "=", "data", ".", "size", "(", ")", "/", "2", ";", "//What if more than one point have the samve value? Keep incrementing unt...
Returns the index for the median, adjusted incase multiple features have the same value. @param data the dataset to get the median index of @param pivot the dimension to pivot on, and ensure the median index has a different value on the left side @return
[ "Returns", "the", "index", "for", "the", "median", "adjusted", "incase", "multiple", "features", "have", "the", "same", "value", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/vectorcollection/KDTree.java#L615-L622
53,119
EdwardRaff/JSAT
JSAT/src/jsat/distributions/discrete/Zipf.java
Zipf.setCardinality
public void setCardinality(double cardinality) { if (cardinality < 0 || Double.isNaN(cardinality)) throw new IllegalArgumentException("Cardinality must be a positive integer or infinity, not " + cardinality); this.cardinality = Math.ceil(cardinality); fixCache(); }
java
public void setCardinality(double cardinality) { if (cardinality < 0 || Double.isNaN(cardinality)) throw new IllegalArgumentException("Cardinality must be a positive integer or infinity, not " + cardinality); this.cardinality = Math.ceil(cardinality); fixCache(); }
[ "public", "void", "setCardinality", "(", "double", "cardinality", ")", "{", "if", "(", "cardinality", "<", "0", "||", "Double", ".", "isNaN", "(", "cardinality", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Cardinality must be a positive integer or ...
Sets the cardinality of the distribution, defining the maximum number of items that Zipf can return. @param cardinality the maximum output range of the distribution, can be {@link Double#POSITIVE_INFINITY infinite}.
[ "Sets", "the", "cardinality", "of", "the", "distribution", "defining", "the", "maximum", "number", "of", "items", "that", "Zipf", "can", "return", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/Zipf.java#L87-L93
53,120
EdwardRaff/JSAT
JSAT/src/jsat/distributions/discrete/Zipf.java
Zipf.setSkew
public void setSkew(double skew) { if(skew <= 0 || Double.isNaN(skew) || Double.isInfinite(skew)) throw new IllegalArgumentException("Skew must be a positive value, not " + skew); this.skew = skew; fixCache(); }
java
public void setSkew(double skew) { if(skew <= 0 || Double.isNaN(skew) || Double.isInfinite(skew)) throw new IllegalArgumentException("Skew must be a positive value, not " + skew); this.skew = skew; fixCache(); }
[ "public", "void", "setSkew", "(", "double", "skew", ")", "{", "if", "(", "skew", "<=", "0", "||", "Double", ".", "isNaN", "(", "skew", ")", "||", "Double", ".", "isInfinite", "(", "skew", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Sk...
Sets the skewness of the distribution. Lower values spread out the probability distribution, while higher values concentrate on the lowest ranks. @param skew the positive value for the distribution's skew
[ "Sets", "the", "skewness", "of", "the", "distribution", ".", "Lower", "values", "spread", "out", "the", "probability", "distribution", "while", "higher", "values", "concentrate", "on", "the", "lowest", "ranks", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/Zipf.java#L111-L117
53,121
EdwardRaff/JSAT
JSAT/src/jsat/io/DataWriter.java
DataWriter.writePoint
public void writePoint(double weight, DataPoint dp, double label) throws IOException { ByteArrayOutputStream baos = local_baos.get(); pointToBytes(weight, dp, label, baos); if(baos.size() >= LOCAL_BUFFER_SIZE)//We've got a big chunk of data, lets dump it synchronized(out) ...
java
public void writePoint(double weight, DataPoint dp, double label) throws IOException { ByteArrayOutputStream baos = local_baos.get(); pointToBytes(weight, dp, label, baos); if(baos.size() >= LOCAL_BUFFER_SIZE)//We've got a big chunk of data, lets dump it synchronized(out) ...
[ "public", "void", "writePoint", "(", "double", "weight", ",", "DataPoint", "dp", ",", "double", "label", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "baos", "=", "local_baos", ".", "get", "(", ")", ";", "pointToBytes", "(", "weight", ",", "dp...
Write out the given data point to the output stream @param weight weight of the given data point to write out @param dp the data point to write to the file @param label The associated label for this dataum. If {@link #type} is a {@link DataSetType#SIMPLE} set, this value will be ignored. If {@link DataSetType#CLASSIFIC...
[ "Write", "out", "the", "given", "data", "point", "to", "the", "output", "stream" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/DataWriter.java#L114-L124
53,122
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/PolynomialTransform.java
PolynomialTransform.increment
private int increment(int[] setTo, int max, int curCount) { setTo[0]++; curCount++; if(curCount <= max) return curCount; int carryPos = 0; while(carryPos < setTo.length-1 && curCount > max) { curCount-=setTo[carryPos]...
java
private int increment(int[] setTo, int max, int curCount) { setTo[0]++; curCount++; if(curCount <= max) return curCount; int carryPos = 0; while(carryPos < setTo.length-1 && curCount > max) { curCount-=setTo[carryPos]...
[ "private", "int", "increment", "(", "int", "[", "]", "setTo", ",", "int", "max", ",", "int", "curCount", ")", "{", "setTo", "[", "0", "]", "++", ";", "curCount", "++", ";", "if", "(", "curCount", "<=", "max", ")", "return", "curCount", ";", "int", ...
Increments the array to contain representation of the next combination of values in the polynomial @param setTo the array of values marking how many multiples of that value will be used in construction of the point @param max the degree of the polynomial @param curCount the current sum of all counts in the array <tt>s...
[ "Increments", "the", "array", "to", "contain", "representation", "of", "the", "next", "combination", "of", "values", "in", "the", "polynomial" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/PolynomialTransform.java#L91-L110
53,123
EdwardRaff/JSAT
JSAT/src/jsat/parameters/ModelSearch.java
ModelSearch.getParameterByName
protected Parameter getParameterByName(String name) throws IllegalArgumentException { Parameter param; if (baseClassifier != null) param = ((Parameterized) baseClassifier).getParameter(name); else param = ((Parameterized) baseRegressor).getParameter(name); ...
java
protected Parameter getParameterByName(String name) throws IllegalArgumentException { Parameter param; if (baseClassifier != null) param = ((Parameterized) baseClassifier).getParameter(name); else param = ((Parameterized) baseRegressor).getParameter(name); ...
[ "protected", "Parameter", "getParameterByName", "(", "String", "name", ")", "throws", "IllegalArgumentException", "{", "Parameter", "param", ";", "if", "(", "baseClassifier", "!=", "null", ")", "param", "=", "(", "(", "Parameterized", ")", "baseClassifier", ")", ...
Finds the parameter object with the given name, or throws an exception if a parameter with the given name does not exist. @param name the name to search for @return the parameter object in question @throws IllegalArgumentException if the name is not found
[ "Finds", "the", "parameter", "object", "with", "the", "given", "name", "or", "throws", "an", "exception", "if", "a", "parameter", "with", "the", "given", "name", "does", "not", "exist", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/parameters/ModelSearch.java#L319-L329
53,124
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/kernelized/CSKLR.java
CSKLR.getPreScore
private double getPreScore(Vec x) { return k.evalSum(vecs, accelCache, alpha.getBackingArray(), x, 0, alpha.size()); }
java
private double getPreScore(Vec x) { return k.evalSum(vecs, accelCache, alpha.getBackingArray(), x, 0, alpha.size()); }
[ "private", "double", "getPreScore", "(", "Vec", "x", ")", "{", "return", "k", ".", "evalSum", "(", "vecs", ",", "accelCache", ",", "alpha", ".", "getBackingArray", "(", ")", ",", "x", ",", "0", ",", "alpha", ".", "size", "(", ")", ")", ";", "}" ]
Computes the margin score for the given data point @param x the input vector @return the margin score
[ "Computes", "the", "margin", "score", "for", "the", "given", "data", "point" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/kernelized/CSKLR.java#L372-L375
53,125
EdwardRaff/JSAT
JSAT/src/jsat/distributions/multivariate/NormalM.java
NormalM.setCovariance
public void setCovariance(Matrix covMatrix) { if(!covMatrix.isSquare()) throw new ArithmeticException("Covariance matrix must be square"); else if(covMatrix.rows() != this.mean.length()) throw new ArithmeticException("Covariance matrix does not agree with the mean"); ...
java
public void setCovariance(Matrix covMatrix) { if(!covMatrix.isSquare()) throw new ArithmeticException("Covariance matrix must be square"); else if(covMatrix.rows() != this.mean.length()) throw new ArithmeticException("Covariance matrix does not agree with the mean"); ...
[ "public", "void", "setCovariance", "(", "Matrix", "covMatrix", ")", "{", "if", "(", "!", "covMatrix", ".", "isSquare", "(", ")", ")", "throw", "new", "ArithmeticException", "(", "\"Covariance matrix must be square\"", ")", ";", "else", "if", "(", "covMatrix", ...
Sets the covariance matrix for this matrix. @param covMatrix set the covariance matrix used for this distribution @throws ArithmeticException if the covariance matrix is not square, does not agree with the mean, or is not positive definite. An exception may not be throw for all bad matrices.
[ "Sets", "the", "covariance", "matrix", "for", "this", "matrix", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/multivariate/NormalM.java#L96-L123
53,126
EdwardRaff/JSAT
JSAT/src/jsat/clustering/PAM.java
PAM.cluster
protected double cluster(DataSet data, boolean doInit, int[] medioids, int[] assignments, List<Double> cacheAccel, boolean parallel) { DoubleAdder totalDistance =new DoubleAdder(); LongAdder changes = new LongAdder(); Arrays.fill(assignments, -1);//-1, invalid category! int[...
java
protected double cluster(DataSet data, boolean doInit, int[] medioids, int[] assignments, List<Double> cacheAccel, boolean parallel) { DoubleAdder totalDistance =new DoubleAdder(); LongAdder changes = new LongAdder(); Arrays.fill(assignments, -1);//-1, invalid category! int[...
[ "protected", "double", "cluster", "(", "DataSet", "data", ",", "boolean", "doInit", ",", "int", "[", "]", "medioids", ",", "int", "[", "]", "assignments", ",", "List", "<", "Double", ">", "cacheAccel", ",", "boolean", "parallel", ")", "{", "DoubleAdder", ...
Performs the actual work of PAM. @param data the data set to apply PAM to @param doInit {@code true} if the initialization procedure of training the distance metric, initiating its cache, and selecting he seeds, should be done. @param medioids the array to store the indices that get chosen as the medoids. The length o...
[ "Performs", "the", "actual", "work", "of", "PAM", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/PAM.java#L167-L246
53,127
EdwardRaff/JSAT
JSAT/src/jsat/math/optimization/stochastic/AdaDelta.java
AdaDelta.setRho
public void setRho(double rho) { if(rho <= 0 || rho >= 1 || Double.isNaN(rho)) throw new IllegalArgumentException("Rho must be in (0, 1)"); this.rho = rho; }
java
public void setRho(double rho) { if(rho <= 0 || rho >= 1 || Double.isNaN(rho)) throw new IllegalArgumentException("Rho must be in (0, 1)"); this.rho = rho; }
[ "public", "void", "setRho", "(", "double", "rho", ")", "{", "if", "(", "rho", "<=", "0", "||", "rho", ">=", "1", "||", "Double", ".", "isNaN", "(", "rho", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Rho must be in (0, 1)\"", ")", ";", ...
Sets the decay rate used by AdaDelta. Lower values focus more on the current gradient, where higher values incorporate a longer history. @param rho the decay rate in (0, 1) to use
[ "Sets", "the", "decay", "rate", "used", "by", "AdaDelta", ".", "Lower", "values", "focus", "more", "on", "the", "current", "gradient", "where", "higher", "values", "incorporate", "a", "longer", "history", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/stochastic/AdaDelta.java#L70-L75
53,128
EdwardRaff/JSAT
JSAT/src/jsat/math/ExponentialMovingStatistics.java
ExponentialMovingStatistics.setSmoothing
public void setSmoothing(double smoothing) { if (smoothing <= 0 || smoothing > 1 || Double.isNaN(smoothing)) throw new IllegalArgumentException("Smoothing must be in (0, 1], not " + smoothing); this.smoothing = smoothing; }
java
public void setSmoothing(double smoothing) { if (smoothing <= 0 || smoothing > 1 || Double.isNaN(smoothing)) throw new IllegalArgumentException("Smoothing must be in (0, 1], not " + smoothing); this.smoothing = smoothing; }
[ "public", "void", "setSmoothing", "(", "double", "smoothing", ")", "{", "if", "(", "smoothing", "<=", "0", "||", "smoothing", ">", "1", "||", "Double", ".", "isNaN", "(", "smoothing", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Smoothing mu...
Sets the smoothing parameter value to use. Must be in the range (0, 1]. Changing this value will impact how quickly the statistics adapt to changes, with larger values increasing rate of change and smaller values decreasing it. @param smoothing the smoothing value to use
[ "Sets", "the", "smoothing", "parameter", "value", "to", "use", ".", "Must", "be", "in", "the", "range", "(", "0", "1", "]", ".", "Changing", "this", "value", "will", "impact", "how", "quickly", "the", "statistics", "adapt", "to", "changes", "with", "larg...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/ExponentialMovingStatistics.java#L86-L91
53,129
EdwardRaff/JSAT
JSAT/src/jsat/math/ExponentialMovingStatistics.java
ExponentialMovingStatistics.add
public void add(double x) { if (Double.isNaN(mean))//fist case { mean = x; variance = 0; } else//general case { //first update stnd deviation variance = (1-smoothing)*(variance + smoothing*Math.pow(x-mean, 2)); mean...
java
public void add(double x) { if (Double.isNaN(mean))//fist case { mean = x; variance = 0; } else//general case { //first update stnd deviation variance = (1-smoothing)*(variance + smoothing*Math.pow(x-mean, 2)); mean...
[ "public", "void", "add", "(", "double", "x", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "mean", ")", ")", "//fist case", "{", "mean", "=", "x", ";", "variance", "=", "0", ";", "}", "else", "//general case", "{", "//first update stnd deviation ", ...
Adds the given data point to the statistics @param x the new value to add to the moving statistics
[ "Adds", "the", "given", "data", "point", "to", "the", "statistics" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/ExponentialMovingStatistics.java#L107-L121
53,130
EdwardRaff/JSAT
JSAT/src/jsat/distributions/discrete/UniformDiscrete.java
UniformDiscrete.setMinMax
public void setMinMax(int min, int max) { if(min >= max) throw new IllegalArgumentException("The input minimum (" + min + ") must be less than the given max (" + max + ")"); this.min = min; this.max = max; }
java
public void setMinMax(int min, int max) { if(min >= max) throw new IllegalArgumentException("The input minimum (" + min + ") must be less than the given max (" + max + ")"); this.min = min; this.max = max; }
[ "public", "void", "setMinMax", "(", "int", "min", ",", "int", "max", ")", "{", "if", "(", "min", ">=", "max", ")", "throw", "new", "IllegalArgumentException", "(", "\"The input minimum (\"", "+", "min", "+", "\") must be less than the given max (\"", "+", "max",...
Sets the minimum and maximum values at the same time, this is useful if setting them one at a time may have caused a conflict with the previous values @param min the new minimum value to occur @param max the new maximum value to occur
[ "Sets", "the", "minimum", "and", "maximum", "values", "at", "the", "same", "time", "this", "is", "useful", "if", "setting", "them", "one", "at", "a", "time", "may", "have", "caused", "a", "conflict", "with", "the", "previous", "values" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/UniformDiscrete.java#L55-L61
53,131
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/NHERD.java
NHERD.setC
public void setC(double C) { if(Double.isNaN(C) || Double.isInfinite(C) || C <= 0) throw new IllegalArgumentException("C must be a postive constant, not " + C); this.C = C; }
java
public void setC(double C) { if(Double.isNaN(C) || Double.isInfinite(C) || C <= 0) throw new IllegalArgumentException("C must be a postive constant, not " + C); this.C = C; }
[ "public", "void", "setC", "(", "double", "C", ")", "{", "if", "(", "Double", ".", "isNaN", "(", "C", ")", "||", "Double", ".", "isInfinite", "(", "C", ")", "||", "C", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"C must be a posti...
Set the aggressiveness parameter. Increasing the value of this parameter increases the aggressiveness of the algorithm. It must be a positive value. This parameter essentially performs a type of regularization on the updates @param C the positive aggressiveness parameter
[ "Set", "the", "aggressiveness", "parameter", ".", "Increasing", "the", "value", "of", "this", "parameter", "increases", "the", "aggressiveness", "of", "the", "algorithm", ".", "It", "must", "be", "a", "positive", "value", ".", "This", "parameter", "essentially",...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/NHERD.java#L130-L135
53,132
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/kernelized/BOGD.java
BOGD.guessRegularization
public static Distribution guessRegularization(DataSet d) { double T2 = d.size(); T2*=T2; return new LogUniform(Math.pow(2, -3)/T2, Math.pow(2, 3)/T2); }
java
public static Distribution guessRegularization(DataSet d) { double T2 = d.size(); T2*=T2; return new LogUniform(Math.pow(2, -3)/T2, Math.pow(2, 3)/T2); }
[ "public", "static", "Distribution", "guessRegularization", "(", "DataSet", "d", ")", "{", "double", "T2", "=", "d", ".", "size", "(", ")", ";", "T2", "*=", "T2", ";", "return", "new", "LogUniform", "(", "Math", ".", "pow", "(", "2", ",", "-", "3", ...
Guesses the distribution to use for the Regularization parameter @param d the dataset to get the guess for @return the guess for the Regularization parameter @see #setRegularization(double)
[ "Guesses", "the", "distribution", "to", "use", "for", "the", "Regularization", "parameter" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/kernelized/BOGD.java#L388-L394
53,133
EdwardRaff/JSAT
JSAT/src/jsat/utils/IndexTable.java
IndexTable.getReverse
public static <T> Comparator<T> getReverse(final Comparator<T> cmp) { return (T o1, T o2) -> -cmp.compare(o1, o2); }
java
public static <T> Comparator<T> getReverse(final Comparator<T> cmp) { return (T o1, T o2) -> -cmp.compare(o1, o2); }
[ "public", "static", "<", "T", ">", "Comparator", "<", "T", ">", "getReverse", "(", "final", "Comparator", "<", "T", ">", "cmp", ")", "{", "return", "(", "T", "o1", ",", "T", "o2", ")", "->", "-", "cmp", ".", "compare", "(", "o1", ",", "o2", ")"...
Obtains the reverse order comparator @param <T> the data type @param cmp the original comparator @return the reverse order comparator
[ "Obtains", "the", "reverse", "order", "comparator" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L38-L41
53,134
EdwardRaff/JSAT
JSAT/src/jsat/utils/IndexTable.java
IndexTable.reset
public void reset() { for(int i = 0; i < index.size(); i++) index.set(i, i); }
java
public void reset() { for(int i = 0; i < index.size(); i++) index.set(i, i); }
[ "public", "void", "reset", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "index", ".", "size", "(", ")", ";", "i", "++", ")", "index", ".", "set", "(", "i", ",", "i", ")", ";", "}" ]
Resets the index table so that the returned indices are in linear order, meaning the original input would be returned in its original order instead of sorted order.
[ "Resets", "the", "index", "table", "so", "that", "the", "returned", "indices", "are", "in", "linear", "order", "meaning", "the", "original", "input", "would", "be", "returned", "in", "its", "original", "order", "instead", "of", "sorted", "order", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L111-L115
53,135
EdwardRaff/JSAT
JSAT/src/jsat/utils/IndexTable.java
IndexTable.sort
public <T extends Comparable<T>> void sort(List<T> list) { sort(list, defaultComp); }
java
public <T extends Comparable<T>> void sort(List<T> list) { sort(list, defaultComp); }
[ "public", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "void", "sort", "(", "List", "<", "T", ">", "list", ")", "{", "sort", "(", "list", ",", "defaultComp", ")", ";", "}" ]
Adjust this index table to contain the sorted index order for the given list @param <T> the data type @param list the list of objects
[ "Adjust", "this", "index", "table", "to", "contain", "the", "sorted", "index", "order", "for", "the", "given", "list" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L151-L154
53,136
EdwardRaff/JSAT
JSAT/src/jsat/utils/IndexTable.java
IndexTable.sortR
public <T extends Comparable<T>> void sortR(List<T> list) { sort(list, getReverse(defaultComp)); }
java
public <T extends Comparable<T>> void sortR(List<T> list) { sort(list, getReverse(defaultComp)); }
[ "public", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "void", "sortR", "(", "List", "<", "T", ">", "list", ")", "{", "sort", "(", "list", ",", "getReverse", "(", "defaultComp", ")", ")", ";", "}" ]
Adjusts this index table to contain the reverse sorted index order for the given list @param <T> the data type @param list the list of objects
[ "Adjusts", "this", "index", "table", "to", "contain", "the", "reverse", "sorted", "index", "order", "for", "the", "given", "list" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L162-L165
53,137
EdwardRaff/JSAT
JSAT/src/jsat/utils/IndexTable.java
IndexTable.sort
public <T> void sort(List<T> list, Comparator<T> cmp) { if(index.size() < list.size()) for(int i = index.size(); i < list.size(); i++ ) index.add(i); if(list.size() == index.size()) Collections.sort(index, new IndexViewCompList(list, cmp)); else ...
java
public <T> void sort(List<T> list, Comparator<T> cmp) { if(index.size() < list.size()) for(int i = index.size(); i < list.size(); i++ ) index.add(i); if(list.size() == index.size()) Collections.sort(index, new IndexViewCompList(list, cmp)); else ...
[ "public", "<", "T", ">", "void", "sort", "(", "List", "<", "T", ">", "list", ",", "Comparator", "<", "T", ">", "cmp", ")", "{", "if", "(", "index", ".", "size", "(", ")", "<", "list", ".", "size", "(", ")", ")", "for", "(", "int", "i", "=",...
Sets up the index table based on the given list of the same size and comparator. @param <T> the type in use @param list the list of points to obtain a sorted IndexTable for @param cmp the comparator to determined the sorted order
[ "Sets", "up", "the", "index", "table", "based", "on", "the", "given", "list", "of", "the", "same", "size", "and", "comparator", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IndexTable.java#L176-L189
53,138
EdwardRaff/JSAT
JSAT/src/jsat/SimpleDataSet.java
SimpleDataSet.asClassificationDataSet
public ClassificationDataSet asClassificationDataSet(int index) { if(index < 0) throw new IllegalArgumentException("Index must be a non-negative value"); else if(getNumCategoricalVars() == 0) throw new IllegalArgumentException("Dataset has no categorical variables, can n...
java
public ClassificationDataSet asClassificationDataSet(int index) { if(index < 0) throw new IllegalArgumentException("Index must be a non-negative value"); else if(getNumCategoricalVars() == 0) throw new IllegalArgumentException("Dataset has no categorical variables, can n...
[ "public", "ClassificationDataSet", "asClassificationDataSet", "(", "int", "index", ")", "{", "if", "(", "index", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Index must be a non-negative value\"", ")", ";", "else", "if", "(", "getNumCategoricalVa...
Converts this dataset into one meant for classification problems. The given categorical feature index is removed from the data and made the target variable for the classification problem. @param index the classification variable index, should be in the range [0, {@link #getNumCategoricalVars() }) @return a new dataset...
[ "Converts", "this", "dataset", "into", "one", "meant", "for", "classification", "problems", ".", "The", "given", "categorical", "feature", "index", "is", "removed", "from", "the", "data", "and", "made", "the", "target", "variable", "for", "the", "classification"...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/SimpleDataSet.java#L88-L97
53,139
EdwardRaff/JSAT
JSAT/src/jsat/SimpleDataSet.java
SimpleDataSet.asRegressionDataSet
public RegressionDataSet asRegressionDataSet(int index) { if(index < 0) throw new IllegalArgumentException("Index must be a non-negative value"); else if(getNumNumericalVars()== 0) throw new IllegalArgumentException("Dataset has no numeric variables, can not create regre...
java
public RegressionDataSet asRegressionDataSet(int index) { if(index < 0) throw new IllegalArgumentException("Index must be a non-negative value"); else if(getNumNumericalVars()== 0) throw new IllegalArgumentException("Dataset has no numeric variables, can not create regre...
[ "public", "RegressionDataSet", "asRegressionDataSet", "(", "int", "index", ")", "{", "if", "(", "index", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Index must be a non-negative value\"", ")", ";", "else", "if", "(", "getNumNumericalVars", "("...
Converts this dataset into one meant for regression problems. The given numeric feature index is removed from the data and made the target variable for the regression problem. @param index the regression variable index, should be in the range [0, {@link #getNumNumericalVars() }) @return a new dataset where one numeric...
[ "Converts", "this", "dataset", "into", "one", "meant", "for", "regression", "problems", ".", "The", "given", "numeric", "feature", "index", "is", "removed", "from", "the", "data", "and", "made", "the", "target", "variable", "for", "the", "regression", "problem...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/SimpleDataSet.java#L109-L122
53,140
EdwardRaff/JSAT
JSAT/src/jsat/math/optimization/NelderMead.java
NelderMead.setReflection
public void setReflection(double reflection) { if(reflection <=0 || Double.isNaN(reflection) || Double.isInfinite(reflection) ) throw new ArithmeticException("Reflection constant must be > 0, not " + reflection); this.reflection = reflection; }
java
public void setReflection(double reflection) { if(reflection <=0 || Double.isNaN(reflection) || Double.isInfinite(reflection) ) throw new ArithmeticException("Reflection constant must be > 0, not " + reflection); this.reflection = reflection; }
[ "public", "void", "setReflection", "(", "double", "reflection", ")", "{", "if", "(", "reflection", "<=", "0", "||", "Double", ".", "isNaN", "(", "reflection", ")", "||", "Double", ".", "isInfinite", "(", "reflection", ")", ")", "throw", "new", "ArithmeticE...
Sets the reflection constant, which must be greater than 0 @param reflection the reflection constant
[ "Sets", "the", "reflection", "constant", "which", "must", "be", "greater", "than", "0" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/NelderMead.java#L61-L66
53,141
EdwardRaff/JSAT
JSAT/src/jsat/math/optimization/NelderMead.java
NelderMead.setExpansion
public void setExpansion(double expansion) { if(expansion <= 1 || Double.isNaN(expansion) || Double.isInfinite(expansion) ) throw new ArithmeticException("Expansion constant must be > 1, not " + expansion); else if(expansion <= reflection) throw new ArithmeticException("Expa...
java
public void setExpansion(double expansion) { if(expansion <= 1 || Double.isNaN(expansion) || Double.isInfinite(expansion) ) throw new ArithmeticException("Expansion constant must be > 1, not " + expansion); else if(expansion <= reflection) throw new ArithmeticException("Expa...
[ "public", "void", "setExpansion", "(", "double", "expansion", ")", "{", "if", "(", "expansion", "<=", "1", "||", "Double", ".", "isNaN", "(", "expansion", ")", "||", "Double", ".", "isInfinite", "(", "expansion", ")", ")", "throw", "new", "ArithmeticExcept...
Sets the expansion constant, which must be greater than 1 and the reflection constant @param expansion
[ "Sets", "the", "expansion", "constant", "which", "must", "be", "greater", "than", "1", "and", "the", "reflection", "constant" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/NelderMead.java#L72-L79
53,142
EdwardRaff/JSAT
JSAT/src/jsat/linear/Matrix.java
Matrix.transpose
public Matrix transpose() { Matrix toReturn = new DenseMatrix(cols(), rows()); this.transpose(toReturn); return toReturn; }
java
public Matrix transpose() { Matrix toReturn = new DenseMatrix(cols(), rows()); this.transpose(toReturn); return toReturn; }
[ "public", "Matrix", "transpose", "(", ")", "{", "Matrix", "toReturn", "=", "new", "DenseMatrix", "(", "cols", "(", ")", ",", "rows", "(", ")", ")", ";", "this", ".", "transpose", "(", "toReturn", ")", ";", "return", "toReturn", ";", "}" ]
Returns a new matrix that is the transpose of this matrix. @return a new matrix <tt>A</tt>'
[ "Returns", "a", "new", "matrix", "that", "is", "the", "transpose", "of", "this", "matrix", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L440-L445
53,143
EdwardRaff/JSAT
JSAT/src/jsat/linear/Matrix.java
Matrix.copyTo
public void copyTo(Matrix other) { if (this.rows() != other.rows() || this.cols() != other.cols()) throw new ArithmeticException("Matrices are not of the same dimension"); for(int i = 0; i < rows(); i++) this.getRowView(i).copyTo(other.getRowView(i)); }
java
public void copyTo(Matrix other) { if (this.rows() != other.rows() || this.cols() != other.cols()) throw new ArithmeticException("Matrices are not of the same dimension"); for(int i = 0; i < rows(); i++) this.getRowView(i).copyTo(other.getRowView(i)); }
[ "public", "void", "copyTo", "(", "Matrix", "other", ")", "{", "if", "(", "this", ".", "rows", "(", ")", "!=", "other", ".", "rows", "(", ")", "||", "this", ".", "cols", "(", ")", "!=", "other", ".", "cols", "(", ")", ")", "throw", "new", "Arith...
Copes the values of this matrix into the other matrix of the same dimensions @param other the matrix to overwrite the values of
[ "Copes", "the", "values", "of", "this", "matrix", "into", "the", "other", "matrix", "of", "the", "same", "dimensions" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L849-L855
53,144
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java
SupportVectorLearner.accessingRow
protected void accessingRow(int r) { if (r < 0) { specific_row_cache_row = -1; specific_row_cache_values = null; return; } if(cacheMode == CacheMode.ROWS) { double[] cache = partialCache.get(r); if (cache ==...
java
protected void accessingRow(int r) { if (r < 0) { specific_row_cache_row = -1; specific_row_cache_values = null; return; } if(cacheMode == CacheMode.ROWS) { double[] cache = partialCache.get(r); if (cache ==...
[ "protected", "void", "accessingRow", "(", "int", "r", ")", "{", "if", "(", "r", "<", "0", ")", "{", "specific_row_cache_row", "=", "-", "1", ";", "specific_row_cache_values", "=", "null", ";", "return", ";", "}", "if", "(", "cacheMode", "==", "CacheMode"...
This method allows the caller to hint that they are about to access many kernel values for a specific row. The row may be selected out from the cache into its own location to avoid excess LRU overhead. Giving a negative index indicates that we are done with the row, and removes it. This method may be called multiple ti...
[ "This", "method", "allows", "the", "caller", "to", "hint", "that", "they", "are", "about", "to", "access", "many", "kernel", "values", "for", "a", "specific", "row", ".", "The", "row", "may", "be", "selected", "out", "from", "the", "cache", "into", "its"...
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java#L409-L434
53,145
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java
SupportVectorLearner.k
protected double k(int a, int b) { evalCount++; return kernel.eval(a, b, vecs, accelCache); }
java
protected double k(int a, int b) { evalCount++; return kernel.eval(a, b, vecs, accelCache); }
[ "protected", "double", "k", "(", "int", "a", ",", "int", "b", ")", "{", "evalCount", "++", ";", "return", "kernel", ".", "eval", "(", "a", ",", "b", ",", "vecs", ",", "accelCache", ")", ";", "}" ]
Internal kernel eval source. Only call directly if you KNOW you will not be re-using the resulting value and intentionally wish to skip the caching system @param a the first vector index @param b the second vector index @return the kernel evaluation of k(a, b)
[ "Internal", "kernel", "eval", "source", ".", "Only", "call", "directly", "if", "you", "KNOW", "you", "will", "not", "be", "re", "-", "using", "the", "resulting", "value", "and", "intentionally", "wish", "to", "skip", "the", "caching", "system" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java#L445-L449
53,146
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java
SupportVectorLearner.sparsify
protected void sparsify() { final int N = vecs.size(); int accSize = accelCache == null ? 0 : accelCache.size()/N; int svCount = 0; for(int i = 0; i < N; i++) if(alphas[i] != 0)//Its a support vector { ListUtils.swap(vecs, svCount, i); ...
java
protected void sparsify() { final int N = vecs.size(); int accSize = accelCache == null ? 0 : accelCache.size()/N; int svCount = 0; for(int i = 0; i < N; i++) if(alphas[i] != 0)//Its a support vector { ListUtils.swap(vecs, svCount, i); ...
[ "protected", "void", "sparsify", "(", ")", "{", "final", "int", "N", "=", "vecs", ".", "size", "(", ")", ";", "int", "accSize", "=", "accelCache", "==", "null", "?", "0", ":", "accelCache", ".", "size", "(", ")", "/", "N", ";", "int", "svCount", ...
Sparsifies the SVM by removing the vectors with &alpha; = 0 from the dataset.
[ "Sparsifies", "the", "SVM", "by", "removing", "the", "vectors", "with", "&alpha", ";", "=", "0", "from", "the", "dataset", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/SupportVectorLearner.java#L455-L472
53,147
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/linear/SDCA.java
SDCA.setLambda
@Parameter.WarmParameter(prefLowToHigh = false) public void setLambda(double lambda) { if(lambda <= 0 || Double.isInfinite(lambda) || Double.isNaN(lambda)) throw new IllegalArgumentException("Regularization term lambda must be a positive value, not " + lambda); this.lambda = lambda; ...
java
@Parameter.WarmParameter(prefLowToHigh = false) public void setLambda(double lambda) { if(lambda <= 0 || Double.isInfinite(lambda) || Double.isNaN(lambda)) throw new IllegalArgumentException("Regularization term lambda must be a positive value, not " + lambda); this.lambda = lambda; ...
[ "@", "Parameter", ".", "WarmParameter", "(", "prefLowToHigh", "=", "false", ")", "public", "void", "setLambda", "(", "double", "lambda", ")", "{", "if", "(", "lambda", "<=", "0", "||", "Double", ".", "isInfinite", "(", "lambda", ")", "||", "Double", ".",...
Sets the regularization term, where larger values indicate a larger regularization penalty. @param lambda the positive regularization term
[ "Sets", "the", "regularization", "term", "where", "larger", "values", "indicate", "a", "larger", "regularization", "penalty", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/SDCA.java#L172-L178
53,148
EdwardRaff/JSAT
JSAT/src/jsat/regression/RegressionDataSet.java
RegressionDataSet.addDataPoint
public void addDataPoint(Vec numerical, int[] categories, double val) { if(numerical.length() != numNumerVals) throw new RuntimeException("Data point does not contain enough numerical data points"); if(categories.length != categories.length) throw new RuntimeException("D...
java
public void addDataPoint(Vec numerical, int[] categories, double val) { if(numerical.length() != numNumerVals) throw new RuntimeException("Data point does not contain enough numerical data points"); if(categories.length != categories.length) throw new RuntimeException("D...
[ "public", "void", "addDataPoint", "(", "Vec", "numerical", ",", "int", "[", "]", "categories", ",", "double", "val", ")", "{", "if", "(", "numerical", ".", "length", "(", ")", "!=", "numNumerVals", ")", "throw", "new", "RuntimeException", "(", "\"Data poin...
Creates a new data point to be added to the data set. The arguments will be used directly, modifying them after will effect the data set. @param numerical the numerical values for the data point @param categories the categorical values for the data point @param val the target value to predict @throws IllegalArgumentEx...
[ "Creates", "a", "new", "data", "point", "to", "be", "added", "to", "the", "data", "set", ".", "The", "arguments", "will", "be", "used", "directly", "modifying", "them", "after", "will", "effect", "the", "data", "set", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/regression/RegressionDataSet.java#L164-L177
53,149
EdwardRaff/JSAT
JSAT/src/jsat/regression/RegressionDataSet.java
RegressionDataSet.getDataPointPair
public DataPointPair<Double> getDataPointPair(int i) { return new DataPointPair<>(getDataPoint(i), targets.get(i)); }
java
public DataPointPair<Double> getDataPointPair(int i) { return new DataPointPair<>(getDataPoint(i), targets.get(i)); }
[ "public", "DataPointPair", "<", "Double", ">", "getDataPointPair", "(", "int", "i", ")", "{", "return", "new", "DataPointPair", "<>", "(", "getDataPoint", "(", "i", ")", ",", "targets", ".", "get", "(", "i", ")", ")", ";", "}" ]
Returns the i'th data point in the data set paired with its target regressor value. Modifying the DataPointPair will effect the data set. @param i the index of the data point to obtain @return the i'th DataPOintPair
[ "Returns", "the", "i", "th", "data", "point", "in", "the", "data", "set", "paired", "with", "its", "target", "regressor", "value", ".", "Modifying", "the", "DataPointPair", "will", "effect", "the", "data", "set", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/regression/RegressionDataSet.java#L219-L222
53,150
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/RemoveAttributeTransform.java
RemoveAttributeTransform.getReverseNumericMap
public Map<Integer, Integer> getReverseNumericMap() { Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for(int newIndex = 0; newIndex < numIndexMap.length; newIndex++) map.put(newIndex, numIndexMap[newIndex]); return map; }
java
public Map<Integer, Integer> getReverseNumericMap() { Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for(int newIndex = 0; newIndex < numIndexMap.length; newIndex++) map.put(newIndex, numIndexMap[newIndex]); return map; }
[ "public", "Map", "<", "Integer", ",", "Integer", ">", "getReverseNumericMap", "(", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "map", "=", "new", "HashMap", "<", "Integer", ",", "Integer", ">", "(", ")", ";", "for", "(", "int", "newIndex", ...
Returns a mapping from the numeric indices in the transformed space back to their original indices @return a mapping from the transformed numeric space to the original one
[ "Returns", "a", "mapping", "from", "the", "numeric", "indices", "in", "the", "transformed", "space", "back", "to", "their", "original", "indices" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/RemoveAttributeTransform.java#L91-L97
53,151
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/RemoveAttributeTransform.java
RemoveAttributeTransform.getReverseNominalMap
public Map<Integer, Integer> getReverseNominalMap() { Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for(int newIndex = 0; newIndex < catIndexMap.length; newIndex++) map.put(newIndex, catIndexMap[newIndex]); return map; }
java
public Map<Integer, Integer> getReverseNominalMap() { Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for(int newIndex = 0; newIndex < catIndexMap.length; newIndex++) map.put(newIndex, catIndexMap[newIndex]); return map; }
[ "public", "Map", "<", "Integer", ",", "Integer", ">", "getReverseNominalMap", "(", ")", "{", "Map", "<", "Integer", ",", "Integer", ">", "map", "=", "new", "HashMap", "<", "Integer", ",", "Integer", ">", "(", ")", ";", "for", "(", "int", "newIndex", ...
Returns a mapping from the nominal indices in the transformed space back to their original indices @return a mapping from the transformed nominal space to the original one
[ "Returns", "a", "mapping", "from", "the", "nominal", "indices", "in", "the", "transformed", "space", "back", "to", "their", "original", "indices" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/RemoveAttributeTransform.java#L115-L121
53,152
EdwardRaff/JSAT
JSAT/src/jsat/datatransform/RemoveAttributeTransform.java
RemoveAttributeTransform.setUp
protected final void setUp(DataSet dataSet, Set<Integer> categoricalToRemove, Set<Integer> numericalToRemove) { for(int i : categoricalToRemove) if (i >= dataSet.getNumCategoricalVars()) throw new RuntimeException("The data set does not have a categorical value " + i + " to remov...
java
protected final void setUp(DataSet dataSet, Set<Integer> categoricalToRemove, Set<Integer> numericalToRemove) { for(int i : categoricalToRemove) if (i >= dataSet.getNumCategoricalVars()) throw new RuntimeException("The data set does not have a categorical value " + i + " to remov...
[ "protected", "final", "void", "setUp", "(", "DataSet", "dataSet", ",", "Set", "<", "Integer", ">", "categoricalToRemove", ",", "Set", "<", "Integer", ">", "numericalToRemove", ")", "{", "for", "(", "int", "i", ":", "categoricalToRemove", ")", "if", "(", "i...
Sets up the Remove Attribute Transform properly @param dataSet the data set to remove the attributes from @param categoricalToRemove the categorical attributes to remove @param numericalToRemove the numeric attributes to remove
[ "Sets", "up", "the", "Remove", "Attribute", "Transform", "properly" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/datatransform/RemoveAttributeTransform.java#L137-L164
53,153
EdwardRaff/JSAT
JSAT/src/jsat/distributions/kernels/RBFKernel.java
RBFKernel.setSigma
public void setSigma(double sigma) { if(sigma <= 0) throw new IllegalArgumentException("Sigma must be a positive constant, not " + sigma); this.sigma = sigma; this.sigmaSqrd2Inv = 0.5/(sigma*sigma); }
java
public void setSigma(double sigma) { if(sigma <= 0) throw new IllegalArgumentException("Sigma must be a positive constant, not " + sigma); this.sigma = sigma; this.sigmaSqrd2Inv = 0.5/(sigma*sigma); }
[ "public", "void", "setSigma", "(", "double", "sigma", ")", "{", "if", "(", "sigma", "<=", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Sigma must be a positive constant, not \"", "+", "sigma", ")", ";", "this", ".", "sigma", "=", "sigma", ";",...
Sets the sigma parameter, which must be a positive value @param sigma the sigma value
[ "Sets", "the", "sigma", "parameter", "which", "must", "be", "a", "positive", "value" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/RBFKernel.java#L79-L85
53,154
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/boosting/WaggingNormal.java
WaggingNormal.setMean
public void setMean(double mean) { if(Double.isInfinite(mean) || Double.isNaN(mean)) throw new ArithmeticException("Mean must be a real number, not " + mean); ((Normal)getDistribution()).setMean(mean); }
java
public void setMean(double mean) { if(Double.isInfinite(mean) || Double.isNaN(mean)) throw new ArithmeticException("Mean must be a real number, not " + mean); ((Normal)getDistribution()).setMean(mean); }
[ "public", "void", "setMean", "(", "double", "mean", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "mean", ")", "||", "Double", ".", "isNaN", "(", "mean", ")", ")", "throw", "new", "ArithmeticException", "(", "\"Mean must be a real number, not \"", "...
Sets the mean value used for the normal distribution @param mean the new mean value
[ "Sets", "the", "mean", "value", "used", "for", "the", "normal", "distribution" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/boosting/WaggingNormal.java#L66-L71
53,155
EdwardRaff/JSAT
JSAT/src/jsat/classifiers/boosting/WaggingNormal.java
WaggingNormal.setStandardDeviations
public void setStandardDeviations(double devs) { if(devs <= 0 || Double.isInfinite(devs) || Double.isNaN(devs)) throw new ArithmeticException("The stnd devs must be a positive value"); ((Normal)getDistribution()).setStndDev(devs); }
java
public void setStandardDeviations(double devs) { if(devs <= 0 || Double.isInfinite(devs) || Double.isNaN(devs)) throw new ArithmeticException("The stnd devs must be a positive value"); ((Normal)getDistribution()).setStndDev(devs); }
[ "public", "void", "setStandardDeviations", "(", "double", "devs", ")", "{", "if", "(", "devs", "<=", "0", "||", "Double", ".", "isInfinite", "(", "devs", ")", "||", "Double", ".", "isNaN", "(", "devs", ")", ")", "throw", "new", "ArithmeticException", "("...
Sets the standard deviations used for the normal distribution @param devs the standard deviations to set
[ "Sets", "the", "standard", "deviations", "used", "for", "the", "normal", "distribution" ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/boosting/WaggingNormal.java#L86-L91
53,156
JodaOrg/joda-money
src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java
DefaultCurrencyUnitDataProvider.registerCurrencies
@Override protected void registerCurrencies() throws Exception { parseCurrencies(loadFromFile("/org/joda/money/CurrencyData.csv")); parseCountries(loadFromFile("/org/joda/money/CountryData.csv")); parseCurrencies(loadFromFiles("META-INF/org/joda/money/CurrencyDataExtension.csv")); ...
java
@Override protected void registerCurrencies() throws Exception { parseCurrencies(loadFromFile("/org/joda/money/CurrencyData.csv")); parseCountries(loadFromFile("/org/joda/money/CountryData.csv")); parseCurrencies(loadFromFiles("META-INF/org/joda/money/CurrencyDataExtension.csv")); ...
[ "@", "Override", "protected", "void", "registerCurrencies", "(", ")", "throws", "Exception", "{", "parseCurrencies", "(", "loadFromFile", "(", "\"/org/joda/money/CurrencyData.csv\"", ")", ")", ";", "parseCountries", "(", "loadFromFile", "(", "\"/org/joda/money/CountryData...
Registers all the currencies known by this provider. @throws Exception if an error occurs
[ "Registers", "all", "the", "currencies", "known", "by", "this", "provider", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java#L54-L60
53,157
JodaOrg/joda-money
src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java
DefaultCurrencyUnitDataProvider.parseCurrencies
private void parseCurrencies(List<String> content) throws Exception { for (String line : content) { Matcher matcher = CURRENCY_REGEX_LINE.matcher(line); if (matcher.matches()) { String currencyCode = matcher.group(1); int numericCode = Integer.parseIn...
java
private void parseCurrencies(List<String> content) throws Exception { for (String line : content) { Matcher matcher = CURRENCY_REGEX_LINE.matcher(line); if (matcher.matches()) { String currencyCode = matcher.group(1); int numericCode = Integer.parseIn...
[ "private", "void", "parseCurrencies", "(", "List", "<", "String", ">", "content", ")", "throws", "Exception", "{", "for", "(", "String", "line", ":", "content", ")", "{", "Matcher", "matcher", "=", "CURRENCY_REGEX_LINE", ".", "matcher", "(", "line", ")", "...
parse the currencies
[ "parse", "the", "currencies" ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java#L96-L106
53,158
JodaOrg/joda-money
src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java
DefaultCurrencyUnitDataProvider.parseCountries
private void parseCountries(List<String> content) throws Exception { for (String line : content) { Matcher matcher = COUNTRY_REGEX_LINE.matcher(line); if (matcher.matches()) { String countryCode = matcher.group(1); String currencyCode = matcher.group(...
java
private void parseCountries(List<String> content) throws Exception { for (String line : content) { Matcher matcher = COUNTRY_REGEX_LINE.matcher(line); if (matcher.matches()) { String countryCode = matcher.group(1); String currencyCode = matcher.group(...
[ "private", "void", "parseCountries", "(", "List", "<", "String", ">", "content", ")", "throws", "Exception", "{", "for", "(", "String", "line", ":", "content", ")", "{", "Matcher", "matcher", "=", "COUNTRY_REGEX_LINE", ".", "matcher", "(", "line", ")", ";"...
parse the countries
[ "parse", "the", "countries" ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/DefaultCurrencyUnitDataProvider.java#L109-L118
53,159
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyAmountStyle.java
MoneyAmountStyle.withGroupingSize
public MoneyAmountStyle withGroupingSize(Integer groupingSize) { int sizeVal = (groupingSize == null ? -1 : groupingSize); if (groupingSize != null && sizeVal <= 0) { throw new IllegalArgumentException("Grouping size must be greater than zero"); } if (sizeVal == this.gro...
java
public MoneyAmountStyle withGroupingSize(Integer groupingSize) { int sizeVal = (groupingSize == null ? -1 : groupingSize); if (groupingSize != null && sizeVal <= 0) { throw new IllegalArgumentException("Grouping size must be greater than zero"); } if (sizeVal == this.gro...
[ "public", "MoneyAmountStyle", "withGroupingSize", "(", "Integer", "groupingSize", ")", "{", "int", "sizeVal", "=", "(", "groupingSize", "==", "null", "?", "-", "1", ":", "groupingSize", ")", ";", "if", "(", "groupingSize", "!=", "null", "&&", "sizeVal", "<="...
Returns a copy of this style with the specified grouping size. @param groupingSize the size of each group, such as 3 for thousands, not zero or negative, null if to be determined by locale @return the new instance for chaining, never null @throws IllegalArgumentException if the grouping size is zero or less
[ "Returns", "a", "copy", "of", "this", "style", "with", "the", "specified", "grouping", "size", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyAmountStyle.java#L469-L482
53,160
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyAmountStyle.java
MoneyAmountStyle.withExtendedGroupingSize
public MoneyAmountStyle withExtendedGroupingSize(Integer extendedGroupingSize) { int sizeVal = (extendedGroupingSize == null ? -1 : extendedGroupingSize); if (extendedGroupingSize != null && sizeVal < 0) { throw new IllegalArgumentException("Extended grouping size must not be negative"); ...
java
public MoneyAmountStyle withExtendedGroupingSize(Integer extendedGroupingSize) { int sizeVal = (extendedGroupingSize == null ? -1 : extendedGroupingSize); if (extendedGroupingSize != null && sizeVal < 0) { throw new IllegalArgumentException("Extended grouping size must not be negative"); ...
[ "public", "MoneyAmountStyle", "withExtendedGroupingSize", "(", "Integer", "extendedGroupingSize", ")", "{", "int", "sizeVal", "=", "(", "extendedGroupingSize", "==", "null", "?", "-", "1", ":", "extendedGroupingSize", ")", ";", "if", "(", "extendedGroupingSize", "!=...
Returns a copy of this style with the specified extended grouping size. @param extendedGroupingSize the size of each group, such as 3 for thousands, not zero or negative, null if to be determined by locale @return the new instance for chaining, never null @throws IllegalArgumentException if the grouping size is zero ...
[ "Returns", "a", "copy", "of", "this", "style", "with", "the", "specified", "extended", "grouping", "size", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyAmountStyle.java#L507-L520
53,161
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyAmountStyle.java
MoneyAmountStyle.withGroupingStyle
public MoneyAmountStyle withGroupingStyle(GroupingStyle groupingStyle) { MoneyFormatter.checkNotNull(groupingStyle, "groupingStyle"); if (this.groupingStyle == groupingStyle) { return this; } return new MoneyAmountStyle( zeroCharacter, p...
java
public MoneyAmountStyle withGroupingStyle(GroupingStyle groupingStyle) { MoneyFormatter.checkNotNull(groupingStyle, "groupingStyle"); if (this.groupingStyle == groupingStyle) { return this; } return new MoneyAmountStyle( zeroCharacter, p...
[ "public", "MoneyAmountStyle", "withGroupingStyle", "(", "GroupingStyle", "groupingStyle", ")", "{", "MoneyFormatter", ".", "checkNotNull", "(", "groupingStyle", ",", "\"groupingStyle\"", ")", ";", "if", "(", "this", ".", "groupingStyle", "==", "groupingStyle", ")", ...
Returns a copy of this style with the specified grouping setting. @param groupingStyle the grouping style, not null @return the new instance for chaining, never null
[ "Returns", "a", "copy", "of", "this", "style", "with", "the", "specified", "grouping", "setting", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyAmountStyle.java#L538-L548
53,162
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyAmountStyle.java
MoneyAmountStyle.withForcedDecimalPoint
public MoneyAmountStyle withForcedDecimalPoint(boolean forceDecimalPoint) { if (this.forceDecimalPoint == forceDecimalPoint) { return this; } return new MoneyAmountStyle( zeroCharacter, positiveCharacter, negativeCharacter, decim...
java
public MoneyAmountStyle withForcedDecimalPoint(boolean forceDecimalPoint) { if (this.forceDecimalPoint == forceDecimalPoint) { return this; } return new MoneyAmountStyle( zeroCharacter, positiveCharacter, negativeCharacter, decim...
[ "public", "MoneyAmountStyle", "withForcedDecimalPoint", "(", "boolean", "forceDecimalPoint", ")", "{", "if", "(", "this", ".", "forceDecimalPoint", "==", "forceDecimalPoint", ")", "{", "return", "this", ";", "}", "return", "new", "MoneyAmountStyle", "(", "zeroCharac...
Returns a copy of this style with the specified decimal point setting. @param forceDecimalPoint true to force the use of the decimal point, false to use it if required @return the new instance for chaining, never null
[ "Returns", "a", "copy", "of", "this", "style", "with", "the", "specified", "decimal", "point", "setting", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyAmountStyle.java#L566-L575
53,163
JodaOrg/joda-money
src/main/java/org/joda/money/BigMoney.java
BigMoney.checkCurrencyEqual
private BigMoney checkCurrencyEqual(BigMoneyProvider moneyProvider) { BigMoney money = of(moneyProvider); if (isSameCurrency(money) == false) { throw new CurrencyMismatchException(getCurrencyUnit(), money.getCurrencyUnit()); } return money; }
java
private BigMoney checkCurrencyEqual(BigMoneyProvider moneyProvider) { BigMoney money = of(moneyProvider); if (isSameCurrency(money) == false) { throw new CurrencyMismatchException(getCurrencyUnit(), money.getCurrencyUnit()); } return money; }
[ "private", "BigMoney", "checkCurrencyEqual", "(", "BigMoneyProvider", "moneyProvider", ")", "{", "BigMoney", "money", "=", "of", "(", "moneyProvider", ")", ";", "if", "(", "isSameCurrency", "(", "money", ")", "==", "false", ")", "{", "throw", "new", "CurrencyM...
Validates that the currency of this money and the specified money match. @param moneyProvider the money to check, not null @throws CurrencyMismatchException if the currencies differ
[ "Validates", "that", "the", "currency", "of", "this", "money", "and", "the", "specified", "money", "match", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L803-L809
53,164
JodaOrg/joda-money
src/main/java/org/joda/money/BigMoney.java
BigMoney.compareTo
@Override public int compareTo(BigMoneyProvider other) { BigMoney otherMoney = of(other); if (currency.equals(otherMoney.currency) == false) { throw new CurrencyMismatchException(getCurrencyUnit(), otherMoney.getCurrencyUnit()); } return amount.compareTo(otherMoney....
java
@Override public int compareTo(BigMoneyProvider other) { BigMoney otherMoney = of(other); if (currency.equals(otherMoney.currency) == false) { throw new CurrencyMismatchException(getCurrencyUnit(), otherMoney.getCurrencyUnit()); } return amount.compareTo(otherMoney....
[ "@", "Override", "public", "int", "compareTo", "(", "BigMoneyProvider", "other", ")", "{", "BigMoney", "otherMoney", "=", "of", "(", "other", ")", ";", "if", "(", "currency", ".", "equals", "(", "otherMoney", ".", "currency", ")", "==", "false", ")", "{"...
Compares this monetary value to another. The compared values must be in the same currency. @param other the other monetary value, not null @return -1 if this is less than , 0 if equal, 1 if greater than @throws CurrencyMismatchException if the currencies differ
[ "Compares", "this", "monetary", "value", "to", "another", ".", "The", "compared", "values", "must", "be", "in", "the", "same", "currency", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1603-L1610
53,165
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyParseContext.java
MoneyParseContext.mergeChild
void mergeChild(MoneyParseContext child) { setLocale(child.getLocale()); setText(child.getText()); setIndex(child.getIndex()); setErrorIndex(child.getErrorIndex()); setCurrency(child.getCurrency()); setAmount(child.getAmount()); }
java
void mergeChild(MoneyParseContext child) { setLocale(child.getLocale()); setText(child.getText()); setIndex(child.getIndex()); setErrorIndex(child.getErrorIndex()); setCurrency(child.getCurrency()); setAmount(child.getAmount()); }
[ "void", "mergeChild", "(", "MoneyParseContext", "child", ")", "{", "setLocale", "(", "child", ".", "getLocale", "(", ")", ")", ";", "setText", "(", "child", ".", "getText", "(", ")", ")", ";", "setIndex", "(", "child", ".", "getIndex", "(", ")", ")", ...
Merges the child context back into this instance. @param child the child context, not null
[ "Merges", "the", "child", "context", "back", "into", "this", "instance", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyParseContext.java#L276-L283
53,166
JodaOrg/joda-money
src/main/java/org/joda/money/format/MoneyParseContext.java
MoneyParseContext.toParsePosition
public ParsePosition toParsePosition() { ParsePosition pp = new ParsePosition(textIndex); pp.setErrorIndex(textErrorIndex); return pp; }
java
public ParsePosition toParsePosition() { ParsePosition pp = new ParsePosition(textIndex); pp.setErrorIndex(textErrorIndex); return pp; }
[ "public", "ParsePosition", "toParsePosition", "(", ")", "{", "ParsePosition", "pp", "=", "new", "ParsePosition", "(", "textIndex", ")", ";", "pp", ".", "setErrorIndex", "(", "textErrorIndex", ")", ";", "return", "pp", ";", "}" ]
Converts the indexes to a parse position. @return the parse position, never null
[ "Converts", "the", "indexes", "to", "a", "parse", "position", "." ]
e1f2de75aa36610a695358696c8a88a18ca66cde
https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyParseContext.java#L291-L295
53,167
cache2k/cache2k
cache2k-jcache/src/main/java/org/cache2k/jcache/provider/JCacheAdapter.java
JCacheAdapter.iterator
@Override public Iterator<Entry<K,V>> iterator() { checkClosed(); final Iterator<K> _keyIterator = cache.keys().iterator(); return new Iterator<Entry<K, V>>() { CacheEntry<K, V> entry; @Override public boolean hasNext() { while(_keyIterator.hasNext()) { entry = cache....
java
@Override public Iterator<Entry<K,V>> iterator() { checkClosed(); final Iterator<K> _keyIterator = cache.keys().iterator(); return new Iterator<Entry<K, V>>() { CacheEntry<K, V> entry; @Override public boolean hasNext() { while(_keyIterator.hasNext()) { entry = cache....
[ "@", "Override", "public", "Iterator", "<", "Entry", "<", "K", ",", "V", ">", ">", "iterator", "(", ")", "{", "checkClosed", "(", ")", ";", "final", "Iterator", "<", "K", ">", "_keyIterator", "=", "cache", ".", "keys", "(", ")", ".", "iterator", "(...
Iterate with the help of cache2k key iterator.
[ "Iterate", "with", "the", "help", "of", "cache2k", "key", "iterator", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-jcache/src/main/java/org/cache2k/jcache/provider/JCacheAdapter.java#L451-L506
53,168
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/CacheManager.java
CacheManager.getInstance
public static CacheManager getInstance() { ClassLoader _defaultClassLoader = PROVIDER.getDefaultClassLoader(); return PROVIDER.getManager(_defaultClassLoader, PROVIDER.getDefaultManagerName(_defaultClassLoader)); }
java
public static CacheManager getInstance() { ClassLoader _defaultClassLoader = PROVIDER.getDefaultClassLoader(); return PROVIDER.getManager(_defaultClassLoader, PROVIDER.getDefaultManagerName(_defaultClassLoader)); }
[ "public", "static", "CacheManager", "getInstance", "(", ")", "{", "ClassLoader", "_defaultClassLoader", "=", "PROVIDER", ".", "getDefaultClassLoader", "(", ")", ";", "return", "PROVIDER", ".", "getManager", "(", "_defaultClassLoader", ",", "PROVIDER", ".", "getDefau...
Get the default cache manager for the default class loader. The default class loader is the class loader used to load the cache2k implementation classes. <p>The name of default cache manager is {@code "default"}. This may be changed, by {@link #setDefaultName(String)}.
[ "Get", "the", "default", "cache", "manager", "for", "the", "default", "class", "loader", ".", "The", "default", "class", "loader", "is", "the", "class", "loader", "used", "to", "load", "the", "cache2k", "implementation", "classes", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/CacheManager.java#L87-L90
53,169
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/CacheManager.java
CacheManager.getInstance
public static CacheManager getInstance(ClassLoader cl) { return PROVIDER.getManager(cl, PROVIDER.getDefaultManagerName(cl)); }
java
public static CacheManager getInstance(ClassLoader cl) { return PROVIDER.getManager(cl, PROVIDER.getDefaultManagerName(cl)); }
[ "public", "static", "CacheManager", "getInstance", "(", "ClassLoader", "cl", ")", "{", "return", "PROVIDER", ".", "getManager", "(", "cl", ",", "PROVIDER", ".", "getDefaultManagerName", "(", "cl", ")", ")", ";", "}" ]
Get the default cache manager for the specified class loader.
[ "Get", "the", "default", "cache", "manager", "for", "the", "specified", "class", "loader", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/CacheManager.java#L95-L97
53,170
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/CacheManager.java
CacheManager.getInstance
public static CacheManager getInstance(ClassLoader cl, String managerName) { return PROVIDER.getManager(cl, managerName); }
java
public static CacheManager getInstance(ClassLoader cl, String managerName) { return PROVIDER.getManager(cl, managerName); }
[ "public", "static", "CacheManager", "getInstance", "(", "ClassLoader", "cl", ",", "String", "managerName", ")", "{", "return", "PROVIDER", ".", "getManager", "(", "cl", ",", "managerName", ")", ";", "}" ]
Retrieve a cache manager with the specified name using the specified classloader. If not existing, a manager with that name is created. Different cache managers are created for different class loaders. Manager names should be unique within one VM instance. <p>The allowed characters in a manager name are identical to t...
[ "Retrieve", "a", "cache", "manager", "with", "the", "specified", "name", "using", "the", "specified", "classloader", ".", "If", "not", "existing", "a", "manager", "with", "that", "name", "is", "created", ".", "Different", "cache", "managers", "are", "created",...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/CacheManager.java#L123-L125
53,171
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.of
public static <K,T> Cache2kBuilder<K,T> of(Class<K> _keyType, Class<T> _valueType) { return new Cache2kBuilder<K, T>(CacheTypeCapture.of(_keyType), CacheTypeCapture.of(_valueType)); }
java
public static <K,T> Cache2kBuilder<K,T> of(Class<K> _keyType, Class<T> _valueType) { return new Cache2kBuilder<K, T>(CacheTypeCapture.of(_keyType), CacheTypeCapture.of(_valueType)); }
[ "public", "static", "<", "K", ",", "T", ">", "Cache2kBuilder", "<", "K", ",", "T", ">", "of", "(", "Class", "<", "K", ">", "_keyType", ",", "Class", "<", "T", ">", "_valueType", ")", "{", "return", "new", "Cache2kBuilder", "<", "K", ",", "T", ">"...
Create a new cache builder for key and value types of classes with no generic parameters. @see #keyType(Class) @see #valueType(Class)
[ "Create", "a", "new", "cache", "builder", "for", "key", "and", "value", "types", "of", "classes", "with", "no", "generic", "parameters", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L99-L101
53,172
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.of
public static <K,T> Cache2kBuilder<K, T> of(Cache2kConfiguration<K, T> c) { Cache2kBuilder<K,T> cb = new Cache2kBuilder<K, T>(c); return cb; }
java
public static <K,T> Cache2kBuilder<K, T> of(Cache2kConfiguration<K, T> c) { Cache2kBuilder<K,T> cb = new Cache2kBuilder<K, T>(c); return cb; }
[ "public", "static", "<", "K", ",", "T", ">", "Cache2kBuilder", "<", "K", ",", "T", ">", "of", "(", "Cache2kConfiguration", "<", "K", ",", "T", ">", "c", ")", "{", "Cache2kBuilder", "<", "K", ",", "T", ">", "cb", "=", "new", "Cache2kBuilder", "<", ...
Create a builder from the configuration.
[ "Create", "a", "builder", "from", "the", "configuration", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L106-L109
53,173
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.manager
public final Cache2kBuilder<K, V> manager(CacheManager manager) { if (this.manager != null) { throw new IllegalStateException("manager() must be first operation on builder."); } this.manager = manager; return this; }
java
public final Cache2kBuilder<K, V> manager(CacheManager manager) { if (this.manager != null) { throw new IllegalStateException("manager() must be first operation on builder."); } this.manager = manager; return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "manager", "(", "CacheManager", "manager", ")", "{", "if", "(", "this", ".", "manager", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"manager() must be first operation on bu...
The manager, the created cache will belong to. If this is set, it must be the first method called. @param manager The manager the created cache should belong to, or {@code null} if the default cache manager should be used @throws IllegalStateException if the manager is not provided immediately after the builder is cre...
[ "The", "manager", "the", "created", "cache", "will", "belong", "to", ".", "If", "this", "is", "set", "it", "must", "be", "the", "first", "method", "called", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L182-L188
53,174
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.valueType
@SuppressWarnings("unchecked") public final <T2> Cache2kBuilder<K, T2> valueType(CacheType<T2> t) { Cache2kBuilder<K, T2> me = (Cache2kBuilder<K, T2>) this; me.config().setValueType(t); return me; }
java
@SuppressWarnings("unchecked") public final <T2> Cache2kBuilder<K, T2> valueType(CacheType<T2> t) { Cache2kBuilder<K, T2> me = (Cache2kBuilder<K, T2>) this; me.config().setValueType(t); return me; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "final", "<", "T2", ">", "Cache2kBuilder", "<", "K", ",", "T2", ">", "valueType", "(", "CacheType", "<", "T2", ">", "t", ")", "{", "Cache2kBuilder", "<", "K", ",", "T2", ">", "me", "=", "(...
Sets the value type to use. Arrays are not supported. @throws IllegalArgumentException in case the type is illegal @see CacheType for a general discussion on types
[ "Sets", "the", "value", "type", "to", "use", ".", "Arrays", "are", "not", "supported", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L237-L242
53,175
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.name
public final Cache2kBuilder<K, V> name(Class<?> _class) { config().setName(_class.getName()); return this; }
java
public final Cache2kBuilder<K, V> name(Class<?> _class) { config().setName(_class.getName()); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "name", "(", "Class", "<", "?", ">", "_class", ")", "{", "config", "(", ")", ".", "setName", "(", "_class", ".", "getName", "(", ")", ")", ";", "return", "this", ";", "}" ]
Sets a cache name from the fully qualified class name. <p>See {@link #name(String)} for a general discussion about cache names. @see #name(String)
[ "Sets", "a", "cache", "name", "from", "the", "fully", "qualified", "class", "name", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L288-L291
53,176
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.wrapCustomizationInstance
private static <T> CustomizationReferenceSupplier<T> wrapCustomizationInstance(T obj) { if (obj == null) { return null; } return new CustomizationReferenceSupplier<T>(obj); }
java
private static <T> CustomizationReferenceSupplier<T> wrapCustomizationInstance(T obj) { if (obj == null) { return null; } return new CustomizationReferenceSupplier<T>(obj); }
[ "private", "static", "<", "T", ">", "CustomizationReferenceSupplier", "<", "T", ">", "wrapCustomizationInstance", "(", "T", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "return", "null", ";", "}", "return", "new", "CustomizationReferenceSupplier"...
Wraps to factory but passes on nulls.
[ "Wraps", "to", "factory", "but", "passes", "on", "nulls", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L424-L427
53,177
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.wrappingLoader
@SuppressWarnings("unchecked") public final Cache2kBuilder<K, V> wrappingLoader(AdvancedCacheLoader<K, LoadDetail<V>> l) { config().setAdvancedLoader(( CustomizationSupplier<AdvancedCacheLoader<K, V>>) (Object) wrapCustomizationInstance(l)); return this; }
java
@SuppressWarnings("unchecked") public final Cache2kBuilder<K, V> wrappingLoader(AdvancedCacheLoader<K, LoadDetail<V>> l) { config().setAdvancedLoader(( CustomizationSupplier<AdvancedCacheLoader<K, V>>) (Object) wrapCustomizationInstance(l)); return this; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "wrappingLoader", "(", "AdvancedCacheLoader", "<", "K", ",", "LoadDetail", "<", "V", ">", ">", "l", ")", "{", "config", "(", ")", ".", "setA...
Enables read through operation and sets a cache loader @see CacheLoader for general discussion on cache loaders
[ "Enables", "read", "through", "operation", "and", "sets", "a", "cache", "loader" ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L482-L487
53,178
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.writer
public final Cache2kBuilder<K, V> writer(CacheWriter<K, V> w) { config().setWriter(wrapCustomizationInstance(w)); return this; }
java
public final Cache2kBuilder<K, V> writer(CacheWriter<K, V> w) { config().setWriter(wrapCustomizationInstance(w)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "writer", "(", "CacheWriter", "<", "K", ",", "V", ">", "w", ")", "{", "config", "(", ")", ".", "setWriter", "(", "wrapCustomizationInstance", "(", "w", ")", ")", ";", "return", "this", ";"...
Enables write through operation and sets a writer customization that gets called synchronously upon cache mutations. By default write through is not enabled.
[ "Enables", "write", "through", "operation", "and", "sets", "a", "writer", "customization", "that", "gets", "called", "synchronously", "upon", "cache", "mutations", ".", "By", "default", "write", "through", "is", "not", "enabled", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L517-L520
53,179
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.addCacheClosedListener
public final Cache2kBuilder<K, V> addCacheClosedListener(CacheClosedListener listener) { config().getCacheClosedListeners().add(wrapCustomizationInstance(listener)); return this; }
java
public final Cache2kBuilder<K, V> addCacheClosedListener(CacheClosedListener listener) { config().getCacheClosedListeners().add(wrapCustomizationInstance(listener)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "addCacheClosedListener", "(", "CacheClosedListener", "listener", ")", "{", "config", "(", ")", ".", "getCacheClosedListeners", "(", ")", ".", "add", "(", "wrapCustomizationInstance", "(", "listener", ...
Listener that is called after a cache is closed. This is mainly used for the JCache integration.
[ "Listener", "that", "is", "called", "after", "a", "cache", "is", "closed", ".", "This", "is", "mainly", "used", "for", "the", "JCache", "integration", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L525-L528
53,180
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.addListener
public final Cache2kBuilder<K, V> addListener(CacheEntryOperationListener<K,V> listener) { config().getListeners().add(wrapCustomizationInstance(listener)); return this; }
java
public final Cache2kBuilder<K, V> addListener(CacheEntryOperationListener<K,V> listener) { config().getListeners().add(wrapCustomizationInstance(listener)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "addListener", "(", "CacheEntryOperationListener", "<", "K", ",", "V", ">", "listener", ")", "{", "config", "(", ")", ".", "getListeners", "(", ")", ".", "add", "(", "wrapCustomizationInstance", ...
Add a listener. The listeners will be executed in a synchronous mode, meaning, further processing for an entry will stall until a registered listener is executed. The expiry will be always executed asynchronously. @throws IllegalArgumentException if an identical listener is already added. @param listener The listener...
[ "Add", "a", "listener", ".", "The", "listeners", "will", "be", "executed", "in", "a", "synchronous", "mode", "meaning", "further", "processing", "for", "an", "entry", "will", "stall", "until", "a", "registered", "listener", "is", "executed", ".", "The", "exp...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L538-L541
53,181
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.addAsyncListener
public final Cache2kBuilder<K,V> addAsyncListener(CacheEntryOperationListener<K,V> listener) { config().getAsyncListeners().add(wrapCustomizationInstance(listener)); return this; }
java
public final Cache2kBuilder<K,V> addAsyncListener(CacheEntryOperationListener<K,V> listener) { config().getAsyncListeners().add(wrapCustomizationInstance(listener)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "addAsyncListener", "(", "CacheEntryOperationListener", "<", "K", ",", "V", ">", "listener", ")", "{", "config", "(", ")", ".", "getAsyncListeners", "(", ")", ".", "add", "(", "wrapCustomizationIn...
A set of listeners. Listeners added in this collection will be executed in a asynchronous mode. @throws IllegalArgumentException if an identical listener is already added. @param listener The listener to add
[ "A", "set", "of", "listeners", ".", "Listeners", "added", "in", "this", "collection", "will", "be", "executed", "in", "a", "asynchronous", "mode", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L550-L553
53,182
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.expiryPolicy
public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) { config().setExpiryPolicy(wrapCustomizationInstance(c)); return this; }
java
public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) { config().setExpiryPolicy(wrapCustomizationInstance(c)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "expiryPolicy", "(", "ExpiryPolicy", "<", "K", ",", "V", ">", "c", ")", "{", "config", "(", ")", ".", "setExpiryPolicy", "(", "wrapCustomizationInstance", "(", "c", ")", ")", ";", "return", ...
Set expiry policy to use. <p>If this is specified the maximum expiry time is still limited to the value in {@link #expireAfterWrite}. If {@link #expireAfterWrite(long, java.util.concurrent.TimeUnit)} is set to 0 then expiry calculation is not used, all entries expire immediately. <p>If no maximum expiry is specified ...
[ "Set", "expiry", "policy", "to", "use", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L565-L568
53,183
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.maxRetryInterval
public final Cache2kBuilder<K, V> maxRetryInterval(long v, TimeUnit u) { config().setMaxRetryInterval(u.toMillis(v)); return this; }
java
public final Cache2kBuilder<K, V> maxRetryInterval(long v, TimeUnit u) { config().setMaxRetryInterval(u.toMillis(v)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "maxRetryInterval", "(", "long", "v", ",", "TimeUnit", "u", ")", "{", "config", "(", ")", ".", "setMaxRetryInterval", "(", "u", ".", "toMillis", "(", "v", ")", ")", ";", "return", "this", ...
If a loader exception happens, this is the maximum time interval after a retry attempt is made. For retries an exponential backoff algorithm is used. It starts with the retry time and then increases the time to the maximum according to an exponential pattern. <p>By default identical to {@link #resilienceDuration}
[ "If", "a", "loader", "exception", "happens", "this", "is", "the", "maximum", "time", "interval", "after", "a", "retry", "attempt", "is", "made", ".", "For", "retries", "an", "exponential", "backoff", "algorithm", "is", "used", ".", "It", "starts", "with", ...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L656-L659
53,184
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.with
public final Cache2kBuilder<K, V> with(ConfigurationSectionBuilder<? extends ConfigurationSection>... sectionBuilders) { for (ConfigurationSectionBuilder<? extends ConfigurationSection> b : sectionBuilders) { config().getSections().add(b.buildConfigurationSection()); } return this; }
java
public final Cache2kBuilder<K, V> with(ConfigurationSectionBuilder<? extends ConfigurationSection>... sectionBuilders) { for (ConfigurationSectionBuilder<? extends ConfigurationSection> b : sectionBuilders) { config().getSections().add(b.buildConfigurationSection()); } return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "with", "(", "ConfigurationSectionBuilder", "<", "?", "extends", "ConfigurationSection", ">", "...", "sectionBuilders", ")", "{", "for", "(", "ConfigurationSectionBuilder", "<", "?", "extends", "Configu...
Add a new configuration sub section. @see org.cache2k.configuration.ConfigurationWithSections
[ "Add", "a", "new", "configuration", "sub", "section", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L690-L695
53,185
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.asyncListenerExecutor
public final Cache2kBuilder<K,V> asyncListenerExecutor(Executor v) { config().setAsyncListenerExecutor(new CustomizationReferenceSupplier<Executor>(v)); return this; }
java
public final Cache2kBuilder<K,V> asyncListenerExecutor(Executor v) { config().setAsyncListenerExecutor(new CustomizationReferenceSupplier<Executor>(v)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "asyncListenerExecutor", "(", "Executor", "v", ")", "{", "config", "(", ")", ".", "setAsyncListenerExecutor", "(", "new", "CustomizationReferenceSupplier", "<", "Executor", ">", "(", "v", ")", ")", ...
Executor for asynchronous listeners. If no executor is specified, an internal executor is used that has unbounded thread capacity. @see #addAsyncListener(CacheEntryOperationListener)
[ "Executor", "for", "asynchronous", "listeners", ".", "If", "no", "executor", "is", "specified", "an", "internal", "executor", "is", "used", "that", "has", "unbounded", "thread", "capacity", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L806-L809
53,186
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java
Cache2kBuilder.timeReference
public final Cache2kBuilder<K, V> timeReference(TimeReference v) { config().setTimeReference(new CustomizationReferenceSupplier<TimeReference>(v)); return this; }
java
public final Cache2kBuilder<K, V> timeReference(TimeReference v) { config().setTimeReference(new CustomizationReferenceSupplier<TimeReference>(v)); return this; }
[ "public", "final", "Cache2kBuilder", "<", "K", ",", "V", ">", "timeReference", "(", "TimeReference", "v", ")", "{", "config", "(", ")", ".", "setTimeReference", "(", "new", "CustomizationReferenceSupplier", "<", "TimeReference", ">", "(", "v", ")", ")", ";",...
Clock to be used by the cache as time reference.
[ "Clock", "to", "be", "used", "by", "the", "cache", "as", "time", "reference", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/Cache2kBuilder.java#L814-L817
53,187
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/TimingHandler.java
TimingHandler.limitExpiryToMaxLinger
static long limitExpiryToMaxLinger(long now, long _maxLinger, long _requestedExpiryTime, boolean _sharpExpiryEnabled) { if (_sharpExpiryEnabled && _requestedExpiryTime > ExpiryPolicy.REFRESH && _requestedExpiryTime < ExpiryPolicy.ETERNAL) { _requestedExpiryTime = -_requestedExpiryTime; } return Expiry...
java
static long limitExpiryToMaxLinger(long now, long _maxLinger, long _requestedExpiryTime, boolean _sharpExpiryEnabled) { if (_sharpExpiryEnabled && _requestedExpiryTime > ExpiryPolicy.REFRESH && _requestedExpiryTime < ExpiryPolicy.ETERNAL) { _requestedExpiryTime = -_requestedExpiryTime; } return Expiry...
[ "static", "long", "limitExpiryToMaxLinger", "(", "long", "now", ",", "long", "_maxLinger", ",", "long", "_requestedExpiryTime", ",", "boolean", "_sharpExpiryEnabled", ")", "{", "if", "(", "_sharpExpiryEnabled", "&&", "_requestedExpiryTime", ">", "ExpiryPolicy", ".", ...
Ignore the value of the expiry policy if later then the maximum expiry time. If max linger takes over, we do not request sharp expiry. <p>The situation becomes messy if the point in time for the maximum expiry is close to the requested expiry time and sharp expiry is requested. The expiry or a reload (with refresh ahe...
[ "Ignore", "the", "value", "of", "the", "expiry", "policy", "if", "later", "then", "the", "maximum", "expiry", "time", ".", "If", "max", "linger", "takes", "over", "we", "do", "not", "request", "sharp", "expiry", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/TimingHandler.java#L619-L624
53,188
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.getDefaultManagerName
@Override public String getDefaultManagerName(ClassLoader cl) { ConfigurationContext ctx = classLoader2config.get(cl); if (ctx == null) { ctx = createContext(cl, null, DEFAULT_CONFIGURATION_FILE); Map<ClassLoader, ConfigurationContext> m2 = new HashMap<ClassLoader, ConfigurationContext>(classLoade...
java
@Override public String getDefaultManagerName(ClassLoader cl) { ConfigurationContext ctx = classLoader2config.get(cl); if (ctx == null) { ctx = createContext(cl, null, DEFAULT_CONFIGURATION_FILE); Map<ClassLoader, ConfigurationContext> m2 = new HashMap<ClassLoader, ConfigurationContext>(classLoade...
[ "@", "Override", "public", "String", "getDefaultManagerName", "(", "ClassLoader", "cl", ")", "{", "ConfigurationContext", "ctx", "=", "classLoader2config", ".", "get", "(", "cl", ")", ";", "if", "(", "ctx", "==", "null", ")", "{", "ctx", "=", "createContext"...
The name of the default manager may be changed in the configuration file. Load the default configuration file and save the loaded context for the respective classloader, so we do not load the context twice when we create the first cache.
[ "The", "name", "of", "the", "default", "manager", "may", "be", "changed", "in", "the", "configuration", "file", ".", "Load", "the", "default", "configuration", "file", "and", "save", "the", "loaded", "context", "for", "the", "respective", "classloader", "so", ...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L76-L86
53,189
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.getManagerContext
private ConfigurationContext getManagerContext(final CacheManager mgr) { ConfigurationContext ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } synchronized (this) { ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } if (mgr....
java
private ConfigurationContext getManagerContext(final CacheManager mgr) { ConfigurationContext ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } synchronized (this) { ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } if (mgr....
[ "private", "ConfigurationContext", "getManagerContext", "(", "final", "CacheManager", "mgr", ")", "{", "ConfigurationContext", "ctx", "=", "manager2defaultConfig", ".", "get", "(", "mgr", ")", ";", "if", "(", "ctx", "!=", "null", ")", "{", "return", "ctx", ";"...
Hold the cache default configuration of a manager in a hash table. This is reused for all caches of one manager.
[ "Hold", "the", "cache", "default", "configuration", "of", "a", "manager", "in", "a", "hash", "table", ".", "This", "is", "reused", "for", "all", "caches", "of", "one", "manager", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L186-L208
53,190
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.apply
void apply(final ConfigurationContext ctx, final ParsedConfiguration _parsedCfg, final Object cfg) { ParsedConfiguration _templates = ctx.getTemplates(); ConfigurationTokenizer.Property _include = _parsedCfg.getPropertyMap().get("include"); if (_include != null) { for (String _template : _include.getV...
java
void apply(final ConfigurationContext ctx, final ParsedConfiguration _parsedCfg, final Object cfg) { ParsedConfiguration _templates = ctx.getTemplates(); ConfigurationTokenizer.Property _include = _parsedCfg.getPropertyMap().get("include"); if (_include != null) { for (String _template : _include.getV...
[ "void", "apply", "(", "final", "ConfigurationContext", "ctx", ",", "final", "ParsedConfiguration", "_parsedCfg", ",", "final", "Object", "cfg", ")", "{", "ParsedConfiguration", "_templates", "=", "ctx", ".", "getTemplates", "(", ")", ";", "ConfigurationTokenizer", ...
Set properties in configuration bean based on the parsed configuration. Called by unit test.
[ "Set", "properties", "in", "configuration", "bean", "based", "on", "the", "parsed", "configuration", ".", "Called", "by", "unit", "test", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L272-L311
53,191
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.handleBean
private boolean handleBean( final ConfigurationContext ctx, final Class<?> _type, final Object cfg, final ParsedConfiguration _parsedCfg) { String _containerName = _parsedCfg.getContainer(); BeanPropertyMutator m = provideMutator(cfg.getClass()); Class<?> _targetType = m.getType(_containerNa...
java
private boolean handleBean( final ConfigurationContext ctx, final Class<?> _type, final Object cfg, final ParsedConfiguration _parsedCfg) { String _containerName = _parsedCfg.getContainer(); BeanPropertyMutator m = provideMutator(cfg.getClass()); Class<?> _targetType = m.getType(_containerNa...
[ "private", "boolean", "handleBean", "(", "final", "ConfigurationContext", "ctx", ",", "final", "Class", "<", "?", ">", "_type", ",", "final", "Object", "cfg", ",", "final", "ParsedConfiguration", "_parsedCfg", ")", "{", "String", "_containerName", "=", "_parsedC...
Create the bean, apply configuration to it and set it. @return true, if applied, false if not a property
[ "Create", "the", "bean", "apply", "configuration", "to", "it", "and", "set", "it", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L318-L335
53,192
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java
CacheConfigurationProviderImpl.handleSection
private boolean handleSection( final ConfigurationContext ctx, final Class<?> _type, final ConfigurationWithSections cfg, final ParsedConfiguration sc) { String _containerName = sc.getContainer(); if (!"sections".equals(_containerName)) { return false; } @SuppressWarnings("unchecke...
java
private boolean handleSection( final ConfigurationContext ctx, final Class<?> _type, final ConfigurationWithSections cfg, final ParsedConfiguration sc) { String _containerName = sc.getContainer(); if (!"sections".equals(_containerName)) { return false; } @SuppressWarnings("unchecke...
[ "private", "boolean", "handleSection", "(", "final", "ConfigurationContext", "ctx", ",", "final", "Class", "<", "?", ">", "_type", ",", "final", "ConfigurationWithSections", "cfg", ",", "final", "ParsedConfiguration", "sc", ")", "{", "String", "_containerName", "=...
Create a new configuration section or reuse an existing section, if it is a singleton. <p>No support for writing on existing sections, which means it is not possible to define a non singleton in the defaults section and then override values later in the cache specific configuration. This is not needed for version 1.0....
[ "Create", "a", "new", "configuration", "section", "or", "reuse", "an", "existing", "section", "if", "it", "is", "a", "singleton", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L410-L430
53,193
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/EntryAction.java
EntryAction.checkKeepOrRemove
public void checkKeepOrRemove() { boolean _hasKeepAfterExpired = heapCache.isKeepAfterExpired(); if (expiry != 0 || remove || _hasKeepAfterExpired) { mutationUpdateHeap(); return; } if (_hasKeepAfterExpired) { expiredImmediatelyKeepData(); return; } expiredImmediatelyAndR...
java
public void checkKeepOrRemove() { boolean _hasKeepAfterExpired = heapCache.isKeepAfterExpired(); if (expiry != 0 || remove || _hasKeepAfterExpired) { mutationUpdateHeap(); return; } if (_hasKeepAfterExpired) { expiredImmediatelyKeepData(); return; } expiredImmediatelyAndR...
[ "public", "void", "checkKeepOrRemove", "(", ")", "{", "boolean", "_hasKeepAfterExpired", "=", "heapCache", ".", "isKeepAfterExpired", "(", ")", ";", "if", "(", "expiry", "!=", "0", "||", "remove", "||", "_hasKeepAfterExpired", ")", "{", "mutationUpdateHeap", "("...
In case we have a expiry of 0, this means that the entry should not be cached. If there is a valid entry, we remove it if we do not keep the data.
[ "In", "case", "we", "have", "a", "expiry", "of", "0", "this", "means", "that", "the", "entry", "should", "not", "be", "cached", ".", "If", "there", "is", "a", "valid", "entry", "we", "remove", "it", "if", "we", "do", "not", "keep", "the", "data", "...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/EntryAction.java#L773-L784
53,194
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/EntryAction.java
EntryAction.asyncOperationStarted
public void asyncOperationStarted() { if (syncThread == Thread.currentThread()) { synchronized (entry) { while (entry.isProcessing()) { try { entry.wait(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } } ...
java
public void asyncOperationStarted() { if (syncThread == Thread.currentThread()) { synchronized (entry) { while (entry.isProcessing()) { try { entry.wait(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } } ...
[ "public", "void", "asyncOperationStarted", "(", ")", "{", "if", "(", "syncThread", "==", "Thread", ".", "currentThread", "(", ")", ")", "{", "synchronized", "(", "entry", ")", "{", "while", "(", "entry", ".", "isProcessing", "(", ")", ")", "{", "try", ...
If thread is a synchronous call, wait until operation is complete. There is a little chance that the call back completes before we get here as well as some other operation changing the entry again.
[ "If", "thread", "is", "a", "synchronous", "call", "wait", "until", "operation", "is", "complete", ".", "There", "is", "a", "little", "chance", "that", "the", "call", "back", "completes", "before", "we", "get", "here", "as", "well", "as", "some", "other", ...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/EntryAction.java#L1004-L1018
53,195
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/util/Log.java
Log.initializeLogFactory
private static void initializeLogFactory() { ServiceLoader<LogFactory> loader = ServiceLoader.load(LogFactory.class); for (LogFactory lf : loader) { logFactory = lf; log("New instance, using: " + logFactory.getClass().getName()); return; } try { final org.slf4j.ILoggerFactory lf ...
java
private static void initializeLogFactory() { ServiceLoader<LogFactory> loader = ServiceLoader.load(LogFactory.class); for (LogFactory lf : loader) { logFactory = lf; log("New instance, using: " + logFactory.getClass().getName()); return; } try { final org.slf4j.ILoggerFactory lf ...
[ "private", "static", "void", "initializeLogFactory", "(", ")", "{", "ServiceLoader", "<", "LogFactory", ">", "loader", "=", "ServiceLoader", ".", "load", "(", "LogFactory", ".", "class", ")", ";", "for", "(", "LogFactory", "lf", ":", "loader", ")", "{", "l...
Finds a logger we can use. First we start with looking for a registered service provider. Then apache commons logging. As a fallback we use JDK logging.
[ "Finds", "a", "logger", "we", "can", "use", ".", "First", "we", "start", "with", "looking", "for", "a", "registered", "service", "provider", ".", "Then", "apache", "commons", "logging", ".", "As", "a", "fallback", "we", "use", "JDK", "logging", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/util/Log.java#L73-L112
53,196
cache2k/cache2k
cache2k-api/src/main/java/org/cache2k/spi/SingleProviderResolver.java
SingleProviderResolver.readFile
private static String readFile(String _name) throws IOException { InputStream in = SingleProviderResolver.class.getClassLoader().getResourceAsStream(_name); if (in == null) { return null; } try { LineNumberReader r = new LineNumberReader(new InputStreamReader(in)); String l = r.readLin...
java
private static String readFile(String _name) throws IOException { InputStream in = SingleProviderResolver.class.getClassLoader().getResourceAsStream(_name); if (in == null) { return null; } try { LineNumberReader r = new LineNumberReader(new InputStreamReader(in)); String l = r.readLin...
[ "private", "static", "String", "readFile", "(", "String", "_name", ")", "throws", "IOException", "{", "InputStream", "in", "=", "SingleProviderResolver", ".", "class", ".", "getClassLoader", "(", ")", ".", "getResourceAsStream", "(", "_name", ")", ";", "if", "...
Read the first line of a file in the classpath into a string.
[ "Read", "the", "first", "line", "of", "a", "file", "in", "the", "classpath", "into", "a", "string", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-api/src/main/java/org/cache2k/spi/SingleProviderResolver.java#L127-L145
53,197
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java
CacheManagerImpl.constructAllServiceImplementations
@SuppressWarnings("unchecked") private static <S> Iterable<S> constructAllServiceImplementations(Class<S> _service) { ClassLoader cl = CacheManagerImpl.class.getClassLoader(); ArrayList<S> li = new ArrayList<S>(); Iterator<S> it = ServiceLoader.load(_service, cl).iterator(); while (it.hasNext()) { ...
java
@SuppressWarnings("unchecked") private static <S> Iterable<S> constructAllServiceImplementations(Class<S> _service) { ClassLoader cl = CacheManagerImpl.class.getClassLoader(); ArrayList<S> li = new ArrayList<S>(); Iterator<S> it = ServiceLoader.load(_service, cl).iterator(); while (it.hasNext()) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "S", ">", "Iterable", "<", "S", ">", "constructAllServiceImplementations", "(", "Class", "<", "S", ">", "_service", ")", "{", "ClassLoader", "cl", "=", "CacheManagerImpl", ".", "clas...
The service loader works lazy, however, we want to have all implementations constructed. Retrieve all implementations from the service loader and return an read-only iterable backed by an array.
[ "The", "service", "loader", "works", "lazy", "however", "we", "want", "to", "have", "all", "implementations", "constructed", ".", "Retrieve", "all", "implementations", "from", "the", "service", "loader", "and", "return", "an", "read", "-", "only", "iterable", ...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java#L65-L95
53,198
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java
CacheManagerImpl.checkName
public static void checkName(String s) { for (char c : s.toCharArray()) { if (c == '.' || c == '-' || c == '~' || c == ',' || c == '@' || c == ' ' || c == '(' || c == ')' || c == '+' || c == '!' || c == '\'' ||...
java
public static void checkName(String s) { for (char c : s.toCharArray()) { if (c == '.' || c == '-' || c == '~' || c == ',' || c == '@' || c == ' ' || c == '(' || c == ')' || c == '+' || c == '!' || c == '\'' ||...
[ "public", "static", "void", "checkName", "(", "String", "s", ")", "{", "for", "(", "char", "c", ":", "s", ".", "toCharArray", "(", ")", ")", "{", "if", "(", "c", "==", "'", "'", "||", "c", "==", "'", "'", "||", "c", "==", "'", "'", "||", "c...
Don't accept a cache or manager names with too weird characters. @see org.cache2k.Cache2kBuilder#name(String)
[ "Don", "t", "accept", "a", "cache", "or", "manager", "names", "with", "too", "weird", "characters", "." ]
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java#L140-L162
53,199
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java
CacheManagerImpl.close
@Override public void close() { if (isDefaultManager() && getClass().getClassLoader() == classLoader) { log.info("Closing default CacheManager"); } Iterable<Cache> _caches; synchronized (lock) { if (closing) { return; } _caches = cachesCopy(); closing = true; ...
java
@Override public void close() { if (isDefaultManager() && getClass().getClassLoader() == classLoader) { log.info("Closing default CacheManager"); } Iterable<Cache> _caches; synchronized (lock) { if (closing) { return; } _caches = cachesCopy(); closing = true; ...
[ "@", "Override", "public", "void", "close", "(", ")", "{", "if", "(", "isDefaultManager", "(", ")", "&&", "getClass", "(", ")", ".", "getClassLoader", "(", ")", "==", "classLoader", ")", "{", "log", ".", "info", "(", "\"Closing default CacheManager\"", ")"...
The shutdown takes place in two phases. First all caches are notified to cancel their scheduled timer jobs, after that the shutdown is done. Cancelling the timer jobs first is needed, because there may be cache stacking and a timer job of one cache may call an already closed cache. <p>Rationale exception handling: Exc...
[ "The", "shutdown", "takes", "place", "in", "two", "phases", ".", "First", "all", "caches", "are", "notified", "to", "cancel", "their", "scheduled", "timer", "jobs", "after", "that", "the", "shutdown", "is", "done", ".", "Cancelling", "the", "timer", "jobs", ...
3c9ccff12608c598c387ec50957089784cc4b618
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/CacheManagerImpl.java#L275-L315