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
44,900
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java
DepTreeNode.populateDepMap
void populateDepMap(Map<String, DependencyInfo> depMap) { if (uri != null) { depMap.put(getFullPathName(), new DependencyInfo(defineDependencies, requireDependencies, dependentFeatures, uri)); } if (children != null) { for (Entry<String, DepTreeNode> entry : children.entrySet()) { entry.getValue()...
java
void populateDepMap(Map<String, DependencyInfo> depMap) { if (uri != null) { depMap.put(getFullPathName(), new DependencyInfo(defineDependencies, requireDependencies, dependentFeatures, uri)); } if (children != null) { for (Entry<String, DepTreeNode> entry : children.entrySet()) { entry.getValue()...
[ "void", "populateDepMap", "(", "Map", "<", "String", ",", "DependencyInfo", ">", "depMap", ")", "{", "if", "(", "uri", "!=", "null", ")", "{", "depMap", ".", "put", "(", "getFullPathName", "(", ")", ",", "new", "DependencyInfo", "(", "defineDependencies", ...
Populates the provided map with the dependencies, keyed by full path name. This is done to facilitate more efficient lookups of the dependencies. @param depMap
[ "Populates", "the", "provided", "map", "with", "the", "dependencies", "keyed", "by", "full", "path", "name", ".", "This", "is", "done", "to", "facilitate", "more", "efficient", "lookups", "of", "the", "dependencies", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L612-L621
44,901
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java
DepTreeNode.readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // Call the default implementation to de-serialize our object in.defaultReadObject(); parent = new WeakReference<DepTreeNode>(null); // restore parent reference on all children if (children != null) { f...
java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // Call the default implementation to de-serialize our object in.defaultReadObject(); parent = new WeakReference<DepTreeNode>(null); // restore parent reference on all children if (children != null) { f...
[ "private", "void", "readObject", "(", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "// Call the default implementation to de-serialize our object\r", "in", ".", "defaultReadObject", "(", ")", ";", "parent", "=", "new", "Weak...
Method called when this object is de-serialized @param in The {@link ObjectInputStream} to read from @throws IOException @throws ClassNotFoundException
[ "Method", "called", "when", "this", "object", "is", "de", "-", "serialized" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L630-L644
44,902
OpenNTF/JavascriptAggregator
jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java
AggregatorImpl.getOptionsServiceTracker
protected ServiceTracker<IOptions, ?> getOptionsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException { ServiceTracker<IOptions, ?> tracker = new ServiceTracker<IOptions, Object>( bundleContext, bundleContext.createFilter( "(&(" + Constants.OBJECTCLASS + "=" + IOptions.class.getN...
java
protected ServiceTracker<IOptions, ?> getOptionsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException { ServiceTracker<IOptions, ?> tracker = new ServiceTracker<IOptions, Object>( bundleContext, bundleContext.createFilter( "(&(" + Constants.OBJECTCLASS + "=" + IOptions.class.getN...
[ "protected", "ServiceTracker", "<", "IOptions", ",", "?", ">", "getOptionsServiceTracker", "(", "BundleContext", "bundleContext", ")", "throws", "InvalidSyntaxException", "{", "ServiceTracker", "<", "IOptions", ",", "?", ">", "tracker", "=", "new", "ServiceTracker", ...
Returns an opened ServiceTracker for the Aggregator options. Aggregator options are created by the bundle activator and are shared by all Aggregator instances created from the same bundle. @param bundleContext The contributing bundle context @return The opened service tracker @throws InvalidSyntaxException
[ "Returns", "an", "opened", "ServiceTracker", "for", "the", "Aggregator", "options", ".", "Aggregator", "options", "are", "created", "by", "the", "bundle", "activator", "and", "are", "shared", "by", "all", "Aggregator", "instances", "created", "from", "the", "sam...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L405-L414
44,903
OpenNTF/JavascriptAggregator
jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java
AggregatorImpl.getExecutorsServiceTracker
protected ServiceTracker<IExecutors, ?> getExecutorsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException { ServiceTracker<IExecutors, ?> tracker = new ServiceTracker<IExecutors, Object>( bundleContext, bundleContext.createFilter( "(&(" + Constants.OBJECTCLASS + "=" + IExecutors....
java
protected ServiceTracker<IExecutors, ?> getExecutorsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException { ServiceTracker<IExecutors, ?> tracker = new ServiceTracker<IExecutors, Object>( bundleContext, bundleContext.createFilter( "(&(" + Constants.OBJECTCLASS + "=" + IExecutors....
[ "protected", "ServiceTracker", "<", "IExecutors", ",", "?", ">", "getExecutorsServiceTracker", "(", "BundleContext", "bundleContext", ")", "throws", "InvalidSyntaxException", "{", "ServiceTracker", "<", "IExecutors", ",", "?", ">", "tracker", "=", "new", "ServiceTrack...
Returns an opened ServiceTracker for the Aggregator exectors provider. The executors provider is are created by the bundle activator and is shared by all Aggregator instances created from the same bundle. @param bundleContext The contributing bundle context @return The opened service tracker @throws InvalidSyntaxExcep...
[ "Returns", "an", "opened", "ServiceTracker", "for", "the", "Aggregator", "exectors", "provider", ".", "The", "executors", "provider", "is", "are", "created", "by", "the", "bundle", "activator", "and", "is", "shared", "by", "all", "Aggregator", "instances", "crea...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L426-L435
44,904
OpenNTF/JavascriptAggregator
jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java
AggregatorImpl.createCacheBundle
public String createCacheBundle(String bundleSymbolicName, String bundleFileName) throws IOException { final String sourceMethod = "createCacheBundle"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{bundle...
java
public String createCacheBundle(String bundleSymbolicName, String bundleFileName) throws IOException { final String sourceMethod = "createCacheBundle"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod, new Object[]{bundle...
[ "public", "String", "createCacheBundle", "(", "String", "bundleSymbolicName", ",", "String", "bundleFileName", ")", "throws", "IOException", "{", "final", "String", "sourceMethod", "=", "\"createCacheBundle\"", ";", "//$NON-NLS-1$\r", "final", "boolean", "isTraceLogging",...
Command handler to create a cache primer bundle containing the contents of the cache directory. @param bundleSymbolicName the symbolic name of the bundle to be created @param bundleFileName the filename of the bundle to be created @return the string to be displayed in the console (the fully qualified filename of the b...
[ "Command", "handler", "to", "create", "a", "cache", "primer", "bundle", "containing", "the", "contents", "of", "the", "cache", "directory", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L783-L833
44,905
OpenNTF/JavascriptAggregator
jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java
AggregatorImpl.processRequestUrl
public String processRequestUrl(String requestUrl) throws IOException, ServletException { ConsoleHttpServletRequest req = new ConsoleHttpServletRequest(getServletConfig().getServletContext(), requestUrl); OutputStream nulOutputStream = new OutputStream() { @Override public void write(int b) throws IOException...
java
public String processRequestUrl(String requestUrl) throws IOException, ServletException { ConsoleHttpServletRequest req = new ConsoleHttpServletRequest(getServletConfig().getServletContext(), requestUrl); OutputStream nulOutputStream = new OutputStream() { @Override public void write(int b) throws IOException...
[ "public", "String", "processRequestUrl", "(", "String", "requestUrl", ")", "throws", "IOException", ",", "ServletException", "{", "ConsoleHttpServletRequest", "req", "=", "new", "ConsoleHttpServletRequest", "(", "getServletConfig", "(", ")", ".", "getServletContext", "(...
Implementation of eponymous console command. Provided to allow cache priming requests to be issued via the server console by automation scripts. @param requestUrl the URL to process @return the status code as a string @throws IOException @throws ServletException
[ "Implementation", "of", "eponymous", "console", "command", ".", "Provided", "to", "allow", "cache", "priming", "requests", "to", "be", "issued", "via", "the", "server", "console", "by", "automation", "scripts", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L845-L853
44,906
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java
TransitionFactory.add
public void add(VMTransitionBuilder b) { Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState()); for (VMState src : b.getSourceStates()) { m.put(src, b); } }
java
public void add(VMTransitionBuilder b) { Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState()); for (VMState src : b.getSourceStates()) { m.put(src, b); } }
[ "public", "void", "add", "(", "VMTransitionBuilder", "b", ")", "{", "Map", "<", "VMState", ",", "VMTransitionBuilder", ">", "m", "=", "vmAMB2", ".", "get", "(", "b", ".", "getDestinationState", "(", ")", ")", ";", "for", "(", "VMState", "src", ":", "b"...
Add a builder for a VM. Every builder that supports the same transition will be replaced. @param b the builder to add
[ "Add", "a", "builder", "for", "a", "VM", ".", "Every", "builder", "that", "supports", "the", "same", "transition", "will", "be", "replaced", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L61-L66
44,907
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java
TransitionFactory.remove
public boolean remove(VMTransitionBuilder b) { Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState()); for (VMState src : b.getSourceStates()) { m.remove(src); } return true; }
java
public boolean remove(VMTransitionBuilder b) { Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState()); for (VMState src : b.getSourceStates()) { m.remove(src); } return true; }
[ "public", "boolean", "remove", "(", "VMTransitionBuilder", "b", ")", "{", "Map", "<", "VMState", ",", "VMTransitionBuilder", ">", "m", "=", "vmAMB2", ".", "get", "(", "b", ".", "getDestinationState", "(", ")", ")", ";", "for", "(", "VMState", "src", ":",...
Remove a builder for an action on a VM. @param b the builder to remove @return {@code true} if it has been removed
[ "Remove", "a", "builder", "for", "an", "action", "on", "a", "VM", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L74-L80
44,908
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java
TransitionFactory.getBuilder
public VMTransitionBuilder getBuilder(VMState srcState, VMState dstState) { Map<VMState, VMTransitionBuilder> dstCompliant = vmAMB2.get(dstState); if (dstCompliant == null) { return null; } return dstCompliant.get(srcState); }
java
public VMTransitionBuilder getBuilder(VMState srcState, VMState dstState) { Map<VMState, VMTransitionBuilder> dstCompliant = vmAMB2.get(dstState); if (dstCompliant == null) { return null; } return dstCompliant.get(srcState); }
[ "public", "VMTransitionBuilder", "getBuilder", "(", "VMState", "srcState", ",", "VMState", "dstState", ")", "{", "Map", "<", "VMState", ",", "VMTransitionBuilder", ">", "dstCompliant", "=", "vmAMB2", ".", "get", "(", "dstState", ")", ";", "if", "(", "dstCompli...
Get the model builder for a given transition @param srcState the current VM state @param dstState the current VM state @return the list of possible transitions. {@code null} if no transition is available
[ "Get", "the", "model", "builder", "for", "a", "given", "transition" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L108-L114
44,909
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java
TransitionFactory.newBundle
public static TransitionFactory newBundle() { TransitionFactory f = new TransitionFactory(); f.add(new BootVM.Builder()); f.add(new ShutdownVM.Builder()); f.add(new SuspendVM.Builder()); f.add(new ResumeVM.Builder()); f.add(new KillVM.Builder()); f.add(new Relocat...
java
public static TransitionFactory newBundle() { TransitionFactory f = new TransitionFactory(); f.add(new BootVM.Builder()); f.add(new ShutdownVM.Builder()); f.add(new SuspendVM.Builder()); f.add(new ResumeVM.Builder()); f.add(new KillVM.Builder()); f.add(new Relocat...
[ "public", "static", "TransitionFactory", "newBundle", "(", ")", "{", "TransitionFactory", "f", "=", "new", "TransitionFactory", "(", ")", ";", "f", ".", "add", "(", "new", "BootVM", ".", "Builder", "(", ")", ")", ";", "f", ".", "add", "(", "new", "Shut...
a new factory that embeds the default builders. @return a viable factory
[ "a", "new", "factory", "that", "embeds", "the", "default", "builders", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L131-L146
44,910
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/network/Routing.java
Routing.getMaxBW
public int getMaxBW(Node n1, Node n2) { int max = Integer.MAX_VALUE; for (Link inf : getPath(n1, n2)) { if (inf.getCapacity() < max) { max = inf.getCapacity(); } Switch sw = inf.getSwitch(); if (sw.getCapacity() >= 0 && sw.getCapacity() < m...
java
public int getMaxBW(Node n1, Node n2) { int max = Integer.MAX_VALUE; for (Link inf : getPath(n1, n2)) { if (inf.getCapacity() < max) { max = inf.getCapacity(); } Switch sw = inf.getSwitch(); if (sw.getCapacity() >= 0 && sw.getCapacity() < m...
[ "public", "int", "getMaxBW", "(", "Node", "n1", ",", "Node", "n2", ")", "{", "int", "max", "=", "Integer", ".", "MAX_VALUE", ";", "for", "(", "Link", "inf", ":", "getPath", "(", "n1", ",", "n2", ")", ")", "{", "if", "(", "inf", ".", "getCapacity"...
Get the maximal bandwidth available between two nodes. @param n1 the source node @param n2 the destination node @return the bandwidth
[ "Get", "the", "maximal", "bandwidth", "available", "between", "two", "nodes", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Routing.java#L89-L103
44,911
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/network/Routing.java
Routing.getFirstPhysicalPath
protected List<Link> getFirstPhysicalPath(List<Link> currentPath, Switch sw, Node dst) { // Iterate through the current switch's links for (Link l : net.getConnectedLinks(sw)) { // Wrong link if (currentPath.contains(l)) { continue; } // G...
java
protected List<Link> getFirstPhysicalPath(List<Link> currentPath, Switch sw, Node dst) { // Iterate through the current switch's links for (Link l : net.getConnectedLinks(sw)) { // Wrong link if (currentPath.contains(l)) { continue; } // G...
[ "protected", "List", "<", "Link", ">", "getFirstPhysicalPath", "(", "List", "<", "Link", ">", "currentPath", ",", "Switch", "sw", ",", "Node", "dst", ")", "{", "// Iterate through the current switch's links", "for", "(", "Link", "l", ":", "net", ".", "getConne...
Recursive method to get the first physical path found from a switch to a destination node. @param currentPath the current or initial path containing the link(s) crossed @param sw the current switch to browse @param dst the destination node to reach @return the ordered list of links that make the path ...
[ "Recursive", "method", "to", "get", "the", "first", "physical", "path", "found", "from", "a", "switch", "to", "a", "destination", "node", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Routing.java#L123-L153
44,912
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java
VectorPackingHeapDecorator.loadSlack
private int loadSlack(int dim, int bin) { return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB(); }
java
private int loadSlack(int dim, int bin) { return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB(); }
[ "private", "int", "loadSlack", "(", "int", "dim", ",", "int", "bin", ")", "{", "return", "p", ".", "loads", "[", "dim", "]", "[", "bin", "]", ".", "getUB", "(", ")", "-", "p", ".", "loads", "[", "dim", "]", "[", "bin", "]", ".", "getLB", "(",...
compute the load slack of a bin @param dim the dimension @param bin the bin @return the load slack of bin on dimension bin
[ "compute", "the", "load", "slack", "of", "a", "bin" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java#L65-L67
44,913
m-m-m/util
version/src/main/java/net/sf/mmm/util/version/impl/VersionIdentifierImpl.java
VersionIdentifierImpl.validate
private void validate() { if ((this.segments.length < 0) && (!this.snapshot)) { throw new IllegalArgumentException("segments.length:" + Integer.valueOf(this.segments.length)); } for (int i = 0; i < this.segments.length; i++) { if (this.segments[i] < 0) { throw new IllegalArgumentExcepti...
java
private void validate() { if ((this.segments.length < 0) && (!this.snapshot)) { throw new IllegalArgumentException("segments.length:" + Integer.valueOf(this.segments.length)); } for (int i = 0; i < this.segments.length; i++) { if (this.segments[i] < 0) { throw new IllegalArgumentExcepti...
[ "private", "void", "validate", "(", ")", "{", "if", "(", "(", "this", ".", "segments", ".", "length", "<", "0", ")", "&&", "(", "!", "this", ".", "snapshot", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"segments.length:\"", "+", "...
This method validates the consistency of this version identifier.
[ "This", "method", "validates", "the", "consistency", "of", "this", "version", "identifier", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/version/src/main/java/net/sf/mmm/util/version/impl/VersionIdentifierImpl.java#L98-L119
44,914
jMotif/GI
src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
RulePrunerFactory.computeGrammarSize
public static Integer computeGrammarSize(GrammarRules rules, Integer paaSize) { // The final grammar's size in BYTES // int res = 0; // The final size is the sum of the sizes of all rules // for (GrammarRuleRecord r : rules) { String ruleStr = r.getRuleString(); String[] tokens = r...
java
public static Integer computeGrammarSize(GrammarRules rules, Integer paaSize) { // The final grammar's size in BYTES // int res = 0; // The final size is the sum of the sizes of all rules // for (GrammarRuleRecord r : rules) { String ruleStr = r.getRuleString(); String[] tokens = r...
[ "public", "static", "Integer", "computeGrammarSize", "(", "GrammarRules", "rules", ",", "Integer", "paaSize", ")", "{", "// The final grammar's size in BYTES", "//", "int", "res", "=", "0", ";", "// The final size is the sum of the sizes of all rules", "//", "for", "(", ...
Computes the size of a normal, i.e. unpruned grammar. @param rules the grammar rules. @param paaSize the SAX transform word size. @return the grammar size, in BYTES.
[ "Computes", "the", "size", "of", "a", "normal", "i", ".", "e", ".", "unpruned", "grammar", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java#L26-L42
44,915
jMotif/GI
src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
RulePrunerFactory.performPruning
public static GrammarRules performPruning(double[] ts, GrammarRules grammarRules) { RulePruningAlgorithm pruner = new RulePruningAlgorithm(grammarRules, ts.length); pruner.pruneRules(); return pruner.regularizePrunedRules(); }
java
public static GrammarRules performPruning(double[] ts, GrammarRules grammarRules) { RulePruningAlgorithm pruner = new RulePruningAlgorithm(grammarRules, ts.length); pruner.pruneRules(); return pruner.regularizePrunedRules(); }
[ "public", "static", "GrammarRules", "performPruning", "(", "double", "[", "]", "ts", ",", "GrammarRules", "grammarRules", ")", "{", "RulePruningAlgorithm", "pruner", "=", "new", "RulePruningAlgorithm", "(", "grammarRules", ",", "ts", ".", "length", ")", ";", "pr...
Performs pruning. @param ts the input time series. @param grammarRules the grammar. @return pruned ruleset.
[ "Performs", "pruning", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java#L68-L72
44,916
jMotif/GI
src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
RulePrunerFactory.computeCover
public static double computeCover(boolean[] cover) { int covered = 0; for (boolean i : cover) { if (i) { covered++; } } return (double) covered / (double) cover.length; }
java
public static double computeCover(boolean[] cover) { int covered = 0; for (boolean i : cover) { if (i) { covered++; } } return (double) covered / (double) cover.length; }
[ "public", "static", "double", "computeCover", "(", "boolean", "[", "]", "cover", ")", "{", "int", "covered", "=", "0", ";", "for", "(", "boolean", "i", ":", "cover", ")", "{", "if", "(", "i", ")", "{", "covered", "++", ";", "}", "}", "return", "(...
Compute the covered percentage. @param cover the cover array. @return coverage percentage.
[ "Compute", "the", "covered", "percentage", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java#L214-L222
44,917
protegeproject/jpaul
src/main/java/jpaul/RegExps/NFASimplifier.java
NFASimplifier.compatible
private boolean compatible(int i, int j, Set<Integer> T[][]) { if(s2comp[i] != s2comp[j]) return false; for(int k = 0; k < nbLabels; k++) { if(! T[i][k].equals(T[j][k])) return false; } return true; }
java
private boolean compatible(int i, int j, Set<Integer> T[][]) { if(s2comp[i] != s2comp[j]) return false; for(int k = 0; k < nbLabels; k++) { if(! T[i][k].equals(T[j][k])) return false; } return true; }
[ "private", "boolean", "compatible", "(", "int", "i", ",", "int", "j", ",", "Set", "<", "Integer", ">", "T", "[", "]", "[", "]", ")", "{", "if", "(", "s2comp", "[", "i", "]", "!=", "s2comp", "[", "j", "]", ")", "return", "false", ";", "for", "...
transition in the same components
[ "transition", "in", "the", "same", "components" ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/RegExps/NFASimplifier.java#L179-L185
44,918
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/NamingService.java
NamingService.register
public boolean register(E e, String name) { if (resolve.containsKey(name)) { return false; } resolve.put(name, e); rev.put(e, name); return true; }
java
public boolean register(E e, String name) { if (resolve.containsKey(name)) { return false; } resolve.put(name, e); rev.put(e, name); return true; }
[ "public", "boolean", "register", "(", "E", "e", ",", "String", "name", ")", "{", "if", "(", "resolve", ".", "containsKey", "(", "name", ")", ")", "{", "return", "false", ";", "}", "resolve", ".", "put", "(", "name", ",", "e", ")", ";", "rev", "."...
Register the name of an element. @param e the element to register @param name the element name. Must be globally unique @return {@code true} if the association has been established, {@code false} if the name is already used for another element
[ "Register", "the", "name", "of", "an", "element", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/NamingService.java#L84-L91
44,919
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/NamingService.java
NamingService.substituteVM
@Override public boolean substituteVM(VM curId, VM nextId) { if (VM.TYPE.equals(elemId)) { if (rev.containsKey(nextId)) { //the new id already exists. It is a failure scenario. return false; } String fqn = rev.remove(curId); if...
java
@Override public boolean substituteVM(VM curId, VM nextId) { if (VM.TYPE.equals(elemId)) { if (rev.containsKey(nextId)) { //the new id already exists. It is a failure scenario. return false; } String fqn = rev.remove(curId); if...
[ "@", "Override", "public", "boolean", "substituteVM", "(", "VM", "curId", ",", "VM", "nextId", ")", "{", "if", "(", "VM", ".", "TYPE", ".", "equals", "(", "elemId", ")", ")", "{", "if", "(", "rev", ".", "containsKey", "(", "nextId", ")", ")", "{", ...
Re-associate the name of a registered VM to a new VM. @param curId the current VM identifier @param nextId the new VM identifier @return {@code true} if the re-association succeeded or if there is no VM {@code curId} registered. {@code false} if {@code nextId} is already associated to a name
[ "Re", "-", "associate", "the", "name", "of", "a", "registered", "VM", "to", "a", "new", "VM", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/NamingService.java#L130-L146
44,920
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/NamingService.java
NamingService.getVMNames
@SuppressWarnings("unchecked") public static NamingService<VM> getVMNames(Model mo) { return (NamingService<VM>) mo.getView(ID + VM.TYPE); }
java
@SuppressWarnings("unchecked") public static NamingService<VM> getVMNames(Model mo) { return (NamingService<VM>) mo.getView(ID + VM.TYPE); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "NamingService", "<", "VM", ">", "getVMNames", "(", "Model", "mo", ")", "{", "return", "(", "NamingService", "<", "VM", ">", ")", "mo", ".", "getView", "(", "ID", "+", "VM", ".", "...
Get the naming service for the VMs associated to a model. @param mo the model to look at @return the view if attached. {@code null} otherwise
[ "Get", "the", "naming", "service", "for", "the", "VMs", "associated", "to", "a", "model", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/NamingService.java#L213-L216
44,921
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/NamingService.java
NamingService.getNodeNames
@SuppressWarnings("unchecked") public static NamingService<Node> getNodeNames(Model mo) { return (NamingService<Node>) mo.getView(ID + Node.TYPE); }
java
@SuppressWarnings("unchecked") public static NamingService<Node> getNodeNames(Model mo) { return (NamingService<Node>) mo.getView(ID + Node.TYPE); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "NamingService", "<", "Node", ">", "getNodeNames", "(", "Model", "mo", ")", "{", "return", "(", "NamingService", "<", "Node", ">", ")", "mo", ".", "getView", "(", "ID", "+", "Node", ...
Get the naming service for the nodes associated to a model. @param mo the model to look at @return the view if attached. {@code null} otherwise
[ "Get", "the", "naming", "service", "for", "the", "nodes", "associated", "to", "a", "model", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/NamingService.java#L224-L227
44,922
btrplace/scheduler
api/src/main/java/org/btrplace/plan/event/Action.java
Action.applyEvents
public boolean applyEvents(Hook k, Model i) { for (Event n : getEvents(k)) { if (!n.apply(i)) { return false; } } return true; }
java
public boolean applyEvents(Hook k, Model i) { for (Event n : getEvents(k)) { if (!n.apply(i)) { return false; } } return true; }
[ "public", "boolean", "applyEvents", "(", "Hook", "k", ",", "Model", "i", ")", "{", "for", "(", "Event", "n", ":", "getEvents", "(", "k", ")", ")", "{", "if", "(", "!", "n", ".", "apply", "(", "i", ")", ")", "{", "return", "false", ";", "}", "...
Apply the events attached to a given hook. @param k the hook @param i the model to modify with the application of the events @return {@code true} iff all the events were applied successfully
[ "Apply", "the", "events", "attached", "to", "a", "given", "hook", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/Action.java#L107-L114
44,923
btrplace/scheduler
api/src/main/java/org/btrplace/plan/event/Action.java
Action.addEvent
public boolean addEvent(Hook k, Event n) { Set<Event> l = events.get(k); if (l == null) { l = new HashSet<>(); events.put(k, l); } return l.add(n); }
java
public boolean addEvent(Hook k, Event n) { Set<Event> l = events.get(k); if (l == null) { l = new HashSet<>(); events.put(k, l); } return l.add(n); }
[ "public", "boolean", "addEvent", "(", "Hook", "k", ",", "Event", "n", ")", "{", "Set", "<", "Event", ">", "l", "=", "events", ".", "get", "(", "k", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "new", "HashSet", "<>", "(", ")", ...
Add an event to the action. The moment the event will be executed depends on its hook. @param k the hook @param n the event to attach @return {@code true} iff the event was added
[ "Add", "an", "event", "to", "the", "action", ".", "The", "moment", "the", "event", "will", "be", "executed", "depends", "on", "its", "hook", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/Action.java#L151-L158
44,924
btrplace/scheduler
api/src/main/java/org/btrplace/plan/event/Action.java
Action.getEvents
public Set<Event> getEvents(Hook k) { Set<Event> l = events.get(k); return l == null ? Collections.emptySet() : l; }
java
public Set<Event> getEvents(Hook k) { Set<Event> l = events.get(k); return l == null ? Collections.emptySet() : l; }
[ "public", "Set", "<", "Event", ">", "getEvents", "(", "Hook", "k", ")", "{", "Set", "<", "Event", ">", "l", "=", "events", ".", "get", "(", "k", ")", ";", "return", "l", "==", "null", "?", "Collections", ".", "emptySet", "(", ")", ":", "l", ";"...
Get the events attached to a specific hook. @param k the hook @return a list of events that may be empty
[ "Get", "the", "events", "attached", "to", "a", "specific", "hook", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/Action.java#L166-L169
44,925
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultAliasedCumulatives.java
DefaultAliasedCumulatives.addDim
@Override public void addDim(int c, int[] cUse, IntVar[] dUse, int[] alias) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); aliases.add(alias); }
java
@Override public void addDim(int c, int[] cUse, IntVar[] dUse, int[] alias) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); aliases.add(alias); }
[ "@", "Override", "public", "void", "addDim", "(", "int", "c", ",", "int", "[", "]", "cUse", ",", "IntVar", "[", "]", "dUse", ",", "int", "[", "]", "alias", ")", "{", "capacities", ".", "add", "(", "c", ")", ";", "cUsages", ".", "add", "(", "cUs...
Add a constraint @param c the cumulative capacity of the aliased resources @param cUse the usage of each of the c-slices @param dUse the usage of each of the d-slices @param alias the resource identifiers that compose the alias
[ "Add", "a", "constraint" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultAliasedCumulatives.java#L68-L74
44,926
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultAliasedCumulatives.java
DefaultAliasedCumulatives.beforeSolve
@Override public boolean beforeSolve(ReconfigurationProblem r) { super.beforeSolve(r); for (int i = 0; i < aliases.size(); i++) { int capa = capacities.get(i); int[] alias = aliases.get(i); int[] cUse = cUsages.get(i); int[] dUses = new int[dUsages.get...
java
@Override public boolean beforeSolve(ReconfigurationProblem r) { super.beforeSolve(r); for (int i = 0; i < aliases.size(); i++) { int capa = capacities.get(i); int[] alias = aliases.get(i); int[] cUse = cUsages.get(i); int[] dUses = new int[dUsages.get...
[ "@", "Override", "public", "boolean", "beforeSolve", "(", "ReconfigurationProblem", "r", ")", "{", "super", ".", "beforeSolve", "(", "r", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "aliases", ".", "size", "(", ")", ";", "i", "++", "...
Get the generated constraints. @return a list of constraint that may be empty.
[ "Get", "the", "generated", "constraints", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultAliasedCumulatives.java#L81-L100
44,927
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/ChocoViews.java
ChocoViews.resolveDependencies
public static List<ChocoView> resolveDependencies(Model mo, List<ChocoView> views, Collection<String> base) throws SchedulerException { Set<String> done = new HashSet<>(base); List<ChocoView> remaining = new ArrayList<>(views); List<ChocoView> solved = new ArrayList<>(); while (!remainin...
java
public static List<ChocoView> resolveDependencies(Model mo, List<ChocoView> views, Collection<String> base) throws SchedulerException { Set<String> done = new HashSet<>(base); List<ChocoView> remaining = new ArrayList<>(views); List<ChocoView> solved = new ArrayList<>(); while (!remainin...
[ "public", "static", "List", "<", "ChocoView", ">", "resolveDependencies", "(", "Model", "mo", ",", "List", "<", "ChocoView", ">", "views", ",", "Collection", "<", "String", ">", "base", ")", "throws", "SchedulerException", "{", "Set", "<", "String", ">", "...
Flatten the views while considering their dependencies. Operations over the views that respect the iteration order, satisfies the dependencies. @param mo the model @param views the associated solver views @return the list of views, dependency-free @throws SchedulerException if there is a cyclic dependency
[ "Flatten", "the", "views", "while", "considering", "their", "dependencies", ".", "Operations", "over", "the", "views", "that", "respect", "the", "iteration", "order", "satisfies", "the", "dependencies", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/ChocoViews.java#L52-L73
44,928
jMotif/GI
src/main/java/net/seninp/gi/logic/GIUtils.java
GIUtils.getZeroIntervals
public static List<RuleInterval> getZeroIntervals(int[] coverageArray) { ArrayList<RuleInterval> res = new ArrayList<RuleInterval>(); int start = -1; boolean inInterval = false; int intervalsCounter = -1; // slide over the array from left to the right // for (int i = 0; i < coverageArray....
java
public static List<RuleInterval> getZeroIntervals(int[] coverageArray) { ArrayList<RuleInterval> res = new ArrayList<RuleInterval>(); int start = -1; boolean inInterval = false; int intervalsCounter = -1; // slide over the array from left to the right // for (int i = 0; i < coverageArray....
[ "public", "static", "List", "<", "RuleInterval", ">", "getZeroIntervals", "(", "int", "[", "]", "coverageArray", ")", "{", "ArrayList", "<", "RuleInterval", ">", "res", "=", "new", "ArrayList", "<", "RuleInterval", ">", "(", ")", ";", "int", "start", "=", ...
Run a quick scan along the time series coverage to find a zeroed intervals. @param coverageArray the coverage to analyze. @return set of zeroed intervals (if found).
[ "Run", "a", "quick", "scan", "along", "the", "time", "series", "coverage", "to", "find", "a", "zeroed", "intervals", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/logic/GIUtils.java#L42-L74
44,929
jMotif/GI
src/main/java/net/seninp/gi/logic/GIUtils.java
GIUtils.getCoverAsFraction
public static double getCoverAsFraction(int seriesLength, GrammarRules rules) { boolean[] coverageArray = new boolean[seriesLength]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals(); for (R...
java
public static double getCoverAsFraction(int seriesLength, GrammarRules rules) { boolean[] coverageArray = new boolean[seriesLength]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals(); for (R...
[ "public", "static", "double", "getCoverAsFraction", "(", "int", "seriesLength", ",", "GrammarRules", "rules", ")", "{", "boolean", "[", "]", "coverageArray", "=", "new", "boolean", "[", "seriesLength", "]", ";", "for", "(", "GrammarRuleRecord", "rule", ":", "r...
Computes which fraction of the time series is covered by the rules set. @param seriesLength the time series length. @param rules the grammar rules set. @return a fraction covered by the rules.
[ "Computes", "which", "fraction", "of", "the", "time", "series", "is", "covered", "by", "the", "rules", "set", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/logic/GIUtils.java#L83-L108
44,930
jMotif/GI
src/main/java/net/seninp/gi/logic/GIUtils.java
GIUtils.getMeanRuleCoverage
public static double getMeanRuleCoverage(int length, GrammarRules rules) { // get the coverage array // int[] coverageArray = new int[length]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals...
java
public static double getMeanRuleCoverage(int length, GrammarRules rules) { // get the coverage array // int[] coverageArray = new int[length]; for (GrammarRuleRecord rule : rules) { if (0 == rule.ruleNumber()) { continue; } ArrayList<RuleInterval> arrPos = rule.getRuleIntervals...
[ "public", "static", "double", "getMeanRuleCoverage", "(", "int", "length", ",", "GrammarRules", "rules", ")", "{", "// get the coverage array", "//", "int", "[", "]", "coverageArray", "=", "new", "int", "[", "length", "]", ";", "for", "(", "GrammarRuleRecord", ...
Gets the mean rule coverage. @param length the original time-series length. @param rules the grammar rules set. @return the mean rule coverage.
[ "Gets", "the", "mean", "rule", "coverage", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/logic/GIUtils.java#L117-L147
44,931
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuildsAccessor.java
LayerBuildsAccessor.removeLayerFromCache
public void removeLayerFromCache(LayerImpl layer) { if (layer.getId() != layerId) { throw new IllegalStateException(); } LayerCacheImpl layerCache = layerCacheRef.get(); if (layerCache != null) { layerCache.remove(layer.getKey(), layer); } }
java
public void removeLayerFromCache(LayerImpl layer) { if (layer.getId() != layerId) { throw new IllegalStateException(); } LayerCacheImpl layerCache = layerCacheRef.get(); if (layerCache != null) { layerCache.remove(layer.getKey(), layer); } }
[ "public", "void", "removeLayerFromCache", "(", "LayerImpl", "layer", ")", "{", "if", "(", "layer", ".", "getId", "(", ")", "!=", "layerId", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "LayerCacheImpl", "layerCache", "=", "layerCach...
Convenience method to remove the layer that this class is associated with from the layer cache. @param layer The layer to remove. The id of the specified layer must be the same as <code>layerId</code> or else a {@link IllegalStateException} is thrown
[ "Convenience", "method", "to", "remove", "the", "layer", "that", "this", "class", "is", "associated", "with", "from", "the", "layer", "cache", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuildsAccessor.java#L288-L296
44,932
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.put
public final V put(K key, V value) { BinTreeNode<K,V> prev = null; BinTreeNode<K,V> node = root; int key_hash_code = key.hashCode(); while(node != null) { prev = node; if(key_hash_code < node.keyHashCode) { node = node.left; } else { if((key_hash_code > node.keyHashCode) || !node.key.equals...
java
public final V put(K key, V value) { BinTreeNode<K,V> prev = null; BinTreeNode<K,V> node = root; int key_hash_code = key.hashCode(); while(node != null) { prev = node; if(key_hash_code < node.keyHashCode) { node = node.left; } else { if((key_hash_code > node.keyHashCode) || !node.key.equals...
[ "public", "final", "V", "put", "(", "K", "key", ",", "V", "value", ")", "{", "BinTreeNode", "<", "K", ",", "V", ">", "prev", "=", "null", ";", "BinTreeNode", "<", "K", ",", "V", ">", "node", "=", "root", ";", "int", "key_hash_code", "=", "key", ...
Associates the specified value with the specified key in this map.
[ "Associates", "the", "specified", "value", "with", "the", "specified", "key", "in", "this", "map", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L103-L145
44,933
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.remove_semi_leaf
private final V remove_semi_leaf(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(prev == null) { root = m; } else { if(son == 0) prev.left = m; else prev.right = m; } return node.value; }
java
private final V remove_semi_leaf(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(prev == null) { root = m; } else { if(son == 0) prev.left = m; else prev.right = m; } return node.value; }
[ "private", "final", "V", "remove_semi_leaf", "(", "BinTreeNode", "<", "K", ",", "V", ">", "node", ",", "BinTreeNode", "<", "K", ",", "V", ">", "prev", ",", "int", "son", ",", "BinTreeNode", "<", "K", ",", "V", ">", "m", ")", "{", "if", "(", "prev...
to the only predecessor of node that could exist.
[ "to", "the", "only", "predecessor", "of", "node", "that", "could", "exist", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L204-L217
44,934
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.finish_removal
private final V finish_removal(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(m != null) { // set up the links for m m.left = node.left; m.right = node.right; } if(prev == null) root = m; else { if(son == 0) prev.left = m; else prev.right = m; }...
java
private final V finish_removal(BinTreeNode<K,V> node, BinTreeNode<K,V> prev, int son, BinTreeNode<K,V> m) { if(m != null) { // set up the links for m m.left = node.left; m.right = node.right; } if(prev == null) root = m; else { if(son == 0) prev.left = m; else prev.right = m; }...
[ "private", "final", "V", "finish_removal", "(", "BinTreeNode", "<", "K", ",", "V", ">", "node", ",", "BinTreeNode", "<", "K", ",", "V", ">", "prev", ",", "int", "son", ",", "BinTreeNode", "<", "K", ",", "V", ">", "m", ")", "{", "if", "(", "m", ...
BinTreeNode that should replace node in the tree.
[ "BinTreeNode", "that", "should", "replace", "node", "in", "the", "tree", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L223-L239
44,935
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.extract_next
private final BinTreeNode<K,V> extract_next(BinTreeNode<K,V> node) { BinTreeNode<K,V> prev = node.right; BinTreeNode<K,V> curr = prev.left; if(curr == null) { node.right = node.right.right; return prev; } while(curr.left != null) { prev = curr; curr = curr.left; } prev.left = curr.right; ...
java
private final BinTreeNode<K,V> extract_next(BinTreeNode<K,V> node) { BinTreeNode<K,V> prev = node.right; BinTreeNode<K,V> curr = prev.left; if(curr == null) { node.right = node.right.right; return prev; } while(curr.left != null) { prev = curr; curr = curr.left; } prev.left = curr.right; ...
[ "private", "final", "BinTreeNode", "<", "K", ",", "V", ">", "extract_next", "(", "BinTreeNode", "<", "K", ",", "V", ">", "node", ")", "{", "BinTreeNode", "<", "K", ",", "V", ">", "prev", "=", "node", ".", "right", ";", "BinTreeNode", "<", "K", ",",...
removes it from that subtree and returns it.
[ "removes", "it", "from", "that", "subtree", "and", "returns", "it", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L243-L259
44,936
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.values
public final Collection<V> values() { return new AbstractCollection<V>() { public Iterator<V> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<V>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public V ...
java
public final Collection<V> values() { return new AbstractCollection<V>() { public Iterator<V> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<V>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public V ...
[ "public", "final", "Collection", "<", "V", ">", "values", "(", ")", "{", "return", "new", "AbstractCollection", "<", "V", ">", "(", ")", "{", "public", "Iterator", "<", "V", ">", "iterator", "(", ")", "{", "final", "Iterator", "<", "Map", ".", "Entry...
Returns an unmodifiable collection view of the values from this map.
[ "Returns", "an", "unmodifiable", "collection", "view", "of", "the", "values", "from", "this", "map", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L298-L312
44,937
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.entrySet
public final Set<Map.Entry<K,V>> entrySet() { return new AbstractSet<Map.Entry<K,V>>() { public Iterator<Map.Entry<K,V>> iterator() { return entryIterator(); } public int size() { return size; } }; }
java
public final Set<Map.Entry<K,V>> entrySet() { return new AbstractSet<Map.Entry<K,V>>() { public Iterator<Map.Entry<K,V>> iterator() { return entryIterator(); } public int size() { return size; } }; }
[ "public", "final", "Set", "<", "Map", ".", "Entry", "<", "K", ",", "V", ">", ">", "entrySet", "(", ")", "{", "return", "new", "AbstractSet", "<", "Map", ".", "Entry", "<", "K", ",", "V", ">", ">", "(", ")", "{", "public", "Iterator", "<", "Map"...
Returns an unmodifiable set view of the map entries.
[ "Returns", "an", "unmodifiable", "set", "view", "of", "the", "map", "entries", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L321-L331
44,938
protegeproject/jpaul
src/main/java/jpaul/DataStructs/NoCompTreeMap.java
NoCompTreeMap.keySet
public final Set<K> keySet() { return new AbstractSet<K>() { public Iterator<K> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<K>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public K next() ...
java
public final Set<K> keySet() { return new AbstractSet<K>() { public Iterator<K> iterator() { final Iterator<Map.Entry<K,V>> ite = entryIterator(); return new Iterator<K>() { public boolean hasNext() { return ite.hasNext(); } public void remove() { ite.remove(); } public K next() ...
[ "public", "final", "Set", "<", "K", ">", "keySet", "(", ")", "{", "return", "new", "AbstractSet", "<", "K", ">", "(", ")", "{", "public", "Iterator", "<", "K", ">", "iterator", "(", ")", "{", "final", "Iterator", "<", "Map", ".", "Entry", "<", "K...
Returns an unmodifiable set view of the keys contained in this map.
[ "Returns", "an", "unmodifiable", "set", "view", "of", "the", "keys", "contained", "in", "this", "map", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/NoCompTreeMap.java#L334-L348
44,939
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/ExportModuleNameCompilerPass.java
ExportModuleNameCompilerPass.processChildren
public void processChildren(Node node) { for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) { if (cursor.getType() == Token.CALL) { // The node is a function or method call Node name = cursor.getFirstChild(); if (name != null && name.getType() == Token.NAME && // n...
java
public void processChildren(Node node) { for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) { if (cursor.getType() == Token.CALL) { // The node is a function or method call Node name = cursor.getFirstChild(); if (name != null && name.getType() == Token.NAME && // n...
[ "public", "void", "processChildren", "(", "Node", "node", ")", "{", "for", "(", "Node", "cursor", "=", "node", ".", "getFirstChild", "(", ")", ";", "cursor", "!=", "null", ";", "cursor", "=", "cursor", ".", "getNext", "(", ")", ")", "{", "if", "(", ...
Recursively called to process AST nodes looking for anonymous define calls. If an anonymous define call is found, then change it be a named define call, specifying the module name for the file being processed. @param node The node being processed
[ "Recursively", "called", "to", "process", "AST", "nodes", "looking", "for", "anonymous", "define", "calls", ".", "If", "an", "anonymous", "define", "call", "is", "found", "then", "change", "it", "be", "a", "named", "define", "call", "specifying", "the", "mod...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/ExportModuleNameCompilerPass.java#L50-L81
44,940
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/MovementGraph.java
MovementGraph.getIncoming
public List<IntVar> getIncoming(Node n) { List<IntVar> l = incoming.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
java
public List<IntVar> getIncoming(Node n) { List<IntVar> l = incoming.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
[ "public", "List", "<", "IntVar", ">", "getIncoming", "(", "Node", "n", ")", "{", "List", "<", "IntVar", ">", "l", "=", "incoming", ".", "get", "(", "n", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "Collections", ".", "emptyList", ...
Get the start moment of the movements that terminate on a given node @param n the destination node @return a list of start moment. May be empty
[ "Get", "the", "start", "moment", "of", "the", "movements", "that", "terminate", "on", "a", "given", "node" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/MovementGraph.java#L101-L107
44,941
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/MovementGraph.java
MovementGraph.getOutgoing
public List<IntVar> getOutgoing(Node n) { List<IntVar> l = outgoings.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
java
public List<IntVar> getOutgoing(Node n) { List<IntVar> l = outgoings.get(n); if (l == null) { l = Collections.emptyList(); } return l; }
[ "public", "List", "<", "IntVar", ">", "getOutgoing", "(", "Node", "n", ")", "{", "List", "<", "IntVar", ">", "l", "=", "outgoings", ".", "get", "(", "n", ")", ";", "if", "(", "l", "==", "null", ")", "{", "l", "=", "Collections", ".", "emptyList",...
Get the start moment of the movements that leave from a given node @param n the source node @return a list of start moment. May be empty
[ "Get", "the", "start", "moment", "of", "the", "movements", "that", "leave", "from", "a", "given", "node" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/MovementGraph.java#L116-L123
44,942
btrplace/scheduler
api/src/main/java/org/btrplace/plan/ReconfigurationPlanChecker.java
ReconfigurationPlanChecker.checkModel
private void checkModel(Model mo, boolean start) throws SatConstraintViolationException { for (SatConstraintChecker<?> c : checkers) { if (start && !c.startsWith(mo)) { SatConstraint cs = c.getConstraint(); if (cs != null) { throw new DiscreteViola...
java
private void checkModel(Model mo, boolean start) throws SatConstraintViolationException { for (SatConstraintChecker<?> c : checkers) { if (start && !c.startsWith(mo)) { SatConstraint cs = c.getConstraint(); if (cs != null) { throw new DiscreteViola...
[ "private", "void", "checkModel", "(", "Model", "mo", ",", "boolean", "start", ")", "throws", "SatConstraintViolationException", "{", "for", "(", "SatConstraintChecker", "<", "?", ">", "c", ":", "checkers", ")", "{", "if", "(", "start", "&&", "!", "c", ".",...
Check for the validity of a model. @param mo the model to check @param start {@code true} iff the model corresponds to the origin model. Otherwise it is considered to be the resulting model @throws SatConstraintViolationException if at least one constraint is violated.
[ "Check", "for", "the", "validity", "of", "a", "model", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/ReconfigurationPlanChecker.java#L339-L353
44,943
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/ModelConverter.java
ModelConverter.toJSON
private static JSONObject toJSON(Mapping c) { JSONObject o = new JSONObject(); o.put("offlineNodes", nodesToJSON(c.getOfflineNodes())); o.put("readyVMs", vmsToJSON(c.getReadyVMs())); JSONObject ons = new JSONObject(); for (Node n : c.getOnlineNodes()) { JSONObject w ...
java
private static JSONObject toJSON(Mapping c) { JSONObject o = new JSONObject(); o.put("offlineNodes", nodesToJSON(c.getOfflineNodes())); o.put("readyVMs", vmsToJSON(c.getReadyVMs())); JSONObject ons = new JSONObject(); for (Node n : c.getOnlineNodes()) { JSONObject w ...
[ "private", "static", "JSONObject", "toJSON", "(", "Mapping", "c", ")", "{", "JSONObject", "o", "=", "new", "JSONObject", "(", ")", ";", "o", ".", "put", "(", "\"offlineNodes\"", ",", "nodesToJSON", "(", "c", ".", "getOfflineNodes", "(", ")", ")", ")", ...
Serialise the mapping. @param c the mapping @return the resulting JSONObject
[ "Serialise", "the", "mapping", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/ModelConverter.java#L120-L134
44,944
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/ModelConverter.java
ModelConverter.fillMapping
public void fillMapping(Model mo, JSONObject o) throws JSONConverterException { Mapping c = mo.getMapping(); for (Node u : newNodes(mo, o, "offlineNodes")) { c.addOfflineNode(u); } for (VM u : newVMs(mo, o, "readyVMs")) { c.addReadyVM(u); } JSONObj...
java
public void fillMapping(Model mo, JSONObject o) throws JSONConverterException { Mapping c = mo.getMapping(); for (Node u : newNodes(mo, o, "offlineNodes")) { c.addOfflineNode(u); } for (VM u : newVMs(mo, o, "readyVMs")) { c.addReadyVM(u); } JSONObj...
[ "public", "void", "fillMapping", "(", "Model", "mo", ",", "JSONObject", "o", ")", "throws", "JSONConverterException", "{", "Mapping", "c", "=", "mo", ".", "getMapping", "(", ")", ";", "for", "(", "Node", "u", ":", "newNodes", "(", "mo", ",", "o", ",", ...
Create the elements inside the model and fill the mapping. @param mo the model where to attach the elements @param o the json describing the mapping @throws JSONConverterException
[ "Create", "the", "elements", "inside", "the", "model", "and", "fill", "the", "mapping", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/ModelConverter.java#L143-L167
44,945
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/ModelConverter.java
ModelConverter.newNodes
private static Set<Node> newNodes(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<Node> s = ne...
java
private static Set<Node> newNodes(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<Node> s = ne...
[ "private", "static", "Set", "<", "Node", ">", "newNodes", "(", "Model", "mo", ",", "JSONObject", "o", ",", "String", "key", ")", "throws", "JSONConverterException", "{", "checkKeys", "(", "o", ",", "key", ")", ";", "Object", "x", "=", "o", ".", "get", ...
Build nodes from a key. @param mo the model to build @param o the object that contains the node @param key the key associated to the nodes @return the resulting set of nodes @throws JSONConverterException if at least one of the parsed node already exists
[ "Build", "nodes", "from", "a", "key", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/ModelConverter.java#L178-L194
44,946
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/ModelConverter.java
ModelConverter.newVMs
private static Set<VM> newVMs(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<VM> s = new Has...
java
private static Set<VM> newVMs(Model mo, JSONObject o, String key) throws JSONConverterException { checkKeys(o, key); Object x = o.get(key); if (!(x instanceof JSONArray)) { throw new JSONConverterException("array expected at key '" + key + "'"); } Set<VM> s = new Has...
[ "private", "static", "Set", "<", "VM", ">", "newVMs", "(", "Model", "mo", ",", "JSONObject", "o", ",", "String", "key", ")", "throws", "JSONConverterException", "{", "checkKeys", "(", "o", ",", "key", ")", ";", "Object", "x", "=", "o", ".", "get", "(...
Build VMs from a key. @param mo the model to build @param o the object that contains the vm @param key the key associated to the VMs @return the resulting set of VMs @throws JSONConverterException if at least one of the parsed VM already exists
[ "Build", "VMs", "from", "a", "key", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/ModelConverter.java#L205-L222
44,947
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java
ModuleDeps.add
public boolean add(String key, ModuleDepInfo info) { if (info == null) { throw new NullPointerException(); } boolean modified = false; ModuleDepInfo existing = get(key); if (!containsKey(key) || existing != info) { if (existing != null) { modified = existing.add(info); } else { supe...
java
public boolean add(String key, ModuleDepInfo info) { if (info == null) { throw new NullPointerException(); } boolean modified = false; ModuleDepInfo existing = get(key); if (!containsKey(key) || existing != info) { if (existing != null) { modified = existing.add(info); } else { supe...
[ "public", "boolean", "add", "(", "String", "key", ",", "ModuleDepInfo", "info", ")", "{", "if", "(", "info", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "boolean", "modified", "=", "false", ";", "ModuleDepInfo", "e...
Adds the specified pair to the map. If an entry for the key exists, then the specified module dep info is added to the existing module dep info. @param key The module name to associate with the dep info object @param info the ModuleDepInfo object @return true if the map was modified
[ "Adds", "the", "specified", "pair", "to", "the", "map", ".", "If", "an", "entry", "for", "the", "key", "exists", "then", "the", "specified", "module", "dep", "info", "is", "added", "to", "the", "existing", "module", "dep", "info", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java#L66-L81
44,948
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java
ModuleDeps.addAll
public boolean addAll(ModuleDeps other) { boolean modified = false; for (Map.Entry<String, ModuleDepInfo> entry : other.entrySet()) { modified |= add(entry.getKey(), new ModuleDepInfo(entry.getValue())); } return modified; }
java
public boolean addAll(ModuleDeps other) { boolean modified = false; for (Map.Entry<String, ModuleDepInfo> entry : other.entrySet()) { modified |= add(entry.getKey(), new ModuleDepInfo(entry.getValue())); } return modified; }
[ "public", "boolean", "addAll", "(", "ModuleDeps", "other", ")", "{", "boolean", "modified", "=", "false", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "ModuleDepInfo", ">", "entry", ":", "other", ".", "entrySet", "(", ")", ")", "{", "modif...
Adds all of the map entries from other to this map @param other the map containing entries to add @return true if the map was modified
[ "Adds", "all", "of", "the", "map", "entries", "from", "other", "to", "this", "map" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDeps.java#L90-L96
44,949
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.minVMAllocation
public int minVMAllocation(int vmIdx, int v) { int vv = Math.max(v, vmAllocation.get(vmIdx)); vmAllocation.set(vmIdx, vv); return vv; }
java
public int minVMAllocation(int vmIdx, int v) { int vv = Math.max(v, vmAllocation.get(vmIdx)); vmAllocation.set(vmIdx, vv); return vv; }
[ "public", "int", "minVMAllocation", "(", "int", "vmIdx", ",", "int", "v", ")", "{", "int", "vv", "=", "Math", ".", "max", "(", "v", ",", "vmAllocation", ".", "get", "(", "vmIdx", ")", ")", ";", "vmAllocation", ".", "set", "(", "vmIdx", ",", "vv", ...
Change the VM resource allocation. @param vmIdx the VM identifier @param v the amount to ask. @return the retained value. May be bigger than {@code v} if a previous call asks for more
[ "Change", "the", "VM", "resource", "allocation", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L221-L225
44,950
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.capOverbookRatio
public double capOverbookRatio(int nIdx, double d) { if (d < 1) { return ratios.get(nIdx); } double v = Math.min(ratios.get(nIdx), d); ratios.set(nIdx, v); return v; }
java
public double capOverbookRatio(int nIdx, double d) { if (d < 1) { return ratios.get(nIdx); } double v = Math.min(ratios.get(nIdx), d); ratios.set(nIdx, v); return v; }
[ "public", "double", "capOverbookRatio", "(", "int", "nIdx", ",", "double", "d", ")", "{", "if", "(", "d", "<", "1", ")", "{", "return", "ratios", ".", "get", "(", "nIdx", ")", ";", "}", "double", "v", "=", "Math", ".", "min", "(", "ratios", ".", ...
Cap the overbooking ratio for a given node. @param nIdx the node @param d the new ratio. {@code >= 1} @return the resulting ratio. Will be lower than {@code d} if a previous cap stated a lower value
[ "Cap", "the", "overbooking", "ratio", "for", "a", "given", "node", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L243-L250
44,951
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.beforeSolve
@Override public boolean beforeSolve(ReconfigurationProblem p) throws SchedulerException { for (VM vm : source.getMapping().getAllVMs()) { int vmId = p.getVM(vm); int v = getVMAllocation(vmId); if (v < 0) { int prevUsage = rc.getConsumption(vm); ...
java
@Override public boolean beforeSolve(ReconfigurationProblem p) throws SchedulerException { for (VM vm : source.getMapping().getAllVMs()) { int vmId = p.getVM(vm); int v = getVMAllocation(vmId); if (v < 0) { int prevUsage = rc.getConsumption(vm); ...
[ "@", "Override", "public", "boolean", "beforeSolve", "(", "ReconfigurationProblem", "p", ")", "throws", "SchedulerException", "{", "for", "(", "VM", "vm", ":", "source", ".", "getMapping", "(", ")", ".", "getAllVMs", "(", ")", ")", "{", "int", "vmId", "=",...
Set the resource usage for each of the VM. If the LB is < 0 , the previous consumption is used to maintain the resource usage. Otherwise, the usage is set to the variable lower bound. @return false if an operation leads to a problem without solution
[ "Set", "the", "resource", "usage", "for", "each", "of", "the", "VM", ".", "If", "the", "LB", "is", "<", "0", "the", "previous", "consumption", "is", "used", "to", "maintain", "the", "resource", "usage", ".", "Otherwise", "the", "usage", "is", "set", "t...
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L269-L300
44,952
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.capHosting
private boolean capHosting(int nIdx, int min, int nbZeroes) { Node n = rp.getNode(nIdx); double capa = getSourceResource().getCapacity(n) * getOverbookRatio(nIdx)/*.getLB()*/; int card = (int) (capa / min) + nbZeroes + 1; if (card < source.getMapping().getRunningVMs(n).size()) { // T...
java
private boolean capHosting(int nIdx, int min, int nbZeroes) { Node n = rp.getNode(nIdx); double capa = getSourceResource().getCapacity(n) * getOverbookRatio(nIdx)/*.getLB()*/; int card = (int) (capa / min) + nbZeroes + 1; if (card < source.getMapping().getRunningVMs(n).size()) { // T...
[ "private", "boolean", "capHosting", "(", "int", "nIdx", ",", "int", "min", ",", "int", "nbZeroes", ")", "{", "Node", "n", "=", "rp", ".", "getNode", "(", "nIdx", ")", ";", "double", "capa", "=", "getSourceResource", "(", ")", ".", "getCapacity", "(", ...
Reduce the cardinality wrt. the worst case scenario. @param nIdx the node index @param min the min (but > 0 ) consumption for a VM @param nbZeroes the number of VMs consuming 0 @return {@code false} if the problem no longer has a solution
[ "Reduce", "the", "cardinality", "wrt", ".", "the", "worst", "case", "scenario", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L372-L390
44,953
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.checkInitialSatisfaction
private void checkInitialSatisfaction() { //Seems to me we don't support ratio change for (Node n : rp.getSourceModel().getMapping().getOnlineNodes()) { int nIdx = rp.getNode(n); double ratio = getOverbookRatio(nIdx)/*.getLB()*/; double capa = getSourceResource().getC...
java
private void checkInitialSatisfaction() { //Seems to me we don't support ratio change for (Node n : rp.getSourceModel().getMapping().getOnlineNodes()) { int nIdx = rp.getNode(n); double ratio = getOverbookRatio(nIdx)/*.getLB()*/; double capa = getSourceResource().getC...
[ "private", "void", "checkInitialSatisfaction", "(", ")", "{", "//Seems to me we don't support ratio change", "for", "(", "Node", "n", ":", "rp", ".", "getSourceModel", "(", ")", ".", "getMapping", "(", ")", ".", "getOnlineNodes", "(", ")", ")", "{", "int", "nI...
Check if the initial capacity > sum current consumption The ratio is instantiated now so the computation is correct
[ "Check", "if", "the", "initial", "capacity", ">", "sum", "current", "consumption", "The", "ratio", "is", "instantiated", "now", "so", "the", "computation", "is", "correct" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L444-L460
44,954
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java
CShareableResource.getWeights
public static TObjectIntMap<VM> getWeights(ReconfigurationProblem rp, List<CShareableResource> rcs) { Model mo = rp.getSourceModel(); int[] capa = new int[rcs.size()]; int[] cons = new int[rcs.size()]; TObjectIntMap<VM> cost = new TObjectIntHashMap<>(); for (Node n : mo.getMappi...
java
public static TObjectIntMap<VM> getWeights(ReconfigurationProblem rp, List<CShareableResource> rcs) { Model mo = rp.getSourceModel(); int[] capa = new int[rcs.size()]; int[] cons = new int[rcs.size()]; TObjectIntMap<VM> cost = new TObjectIntHashMap<>(); for (Node n : mo.getMappi...
[ "public", "static", "TObjectIntMap", "<", "VM", ">", "getWeights", "(", "ReconfigurationProblem", "rp", ",", "List", "<", "CShareableResource", ">", "rcs", ")", "{", "Model", "mo", "=", "rp", ".", "getSourceModel", "(", ")", ";", "int", "[", "]", "capa", ...
Estimate the weight of each VMs with regards to multiple dimensions. In practice, it sums the normalised size of each VM against the total capacity @param rp the problem to solve @param rcs the resources to consider @return a weight per VM
[ "Estimate", "the", "weight", "of", "each", "VMs", "with", "regards", "to", "multiple", "dimensions", ".", "In", "practice", "it", "sums", "the", "normalised", "size", "of", "each", "VM", "against", "the", "total", "capacity" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L596-L626
44,955
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java
DefaultReconfigurationProblem.distinctVMStates
private boolean distinctVMStates() { boolean ok = vms.size() == running.size() + sleeping.size() + ready.size() + killed.size(); //It is sure there is no solution as a VM cannot have multiple destination state Map<VM, VMState> states = new HashMap<>(); for (VM v : running) { ...
java
private boolean distinctVMStates() { boolean ok = vms.size() == running.size() + sleeping.size() + ready.size() + killed.size(); //It is sure there is no solution as a VM cannot have multiple destination state Map<VM, VMState> states = new HashMap<>(); for (VM v : running) { ...
[ "private", "boolean", "distinctVMStates", "(", ")", "{", "boolean", "ok", "=", "vms", ".", "size", "(", ")", "==", "running", ".", "size", "(", ")", "+", "sleeping", ".", "size", "(", ")", "+", "ready", ".", "size", "(", ")", "+", "killed", ".", ...
Check if every VM has a single destination state @return {@code true} if states are distinct
[ "Check", "if", "every", "VM", "has", "a", "single", "destination", "state" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L244-L273
44,956
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java
DefaultReconfigurationProblem.buildReconfigurationPlan
@Override @SuppressWarnings("squid:S3346") public ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src) throws SchedulerException { ReconfigurationPlan plan = new DefaultReconfigurationPlan(src); for (NodeTransition action : nodeActions) { action.insertActions(s, plan);...
java
@Override @SuppressWarnings("squid:S3346") public ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src) throws SchedulerException { ReconfigurationPlan plan = new DefaultReconfigurationPlan(src); for (NodeTransition action : nodeActions) { action.insertActions(s, plan);...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"squid:S3346\"", ")", "public", "ReconfigurationPlan", "buildReconfigurationPlan", "(", "Solution", "s", ",", "Model", "src", ")", "throws", "SchedulerException", "{", "ReconfigurationPlan", "plan", "=", "new", "Default...
Build a plan for a solution. @param s the solution @param src the source model @return the resulting plan @throws SchedulerException if a error occurred
[ "Build", "a", "plan", "for", "a", "solution", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L304-L319
44,957
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java
DefaultReconfigurationProblem.defaultHeuristic
private void defaultHeuristic() { IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true)); SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true); RealStrategy realStrat = new RealStrate...
java
private void defaultHeuristic() { IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true)); SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true); RealStrategy realStrat = new RealStrate...
[ "private", "void", "defaultHeuristic", "(", ")", "{", "IntStrategy", "intStrat", "=", "Search", ".", "intVarSearch", "(", "new", "FirstFail", "(", "csp", ")", ",", "new", "IntDomainMin", "(", ")", ",", "csp", ".", "retrieveIntVars", "(", "true", ")", ")", ...
A naive heuristic to be sure every variables will be instantiated.
[ "A", "naive", "heuristic", "to", "be", "sure", "every", "variables", "will", "be", "instantiated", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L324-L329
44,958
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java
DefaultReconfigurationProblem.makeCardinalityVariables
private void makeCardinalityVariables() { vmsCountOnNodes = new ArrayList<>(nodes.size()); int nbVMs = vms.size(); for (Node n : nodes) { vmsCountOnNodes.add(csp.intVar(makeVarLabel("nbVMsOn('", n, "')"), 0, nbVMs, true)); } vmsCountOnNodes = Collections.unmodifiableL...
java
private void makeCardinalityVariables() { vmsCountOnNodes = new ArrayList<>(nodes.size()); int nbVMs = vms.size(); for (Node n : nodes) { vmsCountOnNodes.add(csp.intVar(makeVarLabel("nbVMsOn('", n, "')"), 0, nbVMs, true)); } vmsCountOnNodes = Collections.unmodifiableL...
[ "private", "void", "makeCardinalityVariables", "(", ")", "{", "vmsCountOnNodes", "=", "new", "ArrayList", "<>", "(", "nodes", ".", "size", "(", ")", ")", ";", "int", "nbVMs", "=", "vms", ".", "size", "(", ")", ";", "for", "(", "Node", "n", ":", "node...
Create the cardinality variables.
[ "Create", "the", "cardinality", "variables", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L367-L374
44,959
btrplace/scheduler
api/src/main/java/org/btrplace/plan/DefaultReconfigurationPlan.java
DefaultReconfigurationPlan.iterator
@Override public Iterator<Action> iterator() { Set<Action> sorted = new TreeSet<>(startFirstComparator); sorted.addAll(actions); return sorted.iterator(); }
java
@Override public Iterator<Action> iterator() { Set<Action> sorted = new TreeSet<>(startFirstComparator); sorted.addAll(actions); return sorted.iterator(); }
[ "@", "Override", "public", "Iterator", "<", "Action", ">", "iterator", "(", ")", "{", "Set", "<", "Action", ">", "sorted", "=", "new", "TreeSet", "<>", "(", "startFirstComparator", ")", ";", "sorted", ".", "addAll", "(", "actions", ")", ";", "return", ...
Iterate over the actions. The action are automatically sorted increasingly by their starting moment. @return an iterator.
[ "Iterate", "over", "the", "actions", ".", "The", "action", "are", "automatically", "sorted", "increasingly", "by", "their", "starting", "moment", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/DefaultReconfigurationPlan.java#L115-L120
44,960
InsightLab/graphast
core/src/main/java/br/ufc/insightlab/graphast/structure/MMapGraphStructure.java
MMapGraphStructure.addDirectionalEdge
private void addDirectionalEdge(Edge e) { if (edgeAccess.getCapacity() < getEdgeIndex(edgePos) + EDGE_SIZE) edgeAccess.ensureCapacity(edgeAccess.getCapacity() + INITIAL_EDGE_FILE_SIZE); long fromId = nodIdMapping.get(e.getFromNodeId()); long toId = nodIdMapping.get(e.getToNodeId()); long fromIndex...
java
private void addDirectionalEdge(Edge e) { if (edgeAccess.getCapacity() < getEdgeIndex(edgePos) + EDGE_SIZE) edgeAccess.ensureCapacity(edgeAccess.getCapacity() + INITIAL_EDGE_FILE_SIZE); long fromId = nodIdMapping.get(e.getFromNodeId()); long toId = nodIdMapping.get(e.getToNodeId()); long fromIndex...
[ "private", "void", "addDirectionalEdge", "(", "Edge", "e", ")", "{", "if", "(", "edgeAccess", ".", "getCapacity", "(", ")", "<", "getEdgeIndex", "(", "edgePos", ")", "+", "EDGE_SIZE", ")", "edgeAccess", ".", "ensureCapacity", "(", "edgeAccess", ".", "getCapa...
Add a new directional edge into the graph. @param e the edge that will be added into the graph.
[ "Add", "a", "new", "directional", "edge", "into", "the", "graph", "." ]
b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24
https://github.com/InsightLab/graphast/blob/b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24/core/src/main/java/br/ufc/insightlab/graphast/structure/MMapGraphStructure.java#L132-L156
44,961
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultConstraintsCatalog.java
DefaultConstraintsCatalog.newBundle
public static DefaultConstraintsCatalog newBundle() { DefaultConstraintsCatalog c = new DefaultConstraintsCatalog(); c.add(new AmongBuilder()); c.add(new BanBuilder()); c.add(new ResourceCapacityBuilder()); c.add(new RunningCapacityBuilder()); c.add(new FenceBuilder()); ...
java
public static DefaultConstraintsCatalog newBundle() { DefaultConstraintsCatalog c = new DefaultConstraintsCatalog(); c.add(new AmongBuilder()); c.add(new BanBuilder()); c.add(new ResourceCapacityBuilder()); c.add(new RunningCapacityBuilder()); c.add(new FenceBuilder()); ...
[ "public", "static", "DefaultConstraintsCatalog", "newBundle", "(", ")", "{", "DefaultConstraintsCatalog", "c", "=", "new", "DefaultConstraintsCatalog", "(", ")", ";", "c", ".", "add", "(", "new", "AmongBuilder", "(", ")", ")", ";", "c", ".", "add", "(", "new...
Build a catalog with a builder for every constraints in the current BtrPlace bundle. @return a fulfilled catalog
[ "Build", "a", "catalog", "with", "a", "builder", "for", "every", "constraints", "in", "the", "current", "BtrPlace", "bundle", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultConstraintsCatalog.java#L55-L84
44,962
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultConstraintsCatalog.java
DefaultConstraintsCatalog.add
public boolean add(SatConstraintBuilder c) { if (this.builders.containsKey(c.getIdentifier())) { return false; } this.builders.put(c.getIdentifier(), c); return true; }
java
public boolean add(SatConstraintBuilder c) { if (this.builders.containsKey(c.getIdentifier())) { return false; } this.builders.put(c.getIdentifier(), c); return true; }
[ "public", "boolean", "add", "(", "SatConstraintBuilder", "c", ")", "{", "if", "(", "this", ".", "builders", ".", "containsKey", "(", "c", ".", "getIdentifier", "(", ")", ")", ")", "{", "return", "false", ";", "}", "this", ".", "builders", ".", "put", ...
Add a constraint builder to the catalog. There must not be another builder with the same identifier in the catalog @param c the constraint to add @return true if the builder has been added.
[ "Add", "a", "constraint", "builder", "to", "the", "catalog", ".", "There", "must", "not", "be", "another", "builder", "with", "the", "same", "identifier", "in", "the", "catalog" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultConstraintsCatalog.java#L93-L99
44,963
protegeproject/jpaul
src/main/java/jpaul/Misc/UComp.java
UComp.compare
public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); }
java
public int compare(T o1, T o2) { if(o1 == o2) return 0; String str1 = (o1 == null) ? "null" : o1.toString(); String str2 = (o2 == null) ? "null" : o2.toString(); return str1.compareTo(str2); }
[ "public", "int", "compare", "(", "T", "o1", ",", "T", "o2", ")", "{", "if", "(", "o1", "==", "o2", ")", "return", "0", ";", "String", "str1", "=", "(", "o1", "==", "null", ")", "?", "\"null\"", ":", "o1", ".", "toString", "(", ")", ";", "Stri...
Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the string representation of the first argument is less than, equal to, or greater to the string representation of the second.
[ "Compares", "its", "two", "arguments", "for", "order", ".", "Returns", "a", "negative", "integer", "zero", "or", "a", "positive", "integer", "as", "the", "string", "representation", "of", "the", "first", "argument", "is", "less", "than", "equal", "to", "or",...
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/UComp.java#L26-L31
44,964
m-m-m/util
lang/src/main/java/net/sf/mmm/util/lang/api/CaseSyntax.java
CaseSyntax.of
public static CaseSyntax of(Character separator, CaseConversion allCharCase) { return of(separator, allCharCase, allCharCase, allCharCase); }
java
public static CaseSyntax of(Character separator, CaseConversion allCharCase) { return of(separator, allCharCase, allCharCase, allCharCase); }
[ "public", "static", "CaseSyntax", "of", "(", "Character", "separator", ",", "CaseConversion", "allCharCase", ")", "{", "return", "of", "(", "separator", ",", "allCharCase", ",", "allCharCase", ",", "allCharCase", ")", ";", "}" ]
The constructor. @param separator - see {@link #getWordSeparator()}. @param allCharCase the {@link CaseConversion} used for {@link #getFirstCase() first}, {@link #getWordStartCase() word-start}, and all {@link #getOtherCase() other} alphabetic characters. @return the requested {@link CaseSyntax}.
[ "The", "constructor", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/lang/src/main/java/net/sf/mmm/util/lang/api/CaseSyntax.java#L382-L385
44,965
m-m-m/util
core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java
AbstractDatatypeDetector.registerDefaultDatatypes
protected void registerDefaultDatatypes() { registerStandardDatatype(String.class); registerStandardDatatype(Boolean.class); registerStandardDatatype(Character.class); registerStandardDatatype(Currency.class); registerCustomDatatype(Datatype.class); // internal trick... registerNumberDatatypes(...
java
protected void registerDefaultDatatypes() { registerStandardDatatype(String.class); registerStandardDatatype(Boolean.class); registerStandardDatatype(Character.class); registerStandardDatatype(Currency.class); registerCustomDatatype(Datatype.class); // internal trick... registerNumberDatatypes(...
[ "protected", "void", "registerDefaultDatatypes", "(", ")", "{", "registerStandardDatatype", "(", "String", ".", "class", ")", ";", "registerStandardDatatype", "(", "Boolean", ".", "class", ")", ";", "registerStandardDatatype", "(", "Character", ".", "class", ")", ...
Registers the default datatypes.
[ "Registers", "the", "default", "datatypes", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java#L98-L108
44,966
m-m-m/util
core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java
AbstractDatatypeDetector.setExtraDatatypes
public void setExtraDatatypes(List<String> datatypeList) { getInitializationState().requireNotInitilized(); for (String fqn : datatypeList) { registerCustomDatatype(fqn); } }
java
public void setExtraDatatypes(List<String> datatypeList) { getInitializationState().requireNotInitilized(); for (String fqn : datatypeList) { registerCustomDatatype(fqn); } }
[ "public", "void", "setExtraDatatypes", "(", "List", "<", "String", ">", "datatypeList", ")", "{", "getInitializationState", "(", ")", ".", "requireNotInitilized", "(", ")", ";", "for", "(", "String", "fqn", ":", "datatypeList", ")", "{", "registerCustomDatatype"...
Adds a list of additional datatypes to register. E.g. for easy spring configuration and custom extension. @param datatypeList is the {@link List} of {@link Class#getName() fully qualified names} of additional {@link Datatype}s to {@link #registerCustomDatatype(String) register}.
[ "Adds", "a", "list", "of", "additional", "datatypes", "to", "register", ".", "E", ".", "g", ".", "for", "easy", "spring", "configuration", "and", "custom", "extension", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/core/src/main/java/net/sf/mmm/util/lang/base/AbstractDatatypeDetector.java#L189-L195
44,967
ept/warc-hadoop
src/main/java/com/martinkl/warc/WARCFileWriter.java
WARCFileWriter.getGzipCodec
public static CompressionCodec getGzipCodec(Configuration conf) { try { return (CompressionCodec) ReflectionUtils.newInstance( conf.getClassByName("org.apache.hadoop.io.compress.GzipCodec").asSubclass(CompressionCodec.class), conf); } catch (ClassNotFoundExcep...
java
public static CompressionCodec getGzipCodec(Configuration conf) { try { return (CompressionCodec) ReflectionUtils.newInstance( conf.getClassByName("org.apache.hadoop.io.compress.GzipCodec").asSubclass(CompressionCodec.class), conf); } catch (ClassNotFoundExcep...
[ "public", "static", "CompressionCodec", "getGzipCodec", "(", "Configuration", "conf", ")", "{", "try", "{", "return", "(", "CompressionCodec", ")", "ReflectionUtils", ".", "newInstance", "(", "conf", ".", "getClassByName", "(", "\"org.apache.hadoop.io.compress.GzipCodec...
Instantiates a Hadoop codec for compressing and decompressing Gzip files. This is the most common compression applied to WARC files. @param conf The Hadoop configuration.
[ "Instantiates", "a", "Hadoop", "codec", "for", "compressing", "and", "decompressing", "Gzip", "files", ".", "This", "is", "the", "most", "common", "compression", "applied", "to", "WARC", "files", "." ]
f41cbb8002c29053eed9206e50ab9787de7da67f
https://github.com/ept/warc-hadoop/blob/f41cbb8002c29053eed9206e50ab9787de7da67f/src/main/java/com/martinkl/warc/WARCFileWriter.java#L95-L104
44,968
mapcode-foundation/mapcode-java
src/main/java/com/mapcode/MapcodeCodec.java
MapcodeCodec.isNearMultipleBorders
public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull final Territory territory) { checkDefined("point", point); if (territory != Territory.AAA) { final int territoryNumber = territory.getNumber(); if (territory.getParentTerritory() != null) { ...
java
public static boolean isNearMultipleBorders(@Nonnull final Point point, @Nonnull final Territory territory) { checkDefined("point", point); if (territory != Territory.AAA) { final int territoryNumber = territory.getNumber(); if (territory.getParentTerritory() != null) { ...
[ "public", "static", "boolean", "isNearMultipleBorders", "(", "@", "Nonnull", "final", "Point", "point", ",", "@", "Nonnull", "final", "Territory", "territory", ")", "{", "checkDefined", "(", "\"point\"", ",", "point", ")", ";", "if", "(", "territory", "!=", ...
Is coordinate near multiple territory borders? @param point Latitude/Longitude in degrees. @param territory Territory. @return true Iff the coordinate is near more than one territory border (and thus encode(decode(M)) may not produce M).
[ "Is", "coordinate", "near", "multiple", "territory", "borders?" ]
f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8
https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/MapcodeCodec.java#L388-L417
44,969
jMotif/GI
src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java
RepairPriorityQueue.enqueue
public void enqueue(RepairDigramRecord digramRecord) { // System.out.println("before == " + this.toString()); // if the same key element is in the queue - something went wrong with tracking... if (elements.containsKey(digramRecord.str)) { throw new IllegalArgumentException( "Element wit...
java
public void enqueue(RepairDigramRecord digramRecord) { // System.out.println("before == " + this.toString()); // if the same key element is in the queue - something went wrong with tracking... if (elements.containsKey(digramRecord.str)) { throw new IllegalArgumentException( "Element wit...
[ "public", "void", "enqueue", "(", "RepairDigramRecord", "digramRecord", ")", "{", "// System.out.println(\"before == \" + this.toString());", "// if the same key element is in the queue - something went wrong with tracking...", "if", "(", "elements", ".", "containsKey", "(", "digramR...
Places an element in the queue at the place based on its frequency. @param digramRecord the digram record to place into.
[ "Places", "an", "element", "in", "the", "queue", "at", "the", "place", "based", "on", "its", "frequency", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java#L25-L97
44,970
jMotif/GI
src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java
RepairPriorityQueue.get
public RepairDigramRecord get(String key) { RepairQueueNode el = this.elements.get(key); if (null != el) { return el.payload; } return null; }
java
public RepairDigramRecord get(String key) { RepairQueueNode el = this.elements.get(key); if (null != el) { return el.payload; } return null; }
[ "public", "RepairDigramRecord", "get", "(", "String", "key", ")", "{", "RepairQueueNode", "el", "=", "this", ".", "elements", ".", "get", "(", "key", ")", ";", "if", "(", "null", "!=", "el", ")", "{", "return", "el", ".", "payload", ";", "}", "return...
Gets an element in the queue given its key. @param key the key to look for. @return the element which corresponds to the key or null.
[ "Gets", "an", "element", "in", "the", "queue", "given", "its", "key", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java#L155-L161
44,971
jMotif/GI
src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java
RepairPriorityQueue.removeNodeFromList
private void removeNodeFromList(RepairQueueNode el) { // the head case // if (null == el.prev) { if (null != el.next) { this.head = el.next; this.head.prev = null; el=null; } else { // can't happen? yep. if there is only one element exists... this.he...
java
private void removeNodeFromList(RepairQueueNode el) { // the head case // if (null == el.prev) { if (null != el.next) { this.head = el.next; this.head.prev = null; el=null; } else { // can't happen? yep. if there is only one element exists... this.he...
[ "private", "void", "removeNodeFromList", "(", "RepairQueueNode", "el", ")", "{", "// the head case", "//", "if", "(", "null", "==", "el", ".", "prev", ")", "{", "if", "(", "null", "!=", "el", ".", "next", ")", "{", "this", ".", "head", "=", "el", "."...
Removes a node from the doubly linked list which backs the queue. @param el the element pointer.
[ "Removes", "a", "node", "from", "the", "doubly", "linked", "list", "which", "backs", "the", "queue", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RepairPriorityQueue.java#L321-L353
44,972
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/duration/DurationEvaluators.java
DurationEvaluators.evaluate
public int evaluate(Model mo, Class<? extends Action> a, Element e) throws SchedulerException { ActionDurationEvaluator<Element> ev = durations.get(a); if (ev == null) { throw new SchedulerModelingException(null, "Unable to estimate the duration of action '" + a.getSimpleName() + "' related ...
java
public int evaluate(Model mo, Class<? extends Action> a, Element e) throws SchedulerException { ActionDurationEvaluator<Element> ev = durations.get(a); if (ev == null) { throw new SchedulerModelingException(null, "Unable to estimate the duration of action '" + a.getSimpleName() + "' related ...
[ "public", "int", "evaluate", "(", "Model", "mo", ",", "Class", "<", "?", "extends", "Action", ">", "a", ",", "Element", "e", ")", "throws", "SchedulerException", "{", "ActionDurationEvaluator", "<", "Element", ">", "ev", "=", "durations", ".", "get", "(", ...
Evaluate the duration of given action on a given element. @param mo the model to consider @param a the action' class @param e the element identifier @return a positive number if the evaluation succeeded. A negative number otherwise
[ "Evaluate", "the", "duration", "of", "given", "action", "on", "a", "given", "element", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/duration/DurationEvaluators.java#L111-L121
44,973
m-m-m/util
cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java
AbstractCliParser.parseParameter
protected void parseParameter(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) { if (parserState.isOptionsComplete()) { // no more options (e.g. --foo), only arguments from here List<CliArgumentContainer> argumentList = this.cliState.getArguments(parserState.require...
java
protected void parseParameter(String parameter, CliParserState parserState, CliParameterConsumer parameterConsumer) { if (parserState.isOptionsComplete()) { // no more options (e.g. --foo), only arguments from here List<CliArgumentContainer> argumentList = this.cliState.getArguments(parserState.require...
[ "protected", "void", "parseParameter", "(", "String", "parameter", ",", "CliParserState", "parserState", ",", "CliParameterConsumer", "parameterConsumer", ")", "{", "if", "(", "parserState", ".", "isOptionsComplete", "(", ")", ")", "{", "// no more options (e.g. --foo),...
This method parses a single command-line argument. @param parameter is the command-line argument. @param parserState is the {@link CliParserState}. @param parameterConsumer is the {@link CliParameterConsumer}.
[ "This", "method", "parses", "a", "single", "command", "-", "line", "argument", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java#L270-L311
44,974
m-m-m/util
cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java
AbstractCliParser.printHelpOptions
private int printHelpOptions(CliOutputSettings settings, Map<CliOption, CliOptionHelpInfo> option2HelpMap, StringBuilder parameters, Collection<CliOptionContainer> modeOptions) { int maxOptionColumnWidth = 0; for (CliOptionContainer option : modeOptions) { CliOption cliOption = option.getOption(); ...
java
private int printHelpOptions(CliOutputSettings settings, Map<CliOption, CliOptionHelpInfo> option2HelpMap, StringBuilder parameters, Collection<CliOptionContainer> modeOptions) { int maxOptionColumnWidth = 0; for (CliOptionContainer option : modeOptions) { CliOption cliOption = option.getOption(); ...
[ "private", "int", "printHelpOptions", "(", "CliOutputSettings", "settings", ",", "Map", "<", "CliOption", ",", "CliOptionHelpInfo", ">", "option2HelpMap", ",", "StringBuilder", "parameters", ",", "Collection", "<", "CliOptionContainer", ">", "modeOptions", ")", "{", ...
Prints the options for the help usage output. @param settings are the {@link CliOutputSettings}. @param option2HelpMap is the {@link Map} with the {@link CliOptionHelpInfo}. @param parameters is the {@link StringBuilder} where to {@link StringBuilder#append(String) append} the options help output. @param modeOptions t...
[ "Prints", "the", "options", "for", "the", "help", "usage", "output", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java#L454-L497
44,975
protegeproject/jpaul
src/main/java/jpaul/DataStructs/ArraySet.java
ArraySet.contains
public boolean contains(Object o) { for(T e : elemArray) { if((o == e) || ((o != null) && o.equals(e))) { return true; } } return false; }
java
public boolean contains(Object o) { for(T e : elemArray) { if((o == e) || ((o != null) && o.equals(e))) { return true; } } return false; }
[ "public", "boolean", "contains", "(", "Object", "o", ")", "{", "for", "(", "T", "e", ":", "elemArray", ")", "{", "if", "(", "(", "o", "==", "e", ")", "||", "(", "(", "o", "!=", "null", ")", "&&", "o", ".", "equals", "(", "e", ")", ")", ")",...
Re-implement the contains method from AbstractSet, for speed reasons
[ "Re", "-", "implement", "the", "contains", "method", "from", "AbstractSet", "for", "speed", "reasons" ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/ArraySet.java#L126-L133
44,976
btrplace/scheduler
api/src/main/java/org/btrplace/plan/DependenciesExtractor.java
DependenciesExtractor.getDependencies
public Set<Action> getDependencies(Action a) { if (!demandingNodes.containsKey(a)) { return Collections.emptySet(); } Node n = demandingNodes.get(a); Set<Action> allActions = getFreeings(n); Set<Action> pre = new HashSet<>(); for (Action action : allActions) {...
java
public Set<Action> getDependencies(Action a) { if (!demandingNodes.containsKey(a)) { return Collections.emptySet(); } Node n = demandingNodes.get(a); Set<Action> allActions = getFreeings(n); Set<Action> pre = new HashSet<>(); for (Action action : allActions) {...
[ "public", "Set", "<", "Action", ">", "getDependencies", "(", "Action", "a", ")", "{", "if", "(", "!", "demandingNodes", ".", "containsKey", "(", "a", ")", ")", "{", "return", "Collections", ".", "emptySet", "(", ")", ";", "}", "Node", "n", "=", "dema...
Get the dependencies for an action. @param a the action to check @return its dependencies, may be empty
[ "Get", "the", "dependencies", "for", "an", "action", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/DependenciesExtractor.java#L164-L177
44,977
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/RequestUtil.java
RequestUtil.isExplodeRequires
public static boolean isExplodeRequires(HttpServletRequest request) { if (isIncludeRequireDeps(request)) { // don't expand require deps if we're including them in the response. return false; } boolean result = false; IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTR...
java
public static boolean isExplodeRequires(HttpServletRequest request) { if (isIncludeRequireDeps(request)) { // don't expand require deps if we're including them in the response. return false; } boolean result = false; IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTR...
[ "public", "static", "boolean", "isExplodeRequires", "(", "HttpServletRequest", "request", ")", "{", "if", "(", "isIncludeRequireDeps", "(", "request", ")", ")", "{", "// don't expand require deps if we're including them in the response.\r", "return", "false", ";", "}", "b...
Static class method for determining if require list explosion should be performed. @param request The http request object @return True if require list explosion should be performed.
[ "Static", "class", "method", "for", "determining", "if", "require", "list", "explosion", "should", "be", "performed", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/RequestUtil.java#L62-L76
44,978
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/RequestUtil.java
RequestUtil.isHasFiltering
public static boolean isHasFiltering(HttpServletRequest request) { IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME); IOptions options = aggr.getOptions(); return (options != null) ? !options.isDisableHasFiltering() : true; }
java
public static boolean isHasFiltering(HttpServletRequest request) { IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME); IOptions options = aggr.getOptions(); return (options != null) ? !options.isDisableHasFiltering() : true; }
[ "public", "static", "boolean", "isHasFiltering", "(", "HttpServletRequest", "request", ")", "{", "IAggregator", "aggr", "=", "(", "IAggregator", ")", "request", ".", "getAttribute", "(", "IAggregator", ".", "AGGREGATOR_REQATTRNAME", ")", ";", "IOptions", "options", ...
Static method for determining if has filtering should be performed. @param request The http request object @return True if has filtering should be performed
[ "Static", "method", "for", "determining", "if", "has", "filtering", "should", "be", "performed", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/RequestUtil.java#L84-L88
44,979
mapcode-foundation/mapcode-java
src/main/java/com/mapcode/Boundary.java
Boundary.createBoundaryForTerritoryRecord
@Nonnull static Boundary createBoundaryForTerritoryRecord(final int territoryRecord) { return new Boundary( DATA_MODEL.getLatMicroDegMin(territoryRecord), DATA_MODEL.getLonMicroDegMin(territoryRecord), DATA_MODEL.getLatMicroDegMax(territoryRecord), DATA_MODEL.getLonMicroDegMa...
java
@Nonnull static Boundary createBoundaryForTerritoryRecord(final int territoryRecord) { return new Boundary( DATA_MODEL.getLatMicroDegMin(territoryRecord), DATA_MODEL.getLonMicroDegMin(territoryRecord), DATA_MODEL.getLatMicroDegMax(territoryRecord), DATA_MODEL.getLonMicroDegMa...
[ "@", "Nonnull", "static", "Boundary", "createBoundaryForTerritoryRecord", "(", "final", "int", "territoryRecord", ")", "{", "return", "new", "Boundary", "(", "DATA_MODEL", ".", "getLatMicroDegMin", "(", "territoryRecord", ")", ",", "DATA_MODEL", ".", "getLonMicroDegMi...
You have to use this factory method instead of a ctor.
[ "You", "have", "to", "use", "this", "factory", "method", "instead", "of", "a", "ctor", "." ]
f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8
https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/Boundary.java#L45-L51
44,980
mapcode-foundation/mapcode-java
src/main/java/com/mapcode/Boundary.java
Boundary.containsPoint
boolean containsPoint(@Nonnull final Point p) { if (!p.isDefined()) { return false; } final int latMicroDeg = p.getLatMicroDeg(); if ((latMicroDegMin > latMicroDeg) || (latMicroDeg >= latMicroDegMax)) { return false; } final int lonMicroDeg = p.get...
java
boolean containsPoint(@Nonnull final Point p) { if (!p.isDefined()) { return false; } final int latMicroDeg = p.getLatMicroDeg(); if ((latMicroDegMin > latMicroDeg) || (latMicroDeg >= latMicroDegMax)) { return false; } final int lonMicroDeg = p.get...
[ "boolean", "containsPoint", "(", "@", "Nonnull", "final", "Point", "p", ")", "{", "if", "(", "!", "p", ".", "isDefined", "(", ")", ")", "{", "return", "false", ";", "}", "final", "int", "latMicroDeg", "=", "p", ".", "getLatMicroDeg", "(", ")", ";", ...
Check if a point falls within a boundary. Note that the "min" values are inclusive for a boundary and the "max" values are exclusive.\ Note: Points at the exact North pole with latitude 90 are never part of a boundary. @param p Point to check. @return True if the points falls within the boundary.
[ "Check", "if", "a", "point", "falls", "within", "a", "boundary", ".", "Note", "that", "the", "min", "values", "are", "inclusive", "for", "a", "boundary", "and", "the", "max", "values", "are", "exclusive", ".", "\\" ]
f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8
https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/Boundary.java#L87-L105
44,981
btrplace/scheduler
api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java
Precedence.newPrecedence
public static List<Precedence> newPrecedence(VM vmBefore, Collection<VM> vmsAfter) { return newPrecedence(Collections.singleton(vmBefore), vmsAfter); }
java
public static List<Precedence> newPrecedence(VM vmBefore, Collection<VM> vmsAfter) { return newPrecedence(Collections.singleton(vmBefore), vmsAfter); }
[ "public", "static", "List", "<", "Precedence", ">", "newPrecedence", "(", "VM", "vmBefore", ",", "Collection", "<", "VM", ">", "vmsAfter", ")", "{", "return", "newPrecedence", "(", "Collections", ".", "singleton", "(", "vmBefore", ")", ",", "vmsAfter", ")", ...
Instantiate discrete constraints to force a set of VMs to migrate after a single one. @param vmBefore the (single) VM to migrate before the others {@see vmsAfter} @param vmsAfter the VMs to migrate after the other one {@see vmBefore} @return the associated list of constraints
[ "Instantiate", "discrete", "constraints", "to", "force", "a", "set", "of", "VMs", "to", "migrate", "after", "a", "single", "one", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java#L103-L105
44,982
btrplace/scheduler
api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java
Precedence.newPrecedence
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, VM vmAfter) { return newPrecedence(vmsBefore, Collections.singleton(vmAfter)); }
java
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, VM vmAfter) { return newPrecedence(vmsBefore, Collections.singleton(vmAfter)); }
[ "public", "static", "List", "<", "Precedence", ">", "newPrecedence", "(", "Collection", "<", "VM", ">", "vmsBefore", ",", "VM", "vmAfter", ")", "{", "return", "newPrecedence", "(", "vmsBefore", ",", "Collections", ".", "singleton", "(", "vmAfter", ")", ")", ...
Instantiate discrete constraints to force a single VM to migrate after a set of VMs. @param vmsBefore the VMs to migrate before the other one {@see vmAfter} @param vmAfter the (single) VM to migrate after the others {@see vmsBefore} @return the associated list of constraints
[ "Instantiate", "discrete", "constraints", "to", "force", "a", "single", "VM", "to", "migrate", "after", "a", "set", "of", "VMs", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java#L114-L116
44,983
btrplace/scheduler
api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java
Precedence.newPrecedence
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, Collection<VM> vmsAfter) { List<Precedence> l = new ArrayList<>(vmsBefore.size() * vmsAfter.size()); for (VM vmb : vmsBefore) { for (VM vma : vmsAfter) { l.add(new Precedence(vmb, vma)); } ...
java
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, Collection<VM> vmsAfter) { List<Precedence> l = new ArrayList<>(vmsBefore.size() * vmsAfter.size()); for (VM vmb : vmsBefore) { for (VM vma : vmsAfter) { l.add(new Precedence(vmb, vma)); } ...
[ "public", "static", "List", "<", "Precedence", ">", "newPrecedence", "(", "Collection", "<", "VM", ">", "vmsBefore", ",", "Collection", "<", "VM", ">", "vmsAfter", ")", "{", "List", "<", "Precedence", ">", "l", "=", "new", "ArrayList", "<>", "(", "vmsBef...
Instantiate discrete constraints to force a set of VMs to migrate after an other set of VMs. @param vmsBefore the VMs to migrate before the others {@see vmsAfter} @param vmsAfter the VMs to migrate after the others {@see vmsBefore} @return the associated list of constraints
[ "Instantiate", "discrete", "constraints", "to", "force", "a", "set", "of", "VMs", "to", "migrate", "after", "an", "other", "set", "of", "VMs", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java#L125-L133
44,984
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java
VectorPackingPropagator.isConsistent
private ESat isConsistent() { int[][] l = new int[nbDims][nbBins]; for (int i = 0; i < bins.length; i++) { if (bins[i].isInstantiated()) { for (int d = 0; d < nbDims; d++) { int v = bins[i].getValue(); l[d][v] += iSizes[d][i]; ...
java
private ESat isConsistent() { int[][] l = new int[nbDims][nbBins]; for (int i = 0; i < bins.length; i++) { if (bins[i].isInstantiated()) { for (int d = 0; d < nbDims; d++) { int v = bins[i].getValue(); l[d][v] += iSizes[d][i]; ...
[ "private", "ESat", "isConsistent", "(", ")", "{", "int", "[", "]", "[", "]", "l", "=", "new", "int", "[", "nbDims", "]", "[", "nbBins", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bins", ".", "length", ";", "i", "++", ")", "...
check the consistency of the constraint. @return false if the total size of the items assigned to a bin exceeds the bin load upper bound, true otherwise
[ "check", "the", "consistency", "of", "the", "constraint", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java#L160-L174
44,985
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java
VectorPackingPropagator.getPropagationConditions
@Override public int getPropagationConditions(int idx) { return idx < bins.length ? IntEventType.all() : IntEventType.BOUND.getMask() + IntEventType.INSTANTIATE.getMask(); }
java
@Override public int getPropagationConditions(int idx) { return idx < bins.length ? IntEventType.all() : IntEventType.BOUND.getMask() + IntEventType.INSTANTIATE.getMask(); }
[ "@", "Override", "public", "int", "getPropagationConditions", "(", "int", "idx", ")", "{", "return", "idx", "<", "bins", ".", "length", "?", "IntEventType", ".", "all", "(", ")", ":", "IntEventType", ".", "BOUND", ".", "getMask", "(", ")", "+", "IntEvent...
react on removal events on bins variables react on bound events on loads variables
[ "react", "on", "removal", "events", "on", "bins", "variables", "react", "on", "bound", "events", "on", "loads", "variables" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java#L184-L187
44,986
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java
VectorPackingPropagator.computeSumItemSizes
private void computeSumItemSizes() { for (int d = 0; d < nbDims; d++) { long sum = 0; for (int i = 0; i < iSizes[d].length; i++) { sum += iSizes[d][i]; } this.sumISizes[d] = sum; } }
java
private void computeSumItemSizes() { for (int d = 0; d < nbDims; d++) { long sum = 0; for (int i = 0; i < iSizes[d].length; i++) { sum += iSizes[d][i]; } this.sumISizes[d] = sum; } }
[ "private", "void", "computeSumItemSizes", "(", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "nbDims", ";", "d", "++", ")", "{", "long", "sum", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "iSizes", "[", "d", ...
Compute the sum of the item sizes for each dimension.
[ "Compute", "the", "sum", "of", "the", "item", "sizes", "for", "each", "dimension", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingPropagator.java#L459-L468
44,987
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/module/ModuleImpl.java
ModuleImpl.clearCached
@Override public void clearCached(ICacheManager mgr) { Map<String, CacheEntry> moduleBuilds; synchronized (this) { moduleBuilds = _moduleBuilds; _moduleBuilds = null; } if (moduleBuilds != null) { for (Map.Entry<String, CacheEntry> entry : moduleBuilds.entrySet()) { entry.getValue().delet...
java
@Override public void clearCached(ICacheManager mgr) { Map<String, CacheEntry> moduleBuilds; synchronized (this) { moduleBuilds = _moduleBuilds; _moduleBuilds = null; } if (moduleBuilds != null) { for (Map.Entry<String, CacheEntry> entry : moduleBuilds.entrySet()) { entry.getValue().delet...
[ "@", "Override", "public", "void", "clearCached", "(", "ICacheManager", "mgr", ")", "{", "Map", "<", "String", ",", "CacheEntry", ">", "moduleBuilds", ";", "synchronized", "(", "this", ")", "{", "moduleBuilds", "=", "_moduleBuilds", ";", "_moduleBuilds", "=", ...
Asynchronously delete the set of cached files for this module.
[ "Asynchronously", "delete", "the", "set", "of", "cached", "files", "for", "this", "module", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/module/ModuleImpl.java#L612-L625
44,988
btrplace/scheduler
split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java
SplittableElementSet.newVMIndex
public static SplittableElementSet<VM> newVMIndex(Collection<VM> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
java
public static SplittableElementSet<VM> newVMIndex(Collection<VM> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
[ "public", "static", "SplittableElementSet", "<", "VM", ">", "newVMIndex", "(", "Collection", "<", "VM", ">", "c", ",", "TIntIntHashMap", "idx", ")", "{", "return", "new", "SplittableElementSet", "<>", "(", "c", ",", "idx", ")", ";", "}" ]
Make a new splittable set from a collection of VM. We consider the collection does not have duplicated elements. @param c the collection to wrap @param idx the partition for each VM @return the resulting set
[ "Make", "a", "new", "splittable", "set", "from", "a", "collection", "of", "VM", ".", "We", "consider", "the", "collection", "does", "not", "have", "duplicated", "elements", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java#L71-L73
44,989
btrplace/scheduler
split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java
SplittableElementSet.newNodeIndex
public static SplittableElementSet<Node> newNodeIndex(Collection<Node> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
java
public static SplittableElementSet<Node> newNodeIndex(Collection<Node> c, TIntIntHashMap idx) { return new SplittableElementSet<>(c, idx); }
[ "public", "static", "SplittableElementSet", "<", "Node", ">", "newNodeIndex", "(", "Collection", "<", "Node", ">", "c", ",", "TIntIntHashMap", "idx", ")", "{", "return", "new", "SplittableElementSet", "<>", "(", "c", ",", "idx", ")", ";", "}" ]
Make a new splittable set from a collection of nodes. We consider the collection does not have duplicated elements. @param c the collection to wrap @param idx the partition for each node @return the resulting set
[ "Make", "a", "new", "splittable", "set", "from", "a", "collection", "of", "nodes", ".", "We", "consider", "the", "collection", "does", "not", "have", "duplicated", "elements", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java#L83-L85
44,990
btrplace/scheduler
split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java
SplittableElementSet.forEachPartition
public boolean forEachPartition(IterateProcedure<E> p) { int curIdx = index.get(values.get(0).id()); int from; int to; for (from = 0, to = 0; to < values.size(); to++) { int cIdx = index.get(values.get(to).id()); if (curIdx != cIdx) { if (!p.extrac...
java
public boolean forEachPartition(IterateProcedure<E> p) { int curIdx = index.get(values.get(0).id()); int from; int to; for (from = 0, to = 0; to < values.size(); to++) { int cIdx = index.get(values.get(to).id()); if (curIdx != cIdx) { if (!p.extrac...
[ "public", "boolean", "forEachPartition", "(", "IterateProcedure", "<", "E", ">", "p", ")", "{", "int", "curIdx", "=", "index", ".", "get", "(", "values", ".", "get", "(", "0", ")", ".", "id", "(", ")", ")", ";", "int", "from", ";", "int", "to", "...
Execute a procedure on each partition. The partition is indicated by its bounds on the backend array. @param p the procedure to execute
[ "Execute", "a", "procedure", "on", "each", "partition", ".", "The", "partition", "is", "indicated", "by", "its", "bounds", "on", "the", "backend", "array", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java#L108-L123
44,991
btrplace/scheduler
split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java
SplittableElementSet.getSubSet
public Set<E> getSubSet(int k) { int from = -1; //TODO: very bad. Bounds should be memorized for (int x = 0; x < values.size(); x++) { int cIdx = index.get(values.get(x).id()); if (cIdx == k && from == -1) { from = x; } if (from >= ...
java
public Set<E> getSubSet(int k) { int from = -1; //TODO: very bad. Bounds should be memorized for (int x = 0; x < values.size(); x++) { int cIdx = index.get(values.get(x).id()); if (cIdx == k && from == -1) { from = x; } if (from >= ...
[ "public", "Set", "<", "E", ">", "getSubSet", "(", "int", "k", ")", "{", "int", "from", "=", "-", "1", ";", "//TODO: very bad. Bounds should be memorized", "for", "(", "int", "x", "=", "0", ";", "x", "<", "values", ".", "size", "(", ")", ";", "x", "...
Get a subset for the given partition. @param k the partition key @return the resulting subset. Empty if no elements belong to the given partition.
[ "Get", "a", "subset", "for", "the", "given", "partition", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java#L131-L147
44,992
btrplace/scheduler
split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java
SplittableElementSet.getPartitions
public List<ElementSubSet<E>> getPartitions() { final List<ElementSubSet<E>> partitions = new ArrayList<>(); forEachPartition((idx, key, from, to) -> { partitions.add(new ElementSubSet<>(SplittableElementSet.this, key, from, to)); return true; }); return partition...
java
public List<ElementSubSet<E>> getPartitions() { final List<ElementSubSet<E>> partitions = new ArrayList<>(); forEachPartition((idx, key, from, to) -> { partitions.add(new ElementSubSet<>(SplittableElementSet.this, key, from, to)); return true; }); return partition...
[ "public", "List", "<", "ElementSubSet", "<", "E", ">", ">", "getPartitions", "(", ")", "{", "final", "List", "<", "ElementSubSet", "<", "E", ">", ">", "partitions", "=", "new", "ArrayList", "<>", "(", ")", ";", "forEachPartition", "(", "(", "idx", ",",...
Get all the partitions as subsets. @return a collection of {@link ElementSubSet}.
[ "Get", "all", "the", "partitions", "as", "subsets", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SplittableElementSet.java#L177-L184
44,993
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/AbstractCollectionCacheKeyGenerator.java
AbstractCollectionCacheKeyGenerator.combine
public ICacheKeyGenerator combine(ICacheKeyGenerator otherKeyGen) { if (this.equals(otherKeyGen)) { return this; } @SuppressWarnings("unchecked") AbstractCollectionCacheKeyGenerator<T> other = (AbstractCollectionCacheKeyGenerator<T>)otherKeyGen; if (isProvisional() && other.isProvisional()) { // ...
java
public ICacheKeyGenerator combine(ICacheKeyGenerator otherKeyGen) { if (this.equals(otherKeyGen)) { return this; } @SuppressWarnings("unchecked") AbstractCollectionCacheKeyGenerator<T> other = (AbstractCollectionCacheKeyGenerator<T>)otherKeyGen; if (isProvisional() && other.isProvisional()) { // ...
[ "public", "ICacheKeyGenerator", "combine", "(", "ICacheKeyGenerator", "otherKeyGen", ")", "{", "if", "(", "this", ".", "equals", "(", "otherKeyGen", ")", ")", "{", "return", "this", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "AbstractCollectio...
Returns a cache key generator that is the combination of this cache key generator and the specified cache key generator (i.e. the cache keys generated by the returned object vary according to the conditions honored by this generator and the specified generator. @param otherKeyGen the key generator to combine with this...
[ "Returns", "a", "cache", "key", "generator", "that", "is", "the", "combination", "of", "this", "cache", "key", "generator", "and", "the", "specified", "cache", "key", "generator", "(", "i", ".", "e", ".", "the", "cache", "keys", "generated", "by", "the", ...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/AbstractCollectionCacheKeyGenerator.java#L56-L93
44,994
berkesa/datatree
src/main/java/io/datatree/dom/TreeReaderRegistry.java
TreeReaderRegistry.setReader
public static final void setReader(String format, TreeReader reader) { String key = format.toLowerCase(); readers.put(key, reader); if (JSON.equals(key)) { cachedJsonReader = reader; } }
java
public static final void setReader(String format, TreeReader reader) { String key = format.toLowerCase(); readers.put(key, reader); if (JSON.equals(key)) { cachedJsonReader = reader; } }
[ "public", "static", "final", "void", "setReader", "(", "String", "format", ",", "TreeReader", "reader", ")", "{", "String", "key", "=", "format", ".", "toLowerCase", "(", ")", ";", "readers", ".", "put", "(", "key", ",", "reader", ")", ";", "if", "(", ...
Binds the given TreeReader instance to the specified data format. @param format name of the format (eg. "json", "xml", "csv", etc.) @param reader TreeReader instance for parsing the specified format
[ "Binds", "the", "given", "TreeReader", "instance", "to", "the", "specified", "data", "format", "." ]
79aea9b45c7b46ab28af0a09310bc01c421c6b3a
https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/dom/TreeReaderRegistry.java#L62-L68
44,995
m-m-m/util
xml/src/main/java/net/sf/mmm/util/xml/impl/stax/XIncludeStreamReader.java
XIncludeStreamReader.resolveInclude
protected int resolveInclude() throws XMLStreamException { // we are no more in fallback mode this.fallback = false; this.depth++; int eventType = -1; // read attributes... String href = getAttributeValue(null, "href"); LOGGER.trace("Resolving xi:include to href {}", href); String xpoin...
java
protected int resolveInclude() throws XMLStreamException { // we are no more in fallback mode this.fallback = false; this.depth++; int eventType = -1; // read attributes... String href = getAttributeValue(null, "href"); LOGGER.trace("Resolving xi:include to href {}", href); String xpoin...
[ "protected", "int", "resolveInclude", "(", ")", "throws", "XMLStreamException", "{", "// we are no more in fallback mode", "this", ".", "fallback", "=", "false", ";", "this", ".", "depth", "++", ";", "int", "eventType", "=", "-", "1", ";", "// read attributes...",...
This method is called when an include tag of the XInclude namespace was started. It resolves the include and finds a fallback on failure. @return the next event type. @throws XMLStreamException if the XML stream processing caused an error.
[ "This", "method", "is", "called", "when", "an", "include", "tag", "of", "the", "XInclude", "namespace", "was", "started", ".", "It", "resolves", "the", "include", "and", "finds", "a", "fallback", "on", "failure", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/impl/stax/XIncludeStreamReader.java#L185-L249
44,996
m-m-m/util
xml/src/main/java/net/sf/mmm/util/xml/impl/stax/XIncludeStreamReader.java
XIncludeStreamReader.closeInitialInclude
protected void closeInitialInclude() throws XMLStreamException { LOGGER.trace("Closing xi:include"); int eventType = -1; // we ascend the XML until the initial include is closed. while (this.depth > 0) { eventType = this.mainReader.next(); if (eventType == XMLStreamConstants.START_ELEMENT) ...
java
protected void closeInitialInclude() throws XMLStreamException { LOGGER.trace("Closing xi:include"); int eventType = -1; // we ascend the XML until the initial include is closed. while (this.depth > 0) { eventType = this.mainReader.next(); if (eventType == XMLStreamConstants.START_ELEMENT) ...
[ "protected", "void", "closeInitialInclude", "(", ")", "throws", "XMLStreamException", "{", "LOGGER", ".", "trace", "(", "\"Closing xi:include\"", ")", ";", "int", "eventType", "=", "-", "1", ";", "// we ascend the XML until the initial include is closed.", "while", "(",...
This method ascends the XML until the initial include is closed. @throws XMLStreamException if the XML stream processing caused an error.
[ "This", "method", "ascends", "the", "XML", "until", "the", "initial", "include", "is", "closed", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/impl/stax/XIncludeStreamReader.java#L274-L290
44,997
xedin/disruptor_thrift_server
src/main/java/com/thinkaurelius/thrift/Message.java
Message.read
public boolean read() { if (state == State.READING_FRAME_SIZE) { // try to read the frame size completely if (!internalRead(frameSizeBuffer)) return false; // if the frame size has been read completely, then prepare to read the // actu...
java
public boolean read() { if (state == State.READING_FRAME_SIZE) { // try to read the frame size completely if (!internalRead(frameSizeBuffer)) return false; // if the frame size has been read completely, then prepare to read the // actu...
[ "public", "boolean", "read", "(", ")", "{", "if", "(", "state", "==", "State", ".", "READING_FRAME_SIZE", ")", "{", "// try to read the frame size completely", "if", "(", "!", "internalRead", "(", "frameSizeBuffer", ")", ")", "return", "false", ";", "// if the f...
Give this Message a chance to read. The selector loop should have received a read event for this Message. @return true if the connection should live on, false if it should be closed
[ "Give", "this", "Message", "a", "chance", "to", "read", ".", "The", "selector", "loop", "should", "have", "received", "a", "read", "event", "for", "this", "Message", "." ]
5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c
https://github.com/xedin/disruptor_thrift_server/blob/5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c/src/main/java/com/thinkaurelius/thrift/Message.java#L178-L248
44,998
xedin/disruptor_thrift_server
src/main/java/com/thinkaurelius/thrift/Message.java
Message.write
public boolean write() { assert state == State.WRITING; boolean writeFailed = false; try { if (response.streamTo(transport) < 0) { writeFailed = true; return false; } else if (!response.isFullyStreamed(...
java
public boolean write() { assert state == State.WRITING; boolean writeFailed = false; try { if (response.streamTo(transport) < 0) { writeFailed = true; return false; } else if (!response.isFullyStreamed(...
[ "public", "boolean", "write", "(", ")", "{", "assert", "state", "==", "State", ".", "WRITING", ";", "boolean", "writeFailed", "=", "false", ";", "try", "{", "if", "(", "response", ".", "streamTo", "(", "transport", ")", "<", "0", ")", "{", "writeFailed...
Give this Message a chance to write its output to the final client.
[ "Give", "this", "Message", "a", "chance", "to", "write", "its", "output", "to", "the", "final", "client", "." ]
5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c
https://github.com/xedin/disruptor_thrift_server/blob/5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c/src/main/java/com/thinkaurelius/thrift/Message.java#L258-L298
44,999
xedin/disruptor_thrift_server
src/main/java/com/thinkaurelius/thrift/Message.java
Message.changeSelectInterests
public void changeSelectInterests() { switch (state) { case READY_TO_WRITE: // set the OP_WRITE interest state = State.WRITING; break; case READY_TO_READ_FRAME_SIZE: state = State.READING_FRAME_SIZE; break; ...
java
public void changeSelectInterests() { switch (state) { case READY_TO_WRITE: // set the OP_WRITE interest state = State.WRITING; break; case READY_TO_READ_FRAME_SIZE: state = State.READING_FRAME_SIZE; break; ...
[ "public", "void", "changeSelectInterests", "(", ")", "{", "switch", "(", "state", ")", "{", "case", "READY_TO_WRITE", ":", "// set the OP_WRITE interest", "state", "=", "State", ".", "WRITING", ";", "break", ";", "case", "READY_TO_READ_FRAME_SIZE", ":", "state", ...
Give this Message a chance to change its interests.
[ "Give", "this", "Message", "a", "chance", "to", "change", "its", "interests", "." ]
5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c
https://github.com/xedin/disruptor_thrift_server/blob/5bf0c3d6968e1ea79f5ea939dde7b8ced3d91a2c/src/main/java/com/thinkaurelius/thrift/Message.java#L303-L327