repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
cycorp/api-suite
core-api/src/main/java/com/cyc/session/exception/UnsupportedCycOperationException.java
UnsupportedCycOperationException.fromThrowable
public static UnsupportedCycOperationException fromThrowable(String message, Throwable cause) { return (cause instanceof UnsupportedCycOperationException && Objects.equals(message, cause.getMessage())) ? (UnsupportedCycOperationException) cause : new UnsupportedCycOperationExce...
java
public static UnsupportedCycOperationException fromThrowable(String message, Throwable cause) { return (cause instanceof UnsupportedCycOperationException && Objects.equals(message, cause.getMessage())) ? (UnsupportedCycOperationException) cause : new UnsupportedCycOperationExce...
[ "public", "static", "UnsupportedCycOperationException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "UnsupportedCycOperationException", "&&", "Objects", ".", "equals", "(", "message", ",", "caus...
Converts a Throwable to a UnsupportedCycOperationException with the specified detail message. If the Throwable is a UnsupportedCycOperationException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new UnsupportedCycOper...
[ "Converts", "a", "Throwable", "to", "a", "UnsupportedCycOperationException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "UnsupportedCycOperationException", "and", "if", "the", "Throwable", "s", "message", "is", "identi...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/UnsupportedCycOperationException.java#L61-L65
train
soarcn/AndroidLifecyle
lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java
LifecycleDispatcher.unregisterActivityLifecycleCallbacks
public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) { if (PRE_ICS) { preIcsUnregisterActivityLifecycleCallbacks(callback); } else { postIcsUnregisterActivityLifecycleCallbacks(application, callback); ...
java
public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) { if (PRE_ICS) { preIcsUnregisterActivityLifecycleCallbacks(callback); } else { postIcsUnregisterActivityLifecycleCallbacks(application, callback); ...
[ "public", "static", "void", "unregisterActivityLifecycleCallbacks", "(", "Application", "application", ",", "ActivityLifecycleCallbacksCompat", "callback", ")", "{", "if", "(", "PRE_ICS", ")", "{", "preIcsUnregisterActivityLifecycleCallbacks", "(", "callback", ")", ";", "...
Unregisters a previously registered callback. @param application The application with which to unregister the callback. @param callback The callback to unregister.
[ "Unregisters", "a", "previously", "registered", "callback", "." ]
f1e36f1f20871863cc2007aa0fa6c30143dd2091
https://github.com/soarcn/AndroidLifecyle/blob/f1e36f1f20871863cc2007aa0fa6c30143dd2091/lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java#L65-L71
train
cycorp/api-suite
core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java
SessionRuntimeException.fromThrowable
public static SessionRuntimeException fromThrowable(Throwable cause) { return (cause instanceof SessionRuntimeException) ? (SessionRuntimeException) cause : new SessionRuntimeException(cause); }
java
public static SessionRuntimeException fromThrowable(Throwable cause) { return (cause instanceof SessionRuntimeException) ? (SessionRuntimeException) cause : new SessionRuntimeException(cause); }
[ "public", "static", "SessionRuntimeException", "fromThrowable", "(", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "SessionRuntimeException", ")", "?", "(", "SessionRuntimeException", ")", "cause", ":", "new", "SessionRuntimeException", "(", "c...
Converts a Throwable to a SessionRuntimeException. If the Throwable is a SessionRuntimeException, it will be passed through unmodified; otherwise, it will be wrapped in a new SessionRuntimeException. @param cause the Throwable to convert @return a SessionRuntimeException
[ "Converts", "a", "Throwable", "to", "a", "SessionRuntimeException", ".", "If", "the", "Throwable", "is", "a", "SessionRuntimeException", "it", "will", "be", "passed", "through", "unmodified", ";", "otherwise", "it", "will", "be", "wrapped", "in", "a", "new", "...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java#L49-L53
train
cycorp/api-suite
core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java
SessionRuntimeException.fromThrowable
public static SessionRuntimeException fromThrowable(String message, Throwable cause) { return (cause instanceof SessionRuntimeException && Objects.equals(message, cause.getMessage())) ? (SessionRuntimeException) cause : new SessionRuntimeException(message, cause); }
java
public static SessionRuntimeException fromThrowable(String message, Throwable cause) { return (cause instanceof SessionRuntimeException && Objects.equals(message, cause.getMessage())) ? (SessionRuntimeException) cause : new SessionRuntimeException(message, cause); }
[ "public", "static", "SessionRuntimeException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "SessionRuntimeException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getM...
Converts a Throwable to a SessionRuntimeException with the specified detail message. If the Throwable is a SessionRuntimeException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new SessionRuntimeException with the det...
[ "Converts", "a", "Throwable", "to", "a", "SessionRuntimeException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "SessionRuntimeException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "t...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionRuntimeException.java#L66-L70
train
paulhoule/centipede
centipede/src/main/java/com/ontology2/centipede/shell/ResourceAwareObject.java
ResourceAwareObject.stream
protected ByteSource stream(final String resourceId) { return new ByteSource() { @Override public InputStream openStream() throws IOException { return loader.getResource(resourceId).getInputStream(); } }; }
java
protected ByteSource stream(final String resourceId) { return new ByteSource() { @Override public InputStream openStream() throws IOException { return loader.getResource(resourceId).getInputStream(); } }; }
[ "protected", "ByteSource", "stream", "(", "final", "String", "resourceId", ")", "{", "return", "new", "ByteSource", "(", ")", "{", "@", "Override", "public", "InputStream", "openStream", "(", ")", "throws", "IOException", "{", "return", "loader", ".", "getReso...
Wouldn't it be nice if we wrote some tests?
[ "Wouldn", "t", "it", "be", "nice", "if", "we", "wrote", "some", "tests?" ]
83bf94b841685e77f4d57deb8d5c57148eff9c17
https://github.com/paulhoule/centipede/blob/83bf94b841685e77f4d57deb8d5c57148eff9c17/centipede/src/main/java/com/ontology2/centipede/shell/ResourceAwareObject.java#L25-L32
train
cycorp/api-suite
core-api/src/main/java/com/cyc/query/exception/QueryRuntimeException.java
QueryRuntimeException.fromThrowable
public static QueryRuntimeException fromThrowable(Throwable t) { return (t instanceof QueryRuntimeException) ? (QueryRuntimeException) t : new QueryRuntimeException(t); }
java
public static QueryRuntimeException fromThrowable(Throwable t) { return (t instanceof QueryRuntimeException) ? (QueryRuntimeException) t : new QueryRuntimeException(t); }
[ "public", "static", "QueryRuntimeException", "fromThrowable", "(", "Throwable", "t", ")", "{", "return", "(", "t", "instanceof", "QueryRuntimeException", ")", "?", "(", "QueryRuntimeException", ")", "t", ":", "new", "QueryRuntimeException", "(", "t", ")", ";", "...
Converts a Throwable to a QueryRuntimeException. If the Throwable is a QueryRuntimeException, it will be passed through unmodified; otherwise, it will be wrapped in a new QueryRuntimeException. @param t the Throwable to convert @return a QueryRuntimeException
[ "Converts", "a", "Throwable", "to", "a", "QueryRuntimeException", ".", "If", "the", "Throwable", "is", "a", "QueryRuntimeException", "it", "will", "be", "passed", "through", "unmodified", ";", "otherwise", "it", "will", "be", "wrapped", "in", "a", "new", "Quer...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/query/exception/QueryRuntimeException.java#L43-L47
train
cycorp/api-suite
core-api/src/main/java/com/cyc/query/exception/QueryRuntimeException.java
QueryRuntimeException.fromThrowable
public static QueryRuntimeException fromThrowable(String message, Throwable t) { return (t instanceof QueryRuntimeException && Objects.equals(message, t.getMessage())) ? (QueryRuntimeException) t : new QueryRuntimeException(message, t); }
java
public static QueryRuntimeException fromThrowable(String message, Throwable t) { return (t instanceof QueryRuntimeException && Objects.equals(message, t.getMessage())) ? (QueryRuntimeException) t : new QueryRuntimeException(message, t); }
[ "public", "static", "QueryRuntimeException", "fromThrowable", "(", "String", "message", ",", "Throwable", "t", ")", "{", "return", "(", "t", "instanceof", "QueryRuntimeException", "&&", "Objects", ".", "equals", "(", "message", ",", "t", ".", "getMessage", "(", ...
Converts a Throwable to a QueryRuntimeException with the specified detail message. If the Throwable is a QueryRuntimeException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new QueryRuntimeException with the detail me...
[ "Converts", "a", "Throwable", "to", "a", "QueryRuntimeException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "QueryRuntimeException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "the",...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/query/exception/QueryRuntimeException.java#L60-L64
train
cycorp/api-suite
core-api/src/main/java/com/cyc/query/exception/ProofViewException.java
ProofViewException.fromThrowable
public static ProofViewException fromThrowable(Throwable cause) { return (cause instanceof ProofViewException) ? (ProofViewException) cause : new ProofViewException(cause); }
java
public static ProofViewException fromThrowable(Throwable cause) { return (cause instanceof ProofViewException) ? (ProofViewException) cause : new ProofViewException(cause); }
[ "public", "static", "ProofViewException", "fromThrowable", "(", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "ProofViewException", ")", "?", "(", "ProofViewException", ")", "cause", ":", "new", "ProofViewException", "(", "cause", ")", ";",...
Converts a Throwable to a ProofViewException. If the Throwable is a ProofViewException, it will be passed through unmodified; otherwise, it will be wrapped in a new ProofViewException. @param cause the Throwable to convert @return a ProofViewException
[ "Converts", "a", "Throwable", "to", "a", "ProofViewException", ".", "If", "the", "Throwable", "is", "a", "ProofViewException", "it", "will", "be", "passed", "through", "unmodified", ";", "otherwise", "it", "will", "be", "wrapped", "in", "a", "new", "ProofViewE...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/query/exception/ProofViewException.java#L44-L48
train
cycorp/api-suite
core-api/src/main/java/com/cyc/query/exception/ProofViewException.java
ProofViewException.fromThrowable
public static ProofViewException fromThrowable(String message, Throwable cause) { return (cause instanceof ProofViewException && Objects.equals(message, cause.getMessage())) ? (ProofViewException) cause : new ProofViewException(message, cause); }
java
public static ProofViewException fromThrowable(String message, Throwable cause) { return (cause instanceof ProofViewException && Objects.equals(message, cause.getMessage())) ? (ProofViewException) cause : new ProofViewException(message, cause); }
[ "public", "static", "ProofViewException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "ProofViewException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getMessage", ...
Converts a Throwable to a ProofViewException with the specified detail message. If the Throwable is a ProofViewException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new ProofViewException with the detail message. @...
[ "Converts", "a", "Throwable", "to", "a", "ProofViewException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "ProofViewException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "the", "on...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/query/exception/ProofViewException.java#L61-L65
train
cycorp/api-suite
core-api/src/main/java/com/cyc/kb/exception/KbException.java
KbException.fromThrowable
public static KbException fromThrowable(Throwable cause) { return (cause instanceof KbException) ? (KbException) cause : new KbException(cause); }
java
public static KbException fromThrowable(Throwable cause) { return (cause instanceof KbException) ? (KbException) cause : new KbException(cause); }
[ "public", "static", "KbException", "fromThrowable", "(", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "KbException", ")", "?", "(", "KbException", ")", "cause", ":", "new", "KbException", "(", "cause", ")", ";", "}" ]
Converts a Throwable to a KbException. If the Throwable is a KbException, it will be passed through unmodified; otherwise, it will be wrapped in a new KbException. @param cause the Throwable to convert @return a KbException
[ "Converts", "a", "Throwable", "to", "a", "KbException", ".", "If", "the", "Throwable", "is", "a", "KbException", "it", "will", "be", "passed", "through", "unmodified", ";", "otherwise", "it", "will", "be", "wrapped", "in", "a", "new", "KbException", "." ]
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/KbException.java#L45-L49
train
cycorp/api-suite
core-api/src/main/java/com/cyc/kb/exception/KbException.java
KbException.fromThrowable
public static KbException fromThrowable(String message, Throwable cause) { return (cause instanceof KbException && Objects.equals(message, cause.getMessage())) ? (KbException) cause : new KbException(message, cause); }
java
public static KbException fromThrowable(String message, Throwable cause) { return (cause instanceof KbException && Objects.equals(message, cause.getMessage())) ? (KbException) cause : new KbException(message, cause); }
[ "public", "static", "KbException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "KbException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getMessage", "(", ")", ...
Converts a Throwable to a KbException with the specified detail message. If the Throwable is a KbException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new KbException with the detail message. @param cause the...
[ "Converts", "a", "Throwable", "to", "a", "KbException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "KbException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "the", "one", "supplie...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/KbException.java#L62-L66
train
cycorp/api-suite
core-api/src/main/java/com/cyc/kb/exception/DeleteException.java
DeleteException.fromThrowable
public static DeleteException fromThrowable(Throwable cause) { return (cause instanceof DeleteException) ? (DeleteException) cause : new DeleteException(cause); }
java
public static DeleteException fromThrowable(Throwable cause) { return (cause instanceof DeleteException) ? (DeleteException) cause : new DeleteException(cause); }
[ "public", "static", "DeleteException", "fromThrowable", "(", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "DeleteException", ")", "?", "(", "DeleteException", ")", "cause", ":", "new", "DeleteException", "(", "cause", ")", ";", "}" ]
Converts a Throwable to a DeleteException. If the Throwable is a DeleteException, it will be passed through unmodified; otherwise, it will be wrapped in a new DeleteException. @param cause the Throwable to convert @return a DeleteException
[ "Converts", "a", "Throwable", "to", "a", "DeleteException", ".", "If", "the", "Throwable", "is", "a", "DeleteException", "it", "will", "be", "passed", "through", "unmodified", ";", "otherwise", "it", "will", "be", "wrapped", "in", "a", "new", "DeleteException"...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/DeleteException.java#L45-L49
train
cycorp/api-suite
core-api/src/main/java/com/cyc/kb/exception/DeleteException.java
DeleteException.fromThrowable
public static DeleteException fromThrowable(String message, Throwable cause) { return (cause instanceof DeleteException && Objects.equals(message, cause.getMessage())) ? (DeleteException) cause : new DeleteException(message, cause); }
java
public static DeleteException fromThrowable(String message, Throwable cause) { return (cause instanceof DeleteException && Objects.equals(message, cause.getMessage())) ? (DeleteException) cause : new DeleteException(message, cause); }
[ "public", "static", "DeleteException", "fromThrowable", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "return", "(", "cause", "instanceof", "DeleteException", "&&", "Objects", ".", "equals", "(", "message", ",", "cause", ".", "getMessage", "(", ...
Converts a Throwable to a DeleteException with the specified detail message. If the Throwable is a DeleteException and if the Throwable's message is identical to the one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in a new DeleteException with the detail message. @param cau...
[ "Converts", "a", "Throwable", "to", "a", "DeleteException", "with", "the", "specified", "detail", "message", ".", "If", "the", "Throwable", "is", "a", "DeleteException", "and", "if", "the", "Throwable", "s", "message", "is", "identical", "to", "the", "one", ...
1d52affabc4635e3715a059e38741712cbdbf2d5
https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/exception/DeleteException.java#L62-L66
train
m-m-m/util
pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/AbstractPojoIntrospector.java
AbstractPojoIntrospector.initialize
@PostConstruct public void initialize() { if (this.initializationState.setInitializing()) { if (this.visibility == null) { this.visibility = VisibilityModifier.PUBLIC; } this.initializationState.setInitialized(); } }
java
@PostConstruct public void initialize() { if (this.initializationState.setInitializing()) { if (this.visibility == null) { this.visibility = VisibilityModifier.PUBLIC; } this.initializationState.setInitialized(); } }
[ "@", "PostConstruct", "public", "void", "initialize", "(", ")", "{", "if", "(", "this", ".", "initializationState", ".", "setInitializing", "(", ")", ")", "{", "if", "(", "this", ".", "visibility", "==", "null", ")", "{", "this", ".", "visibility", "=", ...
This method initializes this class. It has to be called after construction and injection is completed.
[ "This", "method", "initializes", "this", "class", ".", "It", "has", "to", "be", "called", "after", "construction", "and", "injection", "is", "completed", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/AbstractPojoIntrospector.java#L101-L110
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/readers/ModuleBuildReader.java
ModuleBuildReader.getExtraBuilds
public List<ModuleBuildFuture> getExtraBuilds() { return extraBuilds == null ? Collections.<ModuleBuildFuture>emptyList() : Collections.unmodifiableList(extraBuilds); }
java
public List<ModuleBuildFuture> getExtraBuilds() { return extraBuilds == null ? Collections.<ModuleBuildFuture>emptyList() : Collections.unmodifiableList(extraBuilds); }
[ "public", "List", "<", "ModuleBuildFuture", ">", "getExtraBuilds", "(", ")", "{", "return", "extraBuilds", "==", "null", "?", "Collections", ".", "<", "ModuleBuildFuture", ">", "emptyList", "(", ")", ":", "Collections", ".", "unmodifiableList", "(", "extraBuilds...
Returns the list of additional futures that should be processed along with this build this future @return The list of extra build futures.
[ "Returns", "the", "list", "of", "additional", "futures", "that", "should", "be", "processed", "along", "with", "this", "build", "this", "future" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/readers/ModuleBuildReader.java#L157-L159
train
jMotif/GI
src/main/java/net/seninp/gi/rulepruner/RulePruningAlgorithm.java
RulePruningAlgorithm.getCoverDelta
public double getCoverDelta(GrammarRuleRecord rule) { // counts which uncovered points shall be covered int new_cover = 0; // counts overlaps with previously covered ranges int overlapping_cover = 0; // perform the sum computation for (RuleInterval i : rule.getRuleIntervals()) { int sta...
java
public double getCoverDelta(GrammarRuleRecord rule) { // counts which uncovered points shall be covered int new_cover = 0; // counts overlaps with previously covered ranges int overlapping_cover = 0; // perform the sum computation for (RuleInterval i : rule.getRuleIntervals()) { int sta...
[ "public", "double", "getCoverDelta", "(", "GrammarRuleRecord", "rule", ")", "{", "// counts which uncovered points shall be covered", "int", "new_cover", "=", "0", ";", "// counts overlaps with previously covered ranges", "int", "overlapping_cover", "=", "0", ";", "// perform...
Computes the delta value for the suggested rule candidate. @param rule the grammatical rule candidate. @return the delta value.
[ "Computes", "the", "delta", "value", "for", "the", "suggested", "rule", "candidate", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePruningAlgorithm.java#L88-L125
train
jMotif/GI
src/main/java/net/seninp/gi/rulepruner/RulePruningAlgorithm.java
RulePruningAlgorithm.isCompletelyCoveredBy
private boolean isCompletelyCoveredBy(int[] isCovered, List<RuleInterval> intervals) { for (RuleInterval i : intervals) { for (int j = i.getStart(); j < i.getEnd(); j++) { if (isCovered[j] == 0) { return false; } } } return true; }
java
private boolean isCompletelyCoveredBy(int[] isCovered, List<RuleInterval> intervals) { for (RuleInterval i : intervals) { for (int j = i.getStart(); j < i.getEnd(); j++) { if (isCovered[j] == 0) { return false; } } } return true; }
[ "private", "boolean", "isCompletelyCoveredBy", "(", "int", "[", "]", "isCovered", ",", "List", "<", "RuleInterval", ">", "intervals", ")", "{", "for", "(", "RuleInterval", "i", ":", "intervals", ")", "{", "for", "(", "int", "j", "=", "i", ".", "getStart"...
Checks if the cover is complete. @param isCovered the cover. @param intervals set of rule intervals. @return true if the set complete.
[ "Checks", "if", "the", "cover", "is", "complete", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePruningAlgorithm.java#L207-L216
train
jMotif/GI
src/main/java/net/seninp/gi/sequitur/SAXNonTerminal.java
SAXNonTerminal.expand
public void expand() { join(p, r.first()); join(r.last(), n); // Necessary so that garbage collector // can delete rule and guard. r.theGuard.r = null; r.theGuard = null; }
java
public void expand() { join(p, r.first()); join(r.last(), n); // Necessary so that garbage collector // can delete rule and guard. r.theGuard.r = null; r.theGuard = null; }
[ "public", "void", "expand", "(", ")", "{", "join", "(", "p", ",", "r", ".", "first", "(", ")", ")", ";", "join", "(", "r", ".", "last", "(", ")", ",", "n", ")", ";", "// Necessary so that garbage collector\r", "// can delete rule and guard.\r", "r", ".",...
This symbol is the last reference to its rule. The contents of the rule are substituted in its place.
[ "This", "symbol", "is", "the", "last", "reference", "to", "its", "rule", ".", "The", "contents", "of", "the", "rule", "are", "substituted", "in", "its", "place", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXNonTerminal.java#L82-L89
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/JSSource.java
JSSource.insert
public void insert(String str, int lineno, int colno) { final String sourceMethod = "insert"; //$NON-NLS-1$ if (isTraceLogging) { log.entering(JSSource.class.getName(), sourceMethod, new Object[]{str, lineno, colno}); } PositionLocator locator = new PositionLocator(lineno, colno); locator.insert(str)...
java
public void insert(String str, int lineno, int colno) { final String sourceMethod = "insert"; //$NON-NLS-1$ if (isTraceLogging) { log.entering(JSSource.class.getName(), sourceMethod, new Object[]{str, lineno, colno}); } PositionLocator locator = new PositionLocator(lineno, colno); locator.insert(str)...
[ "public", "void", "insert", "(", "String", "str", ",", "int", "lineno", ",", "int", "colno", ")", "{", "final", "String", "sourceMethod", "=", "\"insert\"", ";", "//$NON-NLS-1$\r", "if", "(", "isTraceLogging", ")", "{", "log", ".", "entering", "(", "JSSour...
Inserts the specified string into the source at the specified location @param str the string to insert @param lineno the line number to insert to @param colno the column number to insert to
[ "Inserts", "the", "specified", "string", "into", "the", "source", "at", "the", "specified", "location" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/JSSource.java#L85-L95
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/util/JSSource.java
JSSource.appendln
public void appendln(String str) { BufferedReader rdr = new BufferedReader(new StringReader(str)); while (true) { String line = null; try { line = rdr.readLine(); } catch (IOException e) { // shouldn't ever happen since we're using a StringReader throw new RuntimeException(e); } ...
java
public void appendln(String str) { BufferedReader rdr = new BufferedReader(new StringReader(str)); while (true) { String line = null; try { line = rdr.readLine(); } catch (IOException e) { // shouldn't ever happen since we're using a StringReader throw new RuntimeException(e); } ...
[ "public", "void", "appendln", "(", "String", "str", ")", "{", "BufferedReader", "rdr", "=", "new", "BufferedReader", "(", "new", "StringReader", "(", "str", ")", ")", ";", "while", "(", "true", ")", "{", "String", "line", "=", "null", ";", "try", "{", ...
Appends the lines in the specified string to the current source. @param str
[ "Appends", "the", "lines", "in", "the", "specified", "string", "to", "the", "current", "source", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/JSSource.java#L106-L122
train
m-m-m/util
xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/IdResolverContext.java
IdResolverContext.disposeAndValidate
public void disposeAndValidate() throws ObjectNotFoundException, ComposedException { List<NlsObject> errorList = this.duplicateIdErrors; this.duplicateIdErrors = null; for (Resolver resolver : this.id2callableMap.values()) { if (!resolver.resolved) { errorList.add(this.bundle.errorObjectNotFo...
java
public void disposeAndValidate() throws ObjectNotFoundException, ComposedException { List<NlsObject> errorList = this.duplicateIdErrors; this.duplicateIdErrors = null; for (Resolver resolver : this.id2callableMap.values()) { if (!resolver.resolved) { errorList.add(this.bundle.errorObjectNotFo...
[ "public", "void", "disposeAndValidate", "(", ")", "throws", "ObjectNotFoundException", ",", "ComposedException", "{", "List", "<", "NlsObject", ">", "errorList", "=", "this", ".", "duplicateIdErrors", ";", "this", ".", "duplicateIdErrors", "=", "null", ";", "for",...
This method disposes this context and performs a validation that all IDs have been resolved. @throws ObjectNotFoundException if a single ID was NOT resolved. @throws ComposedException if multiple IDs have NOT been resolved.
[ "This", "method", "disposes", "this", "context", "and", "performs", "a", "validation", "that", "all", "IDs", "have", "been", "resolved", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/IdResolverContext.java#L94-L110
train
m-m-m/util
sandbox/src/main/java/net/sf/mmm/util/xml/NamespaceContextImpl.java
NamespaceContextImpl.setNamespace
public void setNamespace(String prefix, String uri) { this.prefix2namespace.put(prefix, uri); this.namespace2prefix.put(uri, prefix); }
java
public void setNamespace(String prefix, String uri) { this.prefix2namespace.put(prefix, uri); this.namespace2prefix.put(uri, prefix); }
[ "public", "void", "setNamespace", "(", "String", "prefix", ",", "String", "uri", ")", "{", "this", ".", "prefix2namespace", ".", "put", "(", "prefix", ",", "uri", ")", ";", "this", ".", "namespace2prefix", ".", "put", "(", "uri", ",", "prefix", ")", ";...
This method is used to declare a namespace in this context. @param prefix is the prefix for the namespace. @param uri is the URI of the namespace.
[ "This", "method", "is", "used", "to", "declare", "a", "namespace", "in", "this", "context", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/sandbox/src/main/java/net/sf/mmm/util/xml/NamespaceContextImpl.java#L89-L93
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java
InstanceSolverRunner.build
private ChocoConstraint build(Constraint cstr) throws SchedulerException { ChocoMapper mapper = params.getMapper(); ChocoConstraint cc = mapper.get(cstr); if (cc == null) { throw new SchedulerModelingException(origin, "No implementation mapped to '" + cstr.getClass().getSimpleName() ...
java
private ChocoConstraint build(Constraint cstr) throws SchedulerException { ChocoMapper mapper = params.getMapper(); ChocoConstraint cc = mapper.get(cstr); if (cc == null) { throw new SchedulerModelingException(origin, "No implementation mapped to '" + cstr.getClass().getSimpleName() ...
[ "private", "ChocoConstraint", "build", "(", "Constraint", "cstr", ")", "throws", "SchedulerException", "{", "ChocoMapper", "mapper", "=", "params", ".", "getMapper", "(", ")", ";", "ChocoConstraint", "cc", "=", "mapper", ".", "get", "(", "cstr", ")", ";", "i...
Build a sat constraint @param cstr the model-side constraint @return the solver-side constraint @throws SchedulerException if the process failed
[ "Build", "a", "sat", "constraint" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java#L274-L281
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java
InstanceSolverRunner.checkNodesExistence
private static void checkNodesExistence(Model mo, Collection<Node> ns) throws SchedulerModelingException { for (Node node : ns) { if (!mo.getMapping().contains(node)) { throw new SchedulerModelingException(mo, "Unknown node '" + node + "'"); } } }
java
private static void checkNodesExistence(Model mo, Collection<Node> ns) throws SchedulerModelingException { for (Node node : ns) { if (!mo.getMapping().contains(node)) { throw new SchedulerModelingException(mo, "Unknown node '" + node + "'"); } } }
[ "private", "static", "void", "checkNodesExistence", "(", "Model", "mo", ",", "Collection", "<", "Node", ">", "ns", ")", "throws", "SchedulerModelingException", "{", "for", "(", "Node", "node", ":", "ns", ")", "{", "if", "(", "!", "mo", ".", "getMapping", ...
Check for the existence of nodes in a model @param mo the model to check @param ns the nodes to check @throws SchedulerModelingException if at least one of the given nodes is not in the RP.
[ "Check", "for", "the", "existence", "of", "nodes", "in", "a", "model" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java#L301-L307
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java
InstanceSolverRunner.getStatistics
public SingleRunnerStatistics getStatistics() { if (rp != null) { Measures m = rp.getSolver().getMeasures(); stats.setMetrics(new Metrics(m)); stats.setCompleted(m.getSearchState().equals(SearchState.TERMINATED) || m.getSearchState().equals(SearchState.NEW) ...
java
public SingleRunnerStatistics getStatistics() { if (rp != null) { Measures m = rp.getSolver().getMeasures(); stats.setMetrics(new Metrics(m)); stats.setCompleted(m.getSearchState().equals(SearchState.TERMINATED) || m.getSearchState().equals(SearchState.NEW) ...
[ "public", "SingleRunnerStatistics", "getStatistics", "(", ")", "{", "if", "(", "rp", "!=", "null", ")", "{", "Measures", "m", "=", "rp", ".", "getSolver", "(", ")", ".", "getMeasures", "(", ")", ";", "stats", ".", "setMetrics", "(", "new", "Metrics", "...
Get the statistics about the solving process. @return the statistics
[ "Get", "the", "statistics", "about", "the", "solving", "process", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java#L314-L323
train
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java
DistanceComputation.calcDistTSAndPattern
protected double calcDistTSAndPattern(double[] ts, double[] pValue) { double INF = 10000000000000000000f; double bestDist = INF; int patternLen = pValue.length; int lastStartP = ts.length - pValue.length + 1; if (lastStartP < 1) return bestDist; Random rand = new Random(); ...
java
protected double calcDistTSAndPattern(double[] ts, double[] pValue) { double INF = 10000000000000000000f; double bestDist = INF; int patternLen = pValue.length; int lastStartP = ts.length - pValue.length + 1; if (lastStartP < 1) return bestDist; Random rand = new Random(); ...
[ "protected", "double", "calcDistTSAndPattern", "(", "double", "[", "]", "ts", ",", "double", "[", "]", "pValue", ")", "{", "double", "INF", "=", "10000000000000000000f", ";", "double", "bestDist", "=", "INF", ";", "int", "patternLen", "=", "pValue", ".", "...
Calculating the distance between time series and pattern. @param ts a series of points for time series. @param pValue a series of points for pattern. @return the distance value.
[ "Calculating", "the", "distance", "between", "time", "series", "and", "pattern", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java#L14-L42
train
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java
DistanceComputation.eculideanDistNormEAbandon
protected double eculideanDistNormEAbandon(double[] ts1, double[] ts2, double bsfDist) { double dist = 0; double tsLen = ts1.length; double bsf = Math.pow(tsLen * bsfDist, 2); for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); ...
java
protected double eculideanDistNormEAbandon(double[] ts1, double[] ts2, double bsfDist) { double dist = 0; double tsLen = ts1.length; double bsf = Math.pow(tsLen * bsfDist, 2); for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); ...
[ "protected", "double", "eculideanDistNormEAbandon", "(", "double", "[", "]", "ts1", ",", "double", "[", "]", "ts2", ",", "double", "bsfDist", ")", "{", "double", "dist", "=", "0", ";", "double", "tsLen", "=", "ts1", ".", "length", ";", "double", "bsf", ...
Normalized early abandoned Euclidean distance. @param ts1 the first series. @param ts2 the second series. @param bsfDist the distance value (used for early abandon). @return the distance value.
[ "Normalized", "early", "abandoned", "Euclidean", "distance", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java#L52-L67
train
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java
DistanceComputation.eculideanDistNorm
protected double eculideanDistNorm(double[] ts1, double[] ts2) { double dist = 0; double tsLen = ts1.length; for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); } return Math.sqrt(dist) / tsLen; }
java
protected double eculideanDistNorm(double[] ts1, double[] ts2) { double dist = 0; double tsLen = ts1.length; for (int i = 0; i < ts1.length; i++) { double diff = ts1[i] - ts2[i]; dist += Math.pow(diff, 2); } return Math.sqrt(dist) / tsLen; }
[ "protected", "double", "eculideanDistNorm", "(", "double", "[", "]", "ts1", ",", "double", "[", "]", "ts2", ")", "{", "double", "dist", "=", "0", ";", "double", "tsLen", "=", "ts1", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", ...
Normalized Euclidean distance. @param ts1 the first series. @param ts2 the second series. @return the distance value.
[ "Normalized", "Euclidean", "distance", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/DistanceComputation.java#L76-L86
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/AliasedCumulativesFiltering.java
AliasedCumulativesFiltering.toAbsoluteFreeResources
private static void toAbsoluteFreeResources(TIntIntHashMap changes, int[] sortedMoments) { for (int i = 1; i < sortedMoments.length; i++) { int t = sortedMoments[i]; int lastT = sortedMoments[i - 1]; int lastFree = changes.get(lastT); changes.put(t, changes.get(t...
java
private static void toAbsoluteFreeResources(TIntIntHashMap changes, int[] sortedMoments) { for (int i = 1; i < sortedMoments.length; i++) { int t = sortedMoments[i]; int lastT = sortedMoments[i - 1]; int lastFree = changes.get(lastT); changes.put(t, changes.get(t...
[ "private", "static", "void", "toAbsoluteFreeResources", "(", "TIntIntHashMap", "changes", ",", "int", "[", "]", "sortedMoments", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "sortedMoments", ".", "length", ";", "i", "++", ")", "{", "int", ...
Translation for a relatives resources changes to an absolute free resources. @param changes the map that indicates the free CPU variation @param sortedMoments the different moments sorted in ascending order
[ "Translation", "for", "a", "relatives", "resources", "changes", "to", "an", "absolute", "free", "resources", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/AliasedCumulativesFiltering.java#L176-L184
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/CNetwork.java
CNetwork.addLinkConstraints
private void addLinkConstraints(ReconfigurationProblem rp) { // Links limitation List<Task> tasksListUp = new ArrayList<>(); List<Task> tasksListDown = new ArrayList<>(); List<IntVar> heightsListUp = new ArrayList<>(); List<IntVar> heightsListDown = new ArrayList<>(); f...
java
private void addLinkConstraints(ReconfigurationProblem rp) { // Links limitation List<Task> tasksListUp = new ArrayList<>(); List<Task> tasksListDown = new ArrayList<>(); List<IntVar> heightsListUp = new ArrayList<>(); List<IntVar> heightsListDown = new ArrayList<>(); f...
[ "private", "void", "addLinkConstraints", "(", "ReconfigurationProblem", "rp", ")", "{", "// Links limitation", "List", "<", "Task", ">", "tasksListUp", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "Task", ">", "tasksListDown", "=", "new", "ArrayL...
Add the cumulative constraints for each link. Full-duplex links are considered, two cumulative constraints are defined per link by looking at the migration direction for each link on the migration path. @param rp the reconfiguration problem
[ "Add", "the", "cumulative", "constraints", "for", "each", "link", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CNetwork.java#L189-L253
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/MappingUtils.java
MappingUtils.fill
public static void fill(Mapping src, Mapping dst) { for (Node off : src.getOfflineNodes()) { dst.addOfflineNode(off); } for (VM r : src.getReadyVMs()) { dst.addReadyVM(r); } for (Node on : src.getOnlineNodes()) { dst.addOnlineNode(on); ...
java
public static void fill(Mapping src, Mapping dst) { for (Node off : src.getOfflineNodes()) { dst.addOfflineNode(off); } for (VM r : src.getReadyVMs()) { dst.addReadyVM(r); } for (Node on : src.getOnlineNodes()) { dst.addOnlineNode(on); ...
[ "public", "static", "void", "fill", "(", "Mapping", "src", ",", "Mapping", "dst", ")", "{", "for", "(", "Node", "off", ":", "src", ".", "getOfflineNodes", "(", ")", ")", "{", "dst", ".", "addOfflineNode", "(", "off", ")", ";", "}", "for", "(", "VM"...
Fill a destination mapping with all the elements in a source mapping @param src the mapping to copy @param dst the destination mapping
[ "Fill", "a", "destination", "mapping", "with", "all", "the", "elements", "in", "a", "source", "mapping" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/MappingUtils.java#L42-L59
train
jMotif/GI
src/main/java/net/seninp/gi/repair/RePairRule.java
RePairRule.toRuleString
public String toRuleString() { if (0 == this.ruleNumber) { return this.grammar.r0String; } return this.first.toString() + SPACE + this.second.toString() + SPACE; }
java
public String toRuleString() { if (0 == this.ruleNumber) { return this.grammar.r0String; } return this.first.toString() + SPACE + this.second.toString() + SPACE; }
[ "public", "String", "toRuleString", "(", ")", "{", "if", "(", "0", "==", "this", ".", "ruleNumber", ")", "{", "return", "this", ".", "grammar", ".", "r0String", ";", "}", "return", "this", ".", "first", ".", "toString", "(", ")", "+", "SPACE", "+", ...
Return the prefixed with R rule. @return rule string.
[ "Return", "the", "prefixed", "with", "R", "rule", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RePairRule.java#L106-L111
train
jMotif/GI
src/main/java/net/seninp/gi/repair/RePairRule.java
RePairRule.getOccurrences
public int[] getOccurrences() { int[] res = new int[this.occurrences.size()]; for (int i = 0; i < this.occurrences.size(); i++) { res[i] = this.occurrences.get(i); } return res; }
java
public int[] getOccurrences() { int[] res = new int[this.occurrences.size()]; for (int i = 0; i < this.occurrences.size(); i++) { res[i] = this.occurrences.get(i); } return res; }
[ "public", "int", "[", "]", "getOccurrences", "(", ")", "{", "int", "[", "]", "res", "=", "new", "int", "[", "this", ".", "occurrences", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "occurrences"...
Gets occurrences. @return all rule's occurrences.
[ "Gets", "occurrences", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RePairRule.java#L148-L154
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/KeyGenUtil.java
KeyGenUtil.isProvisional
static public boolean isProvisional(Iterable<ICacheKeyGenerator> keyGens) { boolean provisional = false; for (ICacheKeyGenerator keyGen : keyGens) { if (keyGen.isProvisional()) { provisional = true; break; } } return provisional; }
java
static public boolean isProvisional(Iterable<ICacheKeyGenerator> keyGens) { boolean provisional = false; for (ICacheKeyGenerator keyGen : keyGens) { if (keyGen.isProvisional()) { provisional = true; break; } } return provisional; }
[ "static", "public", "boolean", "isProvisional", "(", "Iterable", "<", "ICacheKeyGenerator", ">", "keyGens", ")", "{", "boolean", "provisional", "=", "false", ";", "for", "(", "ICacheKeyGenerator", "keyGen", ":", "keyGens", ")", "{", "if", "(", "keyGen", ".", ...
Return true if any of the cache key generators in the array is a provisional cache key generator. @param keyGens The array @return True if there is a provisional cache key generator in the array
[ "Return", "true", "if", "any", "of", "the", "cache", "key", "generators", "in", "the", "array", "is", "a", "provisional", "cache", "key", "generator", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/cachekeygenerator/KeyGenUtil.java#L39-L48
train
protegeproject/jpaul
src/main/java/jpaul/DataStructs/DSUtil.java
DSUtil.unionColl
public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) { return new UColl<E>(c1, c2); }
java
public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) { return new UColl<E>(c1, c2); }
[ "public", "static", "<", "E", ">", "Collection", "<", "E", ">", "unionColl", "(", "Collection", "<", "E", ">", "c1", ",", "Collection", "<", "E", ">", "c2", ")", "{", "return", "new", "UColl", "<", "E", ">", "(", "c1", ",", "c2", ")", ";", "}" ...
Returns the immutable union of two collections.
[ "Returns", "the", "immutable", "union", "of", "two", "collections", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L185-L187
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/RequestedModuleNames.java
RequestedModuleNames.unfoldModulesHelper
protected void unfoldModulesHelper(Object obj, String path, String[] aPrefixes, Map<Integer, String> modules) throws IOException, JSONException { final String sourceMethod = "unfoldModulesHelper"; //$NON-NLS-1$ if (isTraceLogging) { log.entering(RequestedModuleNames.class.getName(), sourceMethod, new Object[]...
java
protected void unfoldModulesHelper(Object obj, String path, String[] aPrefixes, Map<Integer, String> modules) throws IOException, JSONException { final String sourceMethod = "unfoldModulesHelper"; //$NON-NLS-1$ if (isTraceLogging) { log.entering(RequestedModuleNames.class.getName(), sourceMethod, new Object[]...
[ "protected", "void", "unfoldModulesHelper", "(", "Object", "obj", ",", "String", "path", ",", "String", "[", "]", "aPrefixes", ",", "Map", "<", "Integer", ",", "String", ">", "modules", ")", "throws", "IOException", ",", "JSONException", "{", "final", "Strin...
Helper routine to unfold folded module names @param obj The folded path list of names, as a string or JSON object @param path The reference path @param aPrefixes Array of loader plugin prefixes @param modules Output - the list of unfolded modlue names as a sparse array implemented using a map with integer keys @throws...
[ "Helper", "routine", "to", "unfold", "folded", "module", "names" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/RequestedModuleNames.java#L529-L562
train
protegeproject/jpaul
src/main/java/jpaul/DataStructs/MapFacts.java
MapFacts.cow
public static <K,V> MapFactory<K,V> cow(MapFactory<K,V> underMapFact) { throw new UnsupportedOperationException("Not implemented yet"); }
java
public static <K,V> MapFactory<K,V> cow(MapFactory<K,V> underMapFact) { throw new UnsupportedOperationException("Not implemented yet"); }
[ "public", "static", "<", "K", ",", "V", ">", "MapFactory", "<", "K", ",", "V", ">", "cow", "(", "MapFactory", "<", "K", ",", "V", ">", "underMapFact", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Not implemented yet\"", ")", ";", "}...
Copy-on-write maps. UNIMPLEMENTED YET.
[ "Copy", "-", "on", "-", "write", "maps", ".", "UNIMPLEMENTED", "YET", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/MapFacts.java#L111-L113
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.sealObject
private void sealObject(ScriptableObject obj) { obj.sealObject(); Object[] ids = obj.getIds(); for (Object id : ids) { Object child = obj.get(id); if (child instanceof ScriptableObject) { sealObject((ScriptableObject)child); } } }
java
private void sealObject(ScriptableObject obj) { obj.sealObject(); Object[] ids = obj.getIds(); for (Object id : ids) { Object child = obj.get(id); if (child instanceof ScriptableObject) { sealObject((ScriptableObject)child); } } }
[ "private", "void", "sealObject", "(", "ScriptableObject", "obj", ")", "{", "obj", ".", "sealObject", "(", ")", ";", "Object", "[", "]", "ids", "=", "obj", ".", "getIds", "(", ")", ";", "for", "(", "Object", "id", ":", "ids", ")", "{", "Object", "ch...
Recursively seals the specified object and all the objects it contains. @param obj the object to seal
[ "Recursively", "seals", "the", "specified", "object", "and", "all", "the", "objects", "it", "contains", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L147-L156
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl._resolve
protected String _resolve( String name, Features features, Set<String> dependentFeatures, boolean resolveAliases, boolean evaluateHasPluginConditionals, int recursionCount, StringBuffer sb) { final String sourceMethod = "_resolve"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggabl...
java
protected String _resolve( String name, Features features, Set<String> dependentFeatures, boolean resolveAliases, boolean evaluateHasPluginConditionals, int recursionCount, StringBuffer sb) { final String sourceMethod = "_resolve"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggabl...
[ "protected", "String", "_resolve", "(", "String", "name", ",", "Features", "features", ",", "Set", "<", "String", ">", "dependentFeatures", ",", "boolean", "resolveAliases", ",", "boolean", "evaluateHasPluginConditionals", ",", "int", "recursionCount", ",", "StringB...
Resolves a module id by applying alias resolution and has! loader plugin resolution. @param name The module name to map. May specify plugins @param features Features that are defined in the request @param dependentFeatures Output - Set of feature names that the returned value is conditioned on. Used for cache managem...
[ "Resolves", "a", "module", "id", "by", "applying", "alias", "resolution", "and", "has!", "loader", "plugin", "resolution", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L744-L798
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadConfigUri
protected URI loadConfigUri() throws URISyntaxException, FileNotFoundException { Collection<String> configNames = getAggregator().getInitParams().getValues(InitParams.CONFIG_INITPARAM); if (configNames.size() != 1) { throw new IllegalArgumentException(InitParams.CONFIG_INITPARAM); } String configName = ...
java
protected URI loadConfigUri() throws URISyntaxException, FileNotFoundException { Collection<String> configNames = getAggregator().getInitParams().getValues(InitParams.CONFIG_INITPARAM); if (configNames.size() != 1) { throw new IllegalArgumentException(InitParams.CONFIG_INITPARAM); } String configName = ...
[ "protected", "URI", "loadConfigUri", "(", ")", "throws", "URISyntaxException", ",", "FileNotFoundException", "{", "Collection", "<", "String", ">", "configNames", "=", "getAggregator", "(", ")", ".", "getInitParams", "(", ")", ".", "getValues", "(", "InitParams", ...
Initializes and returns the URI to the server-side config JavaScript @return The config URI @throws URISyntaxException @throws FileNotFoundException
[ "Initializes", "and", "returns", "the", "URI", "to", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L903-L910
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadBaseURI
protected Location loadBaseURI(Scriptable cfg) throws URISyntaxException { Object baseObj = cfg.get(BASEURL_CONFIGPARAM, cfg); Location result; if (baseObj == Scriptable.NOT_FOUND) { result = new Location(getConfigUri().resolve(".")); //$NON-NLS-1$ } else { Location loc = loadLocation(baseObj, true...
java
protected Location loadBaseURI(Scriptable cfg) throws URISyntaxException { Object baseObj = cfg.get(BASEURL_CONFIGPARAM, cfg); Location result; if (baseObj == Scriptable.NOT_FOUND) { result = new Location(getConfigUri().resolve(".")); //$NON-NLS-1$ } else { Location loc = loadLocation(baseObj, true...
[ "protected", "Location", "loadBaseURI", "(", "Scriptable", "cfg", ")", "throws", "URISyntaxException", "{", "Object", "baseObj", "=", "cfg", ".", "get", "(", "BASEURL_CONFIGPARAM", ",", "cfg", ")", ";", "Location", "result", ";", "if", "(", "baseObj", "==", ...
Initializes and returns the base URI specified by the "baseUrl" property in the server-side config JavaScript @param cfg the parsed config JavaScript @return the base URI @throws URISyntaxException
[ "Initializes", "and", "returns", "the", "base", "URI", "specified", "by", "the", "baseUrl", "property", "in", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L921-L932
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadConfig
protected Scriptable loadConfig(String configScript) throws IOException { configScript = processConfig(configScript); Context cx = Context.enter(); Scriptable config; try { sharedScope = cx.initStandardObjects(null, true); // set up options object IOptions options = aggregator.getOptions(); ...
java
protected Scriptable loadConfig(String configScript) throws IOException { configScript = processConfig(configScript); Context cx = Context.enter(); Scriptable config; try { sharedScope = cx.initStandardObjects(null, true); // set up options object IOptions options = aggregator.getOptions(); ...
[ "protected", "Scriptable", "loadConfig", "(", "String", "configScript", ")", "throws", "IOException", "{", "configScript", "=", "processConfig", "(", "configScript", ")", ";", "Context", "cx", "=", "Context", ".", "enter", "(", ")", ";", "Scriptable", "config", ...
Loads the config JavaScript and returns the parsed config in a Map @param configScript The javascript config as a text string @return the parsed config in a properties map @throws IOException
[ "Loads", "the", "config", "JavaScript", "and", "returns", "the", "parsed", "config", "in", "a", "Map" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L960-L1026
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadPackages
protected Map<String, IPackage> loadPackages(Scriptable cfg) throws URISyntaxException { Object obj = cfg.get(PACKAGES_CONFIGPARAM, cfg); Map<String, IPackage> packages = new HashMap<String, IPackage>(); if (obj instanceof Scriptable) { for (Object id : ((Scriptable)obj).getIds()) { if (id instanceof ...
java
protected Map<String, IPackage> loadPackages(Scriptable cfg) throws URISyntaxException { Object obj = cfg.get(PACKAGES_CONFIGPARAM, cfg); Map<String, IPackage> packages = new HashMap<String, IPackage>(); if (obj instanceof Scriptable) { for (Object id : ((Scriptable)obj).getIds()) { if (id instanceof ...
[ "protected", "Map", "<", "String", ",", "IPackage", ">", "loadPackages", "(", "Scriptable", "cfg", ")", "throws", "URISyntaxException", "{", "Object", "obj", "=", "cfg", ".", "get", "(", "PACKAGES_CONFIGPARAM", ",", "cfg", ")", ";", "Map", "<", "String", "...
Initializes and returns the map of packages based on the information in the server-side config JavaScript @param cfg The parsed config JavaScript as a properties map @return the package map @throws URISyntaxException
[ "Initializes", "and", "returns", "the", "map", "of", "packages", "based", "on", "the", "information", "in", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1037-L1053
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadPaths
protected Map<String, Location> loadPaths(Scriptable cfg) throws URISyntaxException { Object pathlocs = cfg.get(PATHS_CONFIGPARAM, cfg); Map<String, Location> paths = new HashMap<String, Location>(); if (pathlocs instanceof Scriptable) { for (Object key : ((Scriptable)pathlocs).getIds()) { String name...
java
protected Map<String, Location> loadPaths(Scriptable cfg) throws URISyntaxException { Object pathlocs = cfg.get(PATHS_CONFIGPARAM, cfg); Map<String, Location> paths = new HashMap<String, Location>(); if (pathlocs instanceof Scriptable) { for (Object key : ((Scriptable)pathlocs).getIds()) { String name...
[ "protected", "Map", "<", "String", ",", "Location", ">", "loadPaths", "(", "Scriptable", "cfg", ")", "throws", "URISyntaxException", "{", "Object", "pathlocs", "=", "cfg", ".", "get", "(", "PATHS_CONFIGPARAM", ",", "cfg", ")", ";", "Map", "<", "String", ",...
Initializes and returns the map of paths based on the information in the server-side config JavaScript @param cfg The parsed config JavaScript as a properties map @return the map of path-name/path-URI pairs @throws URISyntaxException
[ "Initializes", "and", "returns", "the", "map", "of", "paths", "based", "on", "the", "information", "in", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1064-L1078
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadAliases
protected List<IAlias> loadAliases(Scriptable cfg) throws IOException { Object aliasList = cfg.get(ALIASES_CONFIGPARAM, cfg); List<IAlias> aliases = new LinkedList<IAlias>(); if (aliasList instanceof Scriptable) { for (Object id : ((Scriptable)aliasList).getIds()) { if (id instanceof Number) { N...
java
protected List<IAlias> loadAliases(Scriptable cfg) throws IOException { Object aliasList = cfg.get(ALIASES_CONFIGPARAM, cfg); List<IAlias> aliases = new LinkedList<IAlias>(); if (aliasList instanceof Scriptable) { for (Object id : ((Scriptable)aliasList).getIds()) { if (id instanceof Number) { N...
[ "protected", "List", "<", "IAlias", ">", "loadAliases", "(", "Scriptable", "cfg", ")", "throws", "IOException", "{", "Object", "aliasList", "=", "cfg", ".", "get", "(", "ALIASES_CONFIGPARAM", ",", "cfg", ")", ";", "List", "<", "IAlias", ">", "aliases", "="...
Initializes and returns the list of aliases defined in the server-side config JavaScript @param cfg The parsed config JavaScript as a properties map @return the list of aliases @throws IOException
[ "Initializes", "and", "returns", "the", "list", "of", "aliases", "defined", "in", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1089-L1129
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadDeps
protected List<String> loadDeps(Scriptable cfg) { final String methodName = "loadDeps"; //$NON-NLS-1$ Object depsList = cfg.get(DEPS_CONFIGPARAM, cfg); List<String> deps = new LinkedList<String>(); if (depsList instanceof Scriptable) { for (Object id : ((Scriptable)depsList).getIds()) { if (id inst...
java
protected List<String> loadDeps(Scriptable cfg) { final String methodName = "loadDeps"; //$NON-NLS-1$ Object depsList = cfg.get(DEPS_CONFIGPARAM, cfg); List<String> deps = new LinkedList<String>(); if (depsList instanceof Scriptable) { for (Object id : ((Scriptable)depsList).getIds()) { if (id inst...
[ "protected", "List", "<", "String", ">", "loadDeps", "(", "Scriptable", "cfg", ")", "{", "final", "String", "methodName", "=", "\"loadDeps\"", ";", "//$NON-NLS-1$\r", "Object", "depsList", "=", "cfg", ".", "get", "(", "DEPS_CONFIGPARAM", ",", "cfg", ")", ";"...
Initializes and returns the list of module dependencies specified in the server-side config JavaScript. @param cfg The parsed config JavaScript as a properties map @return the list of module dependencies
[ "Initializes", "and", "returns", "the", "list", "of", "module", "dependencies", "specified", "in", "the", "server", "-", "side", "config", "JavaScript", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1139-L1154
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadExpires
protected int loadExpires(Scriptable cfg) { int expires = 0; Object oExpires = cfg.get(EXPIRES_CONFIGPARAM, cfg); if (oExpires != Scriptable.NOT_FOUND) { try { expires = Integer.parseInt(toString(oExpires)); } catch (NumberFormatException ignore) { throw new IllegalArgumentException(EXPIRES_C...
java
protected int loadExpires(Scriptable cfg) { int expires = 0; Object oExpires = cfg.get(EXPIRES_CONFIGPARAM, cfg); if (oExpires != Scriptable.NOT_FOUND) { try { expires = Integer.parseInt(toString(oExpires)); } catch (NumberFormatException ignore) { throw new IllegalArgumentException(EXPIRES_C...
[ "protected", "int", "loadExpires", "(", "Scriptable", "cfg", ")", "{", "int", "expires", "=", "0", ";", "Object", "oExpires", "=", "cfg", ".", "get", "(", "EXPIRES_CONFIGPARAM", ",", "cfg", ")", ";", "if", "(", "oExpires", "!=", "Scriptable", ".", "NOT_F...
Initializes and returns the expires time from the server-side config JavaScript @param cfg The parsed config JavaScript as a properties map @return the expires time
[ "Initializes", "and", "returns", "the", "expires", "time", "from", "the", "server", "-", "side", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1164-L1175
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadDepsIncludeBaseUrl
protected boolean loadDepsIncludeBaseUrl(Scriptable cfg) { boolean result = false; Object value = cfg.get(DEPSINCLUDEBASEURL_CONFIGPARAM, cfg); if (value != Scriptable.NOT_FOUND) { result = TypeUtil.asBoolean(toString(value), false); } return result; }
java
protected boolean loadDepsIncludeBaseUrl(Scriptable cfg) { boolean result = false; Object value = cfg.get(DEPSINCLUDEBASEURL_CONFIGPARAM, cfg); if (value != Scriptable.NOT_FOUND) { result = TypeUtil.asBoolean(toString(value), false); } return result; }
[ "protected", "boolean", "loadDepsIncludeBaseUrl", "(", "Scriptable", "cfg", ")", "{", "boolean", "result", "=", "false", ";", "Object", "value", "=", "cfg", ".", "get", "(", "DEPSINCLUDEBASEURL_CONFIGPARAM", ",", "cfg", ")", ";", "if", "(", "value", "!=", "S...
Initializes and returns the flag indicating if files and directories located under the base directory should be scanned for javascript files when building the module dependency mappings. The default is false. @param cfg The parsed config JavaScript as a properties map @return true if files and folder under the base d...
[ "Initializes", "and", "returns", "the", "flag", "indicating", "if", "files", "and", "directories", "located", "under", "the", "base", "directory", "should", "be", "scanned", "for", "javascript", "files", "when", "building", "the", "module", "dependency", "mappings...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1187-L1194
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadCoerceUndefinedToFalse
protected boolean loadCoerceUndefinedToFalse(Scriptable cfg) { boolean result = false; Object value = cfg.get(COERCEUNDEFINEDTOFALSE_CONFIGPARAM, cfg); if (value != Scriptable.NOT_FOUND) { result = TypeUtil.asBoolean(toString(value), false); } return result; }
java
protected boolean loadCoerceUndefinedToFalse(Scriptable cfg) { boolean result = false; Object value = cfg.get(COERCEUNDEFINEDTOFALSE_CONFIGPARAM, cfg); if (value != Scriptable.NOT_FOUND) { result = TypeUtil.asBoolean(toString(value), false); } return result; }
[ "protected", "boolean", "loadCoerceUndefinedToFalse", "(", "Scriptable", "cfg", ")", "{", "boolean", "result", "=", "false", ";", "Object", "value", "=", "cfg", ".", "get", "(", "COERCEUNDEFINEDTOFALSE_CONFIGPARAM", ",", "cfg", ")", ";", "if", "(", "value", "!...
Initializes and returns the flag indicating if features not specified in the feature set from the request should be treated as false when evaluating has conditionals in javascript code. The default is false. @param cfg The parsed config JavaScript as a properties map @return True if un-specified features should be tr...
[ "Initializes", "and", "returns", "the", "flag", "indicating", "if", "features", "not", "specified", "in", "the", "feature", "set", "from", "the", "request", "should", "be", "treated", "as", "false", "when", "evaluating", "has", "conditionals", "in", "javascript"...
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1205-L1212
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.loadPluginDelegators
protected Set<String> loadPluginDelegators(Scriptable cfg, String name) { Set<String> result = null; Object delegators = cfg.get(name, cfg); if (delegators != Scriptable.NOT_FOUND && delegators instanceof Scriptable) { result = new HashSet<String>(); for (Object id : ((Scriptable)delegators).getIds())...
java
protected Set<String> loadPluginDelegators(Scriptable cfg, String name) { Set<String> result = null; Object delegators = cfg.get(name, cfg); if (delegators != Scriptable.NOT_FOUND && delegators instanceof Scriptable) { result = new HashSet<String>(); for (Object id : ((Scriptable)delegators).getIds())...
[ "protected", "Set", "<", "String", ">", "loadPluginDelegators", "(", "Scriptable", "cfg", ",", "String", "name", ")", "{", "Set", "<", "String", ">", "result", "=", "null", ";", "Object", "delegators", "=", "cfg", ".", "get", "(", "name", ",", "cfg", "...
Common routine to load text or js plugin delegators @param cfg the config object as a {@link Scriptable} @param name the name of the plugin delegator selector @return the set of plugin delegators for the selector
[ "Common", "routine", "to", "load", "text", "or", "js", "plugin", "delegators" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1257-L1274
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.callConfigModifiers
protected void callConfigModifiers(Scriptable rawConfig) { if( aggregator.getPlatformServices() != null){ IServiceReference[] refs = null; try { refs = aggregator.getPlatformServices().getServiceReferences(IConfigModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //$NON-N...
java
protected void callConfigModifiers(Scriptable rawConfig) { if( aggregator.getPlatformServices() != null){ IServiceReference[] refs = null; try { refs = aggregator.getPlatformServices().getServiceReferences(IConfigModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //$NON-N...
[ "protected", "void", "callConfigModifiers", "(", "Scriptable", "rawConfig", ")", "{", "if", "(", "aggregator", ".", "getPlatformServices", "(", ")", "!=", "null", ")", "{", "IServiceReference", "[", "]", "refs", "=", "null", ";", "try", "{", "refs", "=", "...
Calls the registered config modifiers to give them an opportunity to modify the raw config before config properties are evaluated. @param rawConfig The config object as a {@link Scriptable}.
[ "Calls", "the", "registered", "config", "modifiers", "to", "give", "them", "an", "opportunity", "to", "modify", "the", "raw", "config", "before", "config", "properties", "are", "evaluated", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1366-L1395
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java
ConfigImpl.callConfigScopeModifiers
protected void callConfigScopeModifiers(Scriptable scope) { if( aggregator.getPlatformServices() != null){ IServiceReference[] refs = null; try { refs = aggregator.getPlatformServices().getServiceReferences(IConfigScopeModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //...
java
protected void callConfigScopeModifiers(Scriptable scope) { if( aggregator.getPlatformServices() != null){ IServiceReference[] refs = null; try { refs = aggregator.getPlatformServices().getServiceReferences(IConfigScopeModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //...
[ "protected", "void", "callConfigScopeModifiers", "(", "Scriptable", "scope", ")", "{", "if", "(", "aggregator", ".", "getPlatformServices", "(", ")", "!=", "null", ")", "{", "IServiceReference", "[", "]", "refs", "=", "null", ";", "try", "{", "refs", "=", ...
Calls the registered config scope modifiers to give them an opportunity to prepare the scope object prior to evaluating the config JavaScript @param scope The object representing the execution scope for the evaluation.
[ "Calls", "the", "registered", "config", "scope", "modifiers", "to", "give", "them", "an", "opportunity", "to", "prepare", "the", "scope", "object", "prior", "to", "evaluating", "the", "config", "JavaScript" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/config/ConfigImpl.java#L1404-L1433
train
smallnest/fastjson-jaxrs-json-provider
src/main/java/com/colobu/fastjson/FastJsonProvider.java
FastJsonProvider.isValidType
protected boolean isValidType(Class<?> type, Annotation[] classAnnotations) { if (type == null) return false; if (annotated) { return checkAnnotation(type); } else if (scanpackages != null) { String classPackage = type.getPackage().getName(); for (String pkg : scanpackages) { if (classPackag...
java
protected boolean isValidType(Class<?> type, Annotation[] classAnnotations) { if (type == null) return false; if (annotated) { return checkAnnotation(type); } else if (scanpackages != null) { String classPackage = type.getPackage().getName(); for (String pkg : scanpackages) { if (classPackag...
[ "protected", "boolean", "isValidType", "(", "Class", "<", "?", ">", "type", ",", "Annotation", "[", "]", "classAnnotations", ")", "{", "if", "(", "type", "==", "null", ")", "return", "false", ";", "if", "(", "annotated", ")", "{", "return", "checkAnnotat...
Check whether a class can be serialized or deserialized. It can check based on packages, annotations on entities or explicit classes. @param type class need to check @return true if valid
[ "Check", "whether", "a", "class", "can", "be", "serialized", "or", "deserialized", ".", "It", "can", "check", "based", "on", "packages", "annotations", "on", "entities", "or", "explicit", "classes", "." ]
bbdb2e3d101069bf62c026976ff9d00967671ec0
https://github.com/smallnest/fastjson-jaxrs-json-provider/blob/bbdb2e3d101069bf62c026976ff9d00967671ec0/src/main/java/com/colobu/fastjson/FastJsonProvider.java#L96-L126
train
smallnest/fastjson-jaxrs-json-provider
src/main/java/com/colobu/fastjson/FastJsonProvider.java
FastJsonProvider.writeTo
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { SerializeFilter filter = null; if(pretty) { if (fastJsonConfig.serializerFea...
java
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { SerializeFilter filter = null; if(pretty) { if (fastJsonConfig.serializerFea...
[ "public", "void", "writeTo", "(", "Object", "t", ",", "Class", "<", "?", ">", "type", ",", "Type", "genericType", ",", "Annotation", "[", "]", "annotations", ",", "MediaType", "mediaType", ",", "MultivaluedMap", "<", "String", ",", "Object", ">", "httpHead...
Method that JAX-RS container calls to serialize given value.
[ "Method", "that", "JAX", "-", "RS", "container", "calls", "to", "serialize", "given", "value", "." ]
bbdb2e3d101069bf62c026976ff9d00967671ec0
https://github.com/smallnest/fastjson-jaxrs-json-provider/blob/bbdb2e3d101069bf62c026976ff9d00967671ec0/src/main/java/com/colobu/fastjson/FastJsonProvider.java#L228-L247
train
smallnest/fastjson-jaxrs-json-provider
src/main/java/com/colobu/fastjson/FastJsonProvider.java
FastJsonProvider.readFrom
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { String input = null; try { input = IOUtils.inputStreamToString(entityStream); } catc...
java
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { String input = null; try { input = IOUtils.inputStreamToString(entityStream); } catc...
[ "public", "Object", "readFrom", "(", "Class", "<", "Object", ">", "type", ",", "Type", "genericType", ",", "Annotation", "[", "]", "annotations", ",", "MediaType", "mediaType", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "httpHeaders", ",", "In...
Method that JAX-RS container calls to deserialize given value.
[ "Method", "that", "JAX", "-", "RS", "container", "calls", "to", "deserialize", "given", "value", "." ]
bbdb2e3d101069bf62c026976ff9d00967671ec0
https://github.com/smallnest/fastjson-jaxrs-json-provider/blob/bbdb2e3d101069bf62c026976ff9d00967671ec0/src/main/java/com/colobu/fastjson/FastJsonProvider.java#L270-L285
train
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/ClusterRuleFactory.java
ClusterRuleFactory.performPruning
public static ArrayList<SameLengthMotifs> performPruning(double[] ts, GrammarRules grammarRules, double thresholdLength, double thresholdCom, double fractionTopDist) { RuleOrganizer ro = new RuleOrganizer(); ArrayList<SameLengthMotifs> allClassifiedMotifs = ro.classifyMotifs(thresholdLength, ...
java
public static ArrayList<SameLengthMotifs> performPruning(double[] ts, GrammarRules grammarRules, double thresholdLength, double thresholdCom, double fractionTopDist) { RuleOrganizer ro = new RuleOrganizer(); ArrayList<SameLengthMotifs> allClassifiedMotifs = ro.classifyMotifs(thresholdLength, ...
[ "public", "static", "ArrayList", "<", "SameLengthMotifs", ">", "performPruning", "(", "double", "[", "]", "ts", ",", "GrammarRules", "grammarRules", ",", "double", "thresholdLength", ",", "double", "thresholdCom", ",", "double", "fractionTopDist", ")", "{", "RuleO...
Performs clustering. @param ts the input time series. @param grammarRules the grammar. @param thresholdLength a parameter. @param thresholdCom another parameter. @param fractionTopDist yet another parameter. @return pruned ruleset.
[ "Performs", "clustering", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/ClusterRuleFactory.java#L21-L36
train
jMotif/GI
src/main/java/net/seninp/gi/clusterrule/ClusterRuleFactory.java
ClusterRuleFactory.getPackedRule
public static ArrayList<PackedRuleRecord> getPackedRule( ArrayList<SameLengthMotifs> newAllClassifiedMotifs) { ArrayList<PackedRuleRecord> arrPackedRuleRecords = new ArrayList<PackedRuleRecord>(); int i = 0; for (SameLengthMotifs subsequencesInClass : newAllClassifiedMotifs) { int classIn...
java
public static ArrayList<PackedRuleRecord> getPackedRule( ArrayList<SameLengthMotifs> newAllClassifiedMotifs) { ArrayList<PackedRuleRecord> arrPackedRuleRecords = new ArrayList<PackedRuleRecord>(); int i = 0; for (SameLengthMotifs subsequencesInClass : newAllClassifiedMotifs) { int classIn...
[ "public", "static", "ArrayList", "<", "PackedRuleRecord", ">", "getPackedRule", "(", "ArrayList", "<", "SameLengthMotifs", ">", "newAllClassifiedMotifs", ")", "{", "ArrayList", "<", "PackedRuleRecord", ">", "arrPackedRuleRecords", "=", "new", "ArrayList", "<", "Packed...
Gets packed rules set. @param newAllClassifiedMotifs a parameter. @return packed rule set.
[ "Gets", "packed", "rules", "set", "." ]
381212dd4f193246a6df82bd46f0d2bcd04a68d6
https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/clusterrule/ClusterRuleFactory.java#L44-L66
train
OpenNTF/JavascriptAggregator
jaggr-service/src/main/java/com/ibm/jaggr/service/util/BundleVersionsHashBase.java
BundleVersionsHashBase.getBundleHeaders
protected Dictionary<?, ?> getBundleHeaders(String bundleName) throws NotFoundException { final String sourceMethod = "getBundleHeaders"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(BundleVersionsHashBase.class.getName(), sourceMethod, new Object[]...
java
protected Dictionary<?, ?> getBundleHeaders(String bundleName) throws NotFoundException { final String sourceMethod = "getBundleHeaders"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(BundleVersionsHashBase.class.getName(), sourceMethod, new Object[]...
[ "protected", "Dictionary", "<", "?", ",", "?", ">", "getBundleHeaders", "(", "String", "bundleName", ")", "throws", "NotFoundException", "{", "final", "String", "sourceMethod", "=", "\"getBundleHeaders\"", ";", "//$NON-NLS-1$\r", "boolean", "isTraceLogging", "=", "l...
Returns the bundle headers for the specified bundle. @param bundleName the bundle name @return the bundle headers for the bundle. @throws NotFoundException if no matching bundle is found.
[ "Returns", "the", "bundle", "headers", "for", "the", "specified", "bundle", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/util/BundleVersionsHashBase.java#L86-L102
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultSatConstraintBuilder.java
DefaultSatConstraintBuilder.checkConformance
public boolean checkConformance(BtrPlaceTree t, List<BtrpOperand> ops) { //Arity error if (ops.size() != getParameters().length) { t.ignoreError("'" + pretty(ops) + "' cannot be casted to '" + getSignature() + "'"); return false; } //Type checking for (in...
java
public boolean checkConformance(BtrPlaceTree t, List<BtrpOperand> ops) { //Arity error if (ops.size() != getParameters().length) { t.ignoreError("'" + pretty(ops) + "' cannot be casted to '" + getSignature() + "'"); return false; } //Type checking for (in...
[ "public", "boolean", "checkConformance", "(", "BtrPlaceTree", "t", ",", "List", "<", "BtrpOperand", ">", "ops", ")", "{", "//Arity error", "if", "(", "ops", ".", "size", "(", ")", "!=", "getParameters", "(", ")", ".", "length", ")", "{", "t", ".", "ign...
Check if the provided parameters match the constraint signature @param t the constraint token @param ops the constraint arguments @return {@code true} iff the arguments match the constraint signature
[ "Check", "if", "the", "provided", "parameters", "match", "the", "constraint", "signature" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/DefaultSatConstraintBuilder.java#L98-L118
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/ScriptBuilder.java
ScriptBuilder.build
public Script build(File f) throws ScriptBuilderException { int k = f.getAbsolutePath().hashCode(); if (dates.containsKey(k) && dates.get(k) == f.lastModified() && cache.containsKey(f.getPath())) { LOGGER.debug("get '" + f.getName() + "' from the cache"); return cache.get(f.getPa...
java
public Script build(File f) throws ScriptBuilderException { int k = f.getAbsolutePath().hashCode(); if (dates.containsKey(k) && dates.get(k) == f.lastModified() && cache.containsKey(f.getPath())) { LOGGER.debug("get '" + f.getName() + "' from the cache"); return cache.get(f.getPa...
[ "public", "Script", "build", "(", "File", "f", ")", "throws", "ScriptBuilderException", "{", "int", "k", "=", "f", ".", "getAbsolutePath", "(", ")", ".", "hashCode", "(", ")", ";", "if", "(", "dates", ".", "containsKey", "(", "k", ")", "&&", "dates", ...
Build a script from a file. @param f the file to parse @return the resulting script @throws ScriptBuilderException if an error occurred
[ "Build", "a", "script", "from", "a", "file", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/ScriptBuilder.java#L150-L172
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/ScriptBuilder.java
ScriptBuilder.build
@SuppressWarnings("squid:S1166") //For the UnsupportedOperationException private Script build(CharStream cs) throws ScriptBuilderException { Script v = new Script(); ANTLRBtrplaceSL2Lexer lexer = new ANTLRBtrplaceSL2Lexer(cs); ErrorReporter errorReporter = errBuilder.build(v); le...
java
@SuppressWarnings("squid:S1166") //For the UnsupportedOperationException private Script build(CharStream cs) throws ScriptBuilderException { Script v = new Script(); ANTLRBtrplaceSL2Lexer lexer = new ANTLRBtrplaceSL2Lexer(cs); ErrorReporter errorReporter = errBuilder.build(v); le...
[ "@", "SuppressWarnings", "(", "\"squid:S1166\"", ")", "//For the UnsupportedOperationException", "private", "Script", "build", "(", "CharStream", "cs", ")", "throws", "ScriptBuilderException", "{", "Script", "v", "=", "new", "Script", "(", ")", ";", "ANTLRBtrplaceSL2L...
Internal method to check a script from a stream. @param cs the stream to analyze @return the built script @throws ScriptBuilderException in an error occurred while building the script
[ "Internal", "method", "to", "check", "a", "script", "from", "a", "stream", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/ScriptBuilder.java#L192-L232
train
InsightLab/graphast
core/src/main/java/br/ufc/insightlab/graphast/utils/RandomGraphGenerator.java
RandomGraphGenerator.generateRandomMMapGraph
public Graph generateRandomMMapGraph(String graphName, int size, float dens) { Graph graph = null; String dir = "graphs/MMap/" + graphName; SerializationUtils.deleteMMapGraph(dir); graph = new Graph(new MMapGraphStructure(dir)); Random rand = new Random(); for (int i = 0; i < size; i++) graph...
java
public Graph generateRandomMMapGraph(String graphName, int size, float dens) { Graph graph = null; String dir = "graphs/MMap/" + graphName; SerializationUtils.deleteMMapGraph(dir); graph = new Graph(new MMapGraphStructure(dir)); Random rand = new Random(); for (int i = 0; i < size; i++) graph...
[ "public", "Graph", "generateRandomMMapGraph", "(", "String", "graphName", ",", "int", "size", ",", "float", "dens", ")", "{", "Graph", "graph", "=", "null", ";", "String", "dir", "=", "\"graphs/MMap/\"", "+", "graphName", ";", "SerializationUtils", ".", "delet...
Create a new Graph which has the given graphName, size and dens. @param graphName the graph's name. @param size the graph's size. @param dens the graph's dens. @return the graph generated.
[ "Create", "a", "new", "Graph", "which", "has", "the", "given", "graphName", "size", "and", "dens", "." ]
b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24
https://github.com/InsightLab/graphast/blob/b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24/core/src/main/java/br/ufc/insightlab/graphast/utils/RandomGraphGenerator.java#L53-L81
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/VMPlacementUtils.java
VMPlacementUtils.makePlacementMap
public static Map<IntVar, VM> makePlacementMap(ReconfigurationProblem rp) { Map<IntVar, VM> m = new HashMap<>(rp.getFutureRunningVMs().size()); for (VM vm : rp.getFutureRunningVMs()) { IntVar v = rp.getVMAction(vm).getDSlice().getHoster(); m.put(v, vm); } return m...
java
public static Map<IntVar, VM> makePlacementMap(ReconfigurationProblem rp) { Map<IntVar, VM> m = new HashMap<>(rp.getFutureRunningVMs().size()); for (VM vm : rp.getFutureRunningVMs()) { IntVar v = rp.getVMAction(vm).getDSlice().getHoster(); m.put(v, vm); } return m...
[ "public", "static", "Map", "<", "IntVar", ",", "VM", ">", "makePlacementMap", "(", "ReconfigurationProblem", "rp", ")", "{", "Map", "<", "IntVar", ",", "VM", ">", "m", "=", "new", "HashMap", "<>", "(", "rp", ".", "getFutureRunningVMs", "(", ")", ".", "...
Map a map where keys are the placement variable of the future-running VMs and values are the VM identifier. @param rp the problem @return the resulting map.
[ "Map", "a", "map", "where", "keys", "are", "the", "placement", "variable", "of", "the", "future", "-", "running", "VMs", "and", "values", "are", "the", "VM", "identifier", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/VMPlacementUtils.java#L47-L54
train
m-m-m/util
contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/Segment.java
Segment.validate
public final void validate(StringBuilder source) { int length = source.length(); source.append('/'); source.append(getSourceIdentifier()); doValidate(source); // reset source for recursive invocation... source.setLength(length); }
java
public final void validate(StringBuilder source) { int length = source.length(); source.append('/'); source.append(getSourceIdentifier()); doValidate(source); // reset source for recursive invocation... source.setLength(length); }
[ "public", "final", "void", "validate", "(", "StringBuilder", "source", ")", "{", "int", "length", "=", "source", ".", "length", "(", ")", ";", "source", ".", "append", "(", "'", "'", ")", ";", "source", ".", "append", "(", "getSourceIdentifier", "(", "...
This method validates this segment recursively to ensure the correctness of the configured format. @param source describes the source of the validation.
[ "This", "method", "validates", "this", "segment", "recursively", "to", "ensure", "the", "correctness", "of", "the", "configured", "format", "." ]
f0e4e084448f8dfc83ca682a9e1618034a094ce6
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/Segment.java#L99-L107
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.setConsumption
public ShareableResource setConsumption(VM vm, int val) { if (val < 0) { throw new IllegalArgumentException(String.format("The '%s' consumption of VM '%s' must be >= 0", rcId, vm)); } vmsConsumption.put(vm, val); return this; }
java
public ShareableResource setConsumption(VM vm, int val) { if (val < 0) { throw new IllegalArgumentException(String.format("The '%s' consumption of VM '%s' must be >= 0", rcId, vm)); } vmsConsumption.put(vm, val); return this; }
[ "public", "ShareableResource", "setConsumption", "(", "VM", "vm", ",", "int", "val", ")", "{", "if", "(", "val", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format", "(", "\"The '%s' consumption of VM '%s' must be >= 0\"", ...
Set the resource consumption of a VM. @param vm the VM @param val the value to set @return the current resource
[ "Set", "the", "resource", "consumption", "of", "a", "VM", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L150-L156
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.setConsumption
public ShareableResource setConsumption(int val, VM... vms) { Stream.of(vms).forEach(v -> setConsumption(v, val)); return this; }
java
public ShareableResource setConsumption(int val, VM... vms) { Stream.of(vms).forEach(v -> setConsumption(v, val)); return this; }
[ "public", "ShareableResource", "setConsumption", "(", "int", "val", ",", "VM", "...", "vms", ")", "{", "Stream", ".", "of", "(", "vms", ")", ".", "forEach", "(", "v", "->", "setConsumption", "(", "v", ",", "val", ")", ")", ";", "return", "this", ";",...
Set the resource consumption of VMs. @param val the value to set @param vms the VMs @return the current resource
[ "Set", "the", "resource", "consumption", "of", "VMs", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L165-L168
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.setCapacity
public ShareableResource setCapacity(Node n, int val) { if (val < 0) { throw new IllegalArgumentException(String.format("The '%s' capacity of node '%s' must be >= 0", rcId, n)); } nodesCapacity.put(n, val); return this; }
java
public ShareableResource setCapacity(Node n, int val) { if (val < 0) { throw new IllegalArgumentException(String.format("The '%s' capacity of node '%s' must be >= 0", rcId, n)); } nodesCapacity.put(n, val); return this; }
[ "public", "ShareableResource", "setCapacity", "(", "Node", "n", ",", "int", "val", ")", "{", "if", "(", "val", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format", "(", "\"The '%s' capacity of node '%s' must be >= 0\"", "...
Set the resource consumption of a node. @param n the node @param val the value to set @return the current resource
[ "Set", "the", "resource", "consumption", "of", "a", "node", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L177-L183
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.setCapacity
public ShareableResource setCapacity(int val, Node... nodes) { Stream.of(nodes).forEach(n -> this.setCapacity(n, val)); return this; }
java
public ShareableResource setCapacity(int val, Node... nodes) { Stream.of(nodes).forEach(n -> this.setCapacity(n, val)); return this; }
[ "public", "ShareableResource", "setCapacity", "(", "int", "val", ",", "Node", "...", "nodes", ")", "{", "Stream", ".", "of", "(", "nodes", ")", ".", "forEach", "(", "n", "->", "this", ".", "setCapacity", "(", "n", ",", "val", ")", ")", ";", "return",...
Set the resource consumption of nodes. @param val the value to set @param nodes the nodes @return the current resource
[ "Set", "the", "resource", "consumption", "of", "nodes", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L192-L195
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.sumConsumptions
public int sumConsumptions(Collection<VM> ids, boolean undef) { int s = 0; for (VM u: ids) { if (consumptionDefined(u) || undef) { s += vmsConsumption.get(u); } } return s; }
java
public int sumConsumptions(Collection<VM> ids, boolean undef) { int s = 0; for (VM u: ids) { if (consumptionDefined(u) || undef) { s += vmsConsumption.get(u); } } return s; }
[ "public", "int", "sumConsumptions", "(", "Collection", "<", "VM", ">", "ids", ",", "boolean", "undef", ")", "{", "int", "s", "=", "0", ";", "for", "(", "VM", "u", ":", "ids", ")", "{", "if", "(", "consumptionDefined", "(", "u", ")", "||", "undef", ...
Get the cumulative VMs consumption. @param ids the VMs. @param undef {@code true} to include the undefined elements using the default value @return the value
[ "Get", "the", "cumulative", "VMs", "consumption", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L367-L375
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.sumCapacities
public int sumCapacities(Collection<Node> ids, boolean undef) { int s = 0; for (Node u: ids) { if (capacityDefined(u) || undef) { s += nodesCapacity.get(u); } } return s; }
java
public int sumCapacities(Collection<Node> ids, boolean undef) { int s = 0; for (Node u: ids) { if (capacityDefined(u) || undef) { s += nodesCapacity.get(u); } } return s; }
[ "public", "int", "sumCapacities", "(", "Collection", "<", "Node", ">", "ids", ",", "boolean", "undef", ")", "{", "int", "s", "=", "0", ";", "for", "(", "Node", "u", ":", "ids", ")", "{", "if", "(", "capacityDefined", "(", "u", ")", "||", "undef", ...
Get the cumulative nodes capacity. @param ids the nodes. @param undef {@code true} to include the undefined elements using the default value @return the value
[ "Get", "the", "cumulative", "nodes", "capacity", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L384-L392
train
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/ShareableResource.java
ShareableResource.get
public static ShareableResource get(Model mo, String id) { return (ShareableResource) mo.getView(VIEW_ID_BASE + id); }
java
public static ShareableResource get(Model mo, String id) { return (ShareableResource) mo.getView(VIEW_ID_BASE + id); }
[ "public", "static", "ShareableResource", "get", "(", "Model", "mo", ",", "String", "id", ")", "{", "return", "(", "ShareableResource", ")", "mo", ".", "getView", "(", "VIEW_ID_BASE", "+", "id", ")", ";", "}" ]
Get the view associated to a model if exists @param mo the model to look at @return the view if attached. {@code null} otherwise
[ "Get", "the", "view", "associated", "to", "a", "model", "if", "exists" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/ShareableResource.java#L400-L402
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.getlocalName
public String getlocalName() { if (fqn.contains(".")) { return this.fqn.substring(fqn.lastIndexOf('.') + 1, this.fqn.length()); } return fqn; }
java
public String getlocalName() { if (fqn.contains(".")) { return this.fqn.substring(fqn.lastIndexOf('.') + 1, this.fqn.length()); } return fqn; }
[ "public", "String", "getlocalName", "(", ")", "{", "if", "(", "fqn", ".", "contains", "(", "\".\"", ")", ")", "{", "return", "this", ".", "fqn", ".", "substring", "(", "fqn", ".", "lastIndexOf", "(", "'", "'", ")", "+", "1", ",", "this", ".", "fq...
Get the local name of the script. @return a non-empty String
[ "Get", "the", "local", "name", "of", "the", "script", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L108-L113
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.add
public boolean add(Collection<BtrpElement> elems) { boolean ret = false; for (BtrpElement el : elems) { ret |= add(el); } return ret; }
java
public boolean add(Collection<BtrpElement> elems) { boolean ret = false; for (BtrpElement el : elems) { ret |= add(el); } return ret; }
[ "public", "boolean", "add", "(", "Collection", "<", "BtrpElement", ">", "elems", ")", "{", "boolean", "ret", "=", "false", ";", "for", "(", "BtrpElement", "el", ":", "elems", ")", "{", "ret", "|=", "add", "(", "el", ")", ";", "}", "return", "ret", ...
Add a collection of nodes or elements. @param elems the elements to add @return {@code true} iff at least one element has been added
[ "Add", "a", "collection", "of", "nodes", "or", "elements", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L168-L174
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.add
public boolean add(BtrpElement el) { switch (el.type()) { case VM: if (!this.vms.add((VM) el.getElement())) { return false; } break; case NODE: if (!this.nodes.add((Node) el.getElement())) { ...
java
public boolean add(BtrpElement el) { switch (el.type()) { case VM: if (!this.vms.add((VM) el.getElement())) { return false; } break; case NODE: if (!this.nodes.add((Node) el.getElement())) { ...
[ "public", "boolean", "add", "(", "BtrpElement", "el", ")", "{", "switch", "(", "el", ".", "type", "(", ")", ")", "{", "case", "VM", ":", "if", "(", "!", "this", ".", "vms", ".", "add", "(", "(", "VM", ")", "el", ".", "getElement", "(", ")", "...
Add a VM or a node to the script. @param el the element to add @return {@code true} if the was was added
[ "Add", "a", "VM", "or", "a", "node", "to", "the", "script", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L182-L199
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.getImportables
public List<BtrpOperand> getImportables(String ns) { List<BtrpOperand> importable = new ArrayList<>(); for (String symbol : getExported()) { if (canImport(symbol, ns)) { importable.add(getImportable(symbol, ns)); } } return importable; }
java
public List<BtrpOperand> getImportables(String ns) { List<BtrpOperand> importable = new ArrayList<>(); for (String symbol : getExported()) { if (canImport(symbol, ns)) { importable.add(getImportable(symbol, ns)); } } return importable; }
[ "public", "List", "<", "BtrpOperand", ">", "getImportables", "(", "String", "ns", ")", "{", "List", "<", "BtrpOperand", ">", "importable", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "symbol", ":", "getExported", "(", ")", ")", ...
Get all the operand a given script can import @param ns the script namespace @return a list of importable operand, may be empty
[ "Get", "all", "the", "operand", "a", "given", "script", "can", "import" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L207-L215
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.getImportable
public BtrpOperand getImportable(String label, String namespace) { if (canImport(label, namespace)) { return exported.get(label); } return null; }
java
public BtrpOperand getImportable(String label, String namespace) { if (canImport(label, namespace)) { return exported.get(label); } return null; }
[ "public", "BtrpOperand", "getImportable", "(", "String", "label", ",", "String", "namespace", ")", "{", "if", "(", "canImport", "(", "label", ",", "namespace", ")", ")", "{", "return", "exported", ".", "get", "(", "label", ")", ";", "}", "return", "null"...
Get the exported operand from its label. @param label the operand label @param namespace the namespace of the script that ask for this operand. @return the operand if exists or {@code null}
[ "Get", "the", "exported", "operand", "from", "its", "label", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L224-L229
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.canImport
public boolean canImport(String label, String namespace) { if (!exported.containsKey(label)) { return false; } Set<String> scopes = exportScopes.get(label); for (String scope : scopes) { if (scope.equals(namespace)) { return true; } els...
java
public boolean canImport(String label, String namespace) { if (!exported.containsKey(label)) { return false; } Set<String> scopes = exportScopes.get(label); for (String scope : scopes) { if (scope.equals(namespace)) { return true; } els...
[ "public", "boolean", "canImport", "(", "String", "label", ",", "String", "namespace", ")", "{", "if", "(", "!", "exported", ".", "containsKey", "(", "label", ")", ")", "{", "return", "false", ";", "}", "Set", "<", "String", ">", "scopes", "=", "exportS...
Indicates whether a namespace can import an exported variable or not. To be imported, the label must point to an exported variable, with no import restrictions or with a given namespace compatible with the restrictions. @param label the label to import @param namespace the namespace of the script asking for the va...
[ "Indicates", "whether", "a", "namespace", "can", "import", "an", "exported", "variable", "or", "not", ".", "To", "be", "imported", "the", "label", "must", "point", "to", "an", "exported", "variable", "with", "no", "import", "restrictions", "or", "with", "a",...
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L252-L265
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.fullyQualifiedSymbolName
public String fullyQualifiedSymbolName(String name) { if (name.equals(SymbolsTable.ME)) { return "$".concat(id()); } else if (name.startsWith("$")) { return "$" + id() + '.' + name.substring(1); } return id() + '.' + name; }
java
public String fullyQualifiedSymbolName(String name) { if (name.equals(SymbolsTable.ME)) { return "$".concat(id()); } else if (name.startsWith("$")) { return "$" + id() + '.' + name.substring(1); } return id() + '.' + name; }
[ "public", "String", "fullyQualifiedSymbolName", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "SymbolsTable", ".", "ME", ")", ")", "{", "return", "\"$\"", ".", "concat", "(", "id", "(", ")", ")", ";", "}", "else", "if", "(",...
Get the fully qualified name of a symbol. @param name the symbol name @return the fully qualified symbol name.
[ "Get", "the", "fully", "qualified", "name", "of", "a", "symbol", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L287-L294
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.prettyDependencies
public String prettyDependencies() { StringBuilder b = new StringBuilder(); b.append(id()).append('\n'); for (Iterator<Script> ite = dependencies.iterator(); ite.hasNext(); ) { Script n = ite.next(); prettyDependencies(b, !ite.hasNext(), 0, n); } return b....
java
public String prettyDependencies() { StringBuilder b = new StringBuilder(); b.append(id()).append('\n'); for (Iterator<Script> ite = dependencies.iterator(); ite.hasNext(); ) { Script n = ite.next(); prettyDependencies(b, !ite.hasNext(), 0, n); } return b....
[ "public", "String", "prettyDependencies", "(", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "b", ".", "append", "(", "id", "(", ")", ")", ".", "append", "(", "'", "'", ")", ";", "for", "(", "Iterator", "<", "Script", ...
Textual representation for the dependencies. @return a String containing the dependency tree.
[ "Textual", "representation", "for", "the", "dependencies", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L334-L342
train
InsightLab/graphast
core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java
Graph.addNode
public void addNode(Node n) { try { structure.addNode(n); for (NodeListener listener : nodeListeners) listener.onInsert(n); } catch (DuplicatedNodeException e) { duplicatedNodesCounter++; } }
java
public void addNode(Node n) { try { structure.addNode(n); for (NodeListener listener : nodeListeners) listener.onInsert(n); } catch (DuplicatedNodeException e) { duplicatedNodesCounter++; } }
[ "public", "void", "addNode", "(", "Node", "n", ")", "{", "try", "{", "structure", ".", "addNode", "(", "n", ")", ";", "for", "(", "NodeListener", "listener", ":", "nodeListeners", ")", "listener", ".", "onInsert", "(", "n", ")", ";", "}", "catch", "(...
Adds a new node to the graph, given the Node object. If a node already exists with an id equal to the given node, a DuplicatedNodeException is thrown. @param n the new node to be added to the graph.
[ "Adds", "a", "new", "node", "to", "the", "graph", "given", "the", "Node", "object", ".", "If", "a", "node", "already", "exists", "with", "an", "id", "equal", "to", "the", "given", "node", "a", "DuplicatedNodeException", "is", "thrown", "." ]
b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24
https://github.com/InsightLab/graphast/blob/b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24/core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java#L109-L117
train
InsightLab/graphast
core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java
Graph.addEdge
public void addEdge(Edge e) { structure.addEdge(e); for (EdgeListener listener : edgeListeners) listener.onInsert(e); }
java
public void addEdge(Edge e) { structure.addEdge(e); for (EdgeListener listener : edgeListeners) listener.onInsert(e); }
[ "public", "void", "addEdge", "(", "Edge", "e", ")", "{", "structure", ".", "addEdge", "(", "e", ")", ";", "for", "(", "EdgeListener", "listener", ":", "edgeListeners", ")", "listener", ".", "onInsert", "(", ")", ";", "}" ]
Adds a new edge to this graph, given a new Edge object. It uses the GraphStructure attribute's addEdge method to add the new edge to this graph. If one of the node ids of the given Edge object does not exists in this graph, a NodeNotFoundException is thrown. Otherwise, the edge is successfully added to this graph. @pa...
[ "Adds", "a", "new", "edge", "to", "this", "graph", "given", "a", "new", "Edge", "object", ".", "It", "uses", "the", "GraphStructure", "attribute", "s", "addEdge", "method", "to", "add", "the", "new", "edge", "to", "this", "graph", ".", "If", "one", "of...
b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24
https://github.com/InsightLab/graphast/blob/b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24/core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java#L149-L153
train
InsightLab/graphast
core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java
Graph.getNeighborhoodIterator
public Iterator<Long> getNeighborhoodIterator(final long id) { return new Iterator<Long>() { Iterator<Edge> iter = structure.getExistingOutEdgesIterator(id); @Override public boolean hasNext() { return iter.hasNext(); } @Override public Long next() { Edge e = iter.next(); return...
java
public Iterator<Long> getNeighborhoodIterator(final long id) { return new Iterator<Long>() { Iterator<Edge> iter = structure.getExistingOutEdgesIterator(id); @Override public boolean hasNext() { return iter.hasNext(); } @Override public Long next() { Edge e = iter.next(); return...
[ "public", "Iterator", "<", "Long", ">", "getNeighborhoodIterator", "(", "final", "long", "id", ")", "{", "return", "new", "Iterator", "<", "Long", ">", "(", ")", "{", "Iterator", "<", "Edge", ">", "iter", "=", "structure", ".", "getExistingOutEdgesIterator",...
Gets the neighborhood from a node represented by a given id. If the graph has any Node object with the given id, this function returns an Iterator object representing all the neighboring Node objects to the given node. The neighboring nodes are given according to the outgoing edges of the Node object of the graph that ...
[ "Gets", "the", "neighborhood", "from", "a", "node", "represented", "by", "a", "given", "id", ".", "If", "the", "graph", "has", "any", "Node", "object", "with", "the", "given", "id", "this", "function", "returns", "an", "Iterator", "object", "representing", ...
b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24
https://github.com/InsightLab/graphast/blob/b81d10c1ea8378e1fb9fcb545dd75d5e6308fd24/core/src/main/java/br/ufc/insightlab/graphast/model/Graph.java#L322-L340
train
btrplace/scheduler
json/src/main/java/org/btrplace/json/model/AttributesConverter.java
AttributesConverter.toJSON
public static JSONObject toJSON(Attributes attributes) { JSONObject res = new JSONObject(); JSONObject vms = new JSONObject(); JSONObject nodes = new JSONObject(); for (Element e : attributes.getDefined()) { JSONObject el = new JSONObject(); for (String k : attrib...
java
public static JSONObject toJSON(Attributes attributes) { JSONObject res = new JSONObject(); JSONObject vms = new JSONObject(); JSONObject nodes = new JSONObject(); for (Element e : attributes.getDefined()) { JSONObject el = new JSONObject(); for (String k : attrib...
[ "public", "static", "JSONObject", "toJSON", "(", "Attributes", "attributes", ")", "{", "JSONObject", "res", "=", "new", "JSONObject", "(", ")", ";", "JSONObject", "vms", "=", "new", "JSONObject", "(", ")", ";", "JSONObject", "nodes", "=", "new", "JSONObject"...
Serialise attributes. @param attributes the attributes @return the resulting encoded attributes
[ "Serialise", "attributes", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/AttributesConverter.java#L104-L122
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java
KnapsackDecorator.fullKnapsack
private void fullKnapsack() throws ContradictionException { for (int bin = 0; bin < prop.nbBins; bin++) { for (int d = 0; d < prop.nbDims; d++) { knapsack(bin, d); } } }
java
private void fullKnapsack() throws ContradictionException { for (int bin = 0; bin < prop.nbBins; bin++) { for (int d = 0; d < prop.nbDims; d++) { knapsack(bin, d); } } }
[ "private", "void", "fullKnapsack", "(", ")", "throws", "ContradictionException", "{", "for", "(", "int", "bin", "=", "0", ";", "bin", "<", "prop", ".", "nbBins", ";", "bin", "++", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "prop", ...
Propagate a knapsack on every node and every dimension. @throws ContradictionException
[ "Propagate", "a", "knapsack", "on", "every", "node", "and", "every", "dimension", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java#L71-L77
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java
KnapsackDecorator.postInitialize
public void postInitialize() throws ContradictionException { final int[] biggest = new int[prop.nbDims]; for (int i = 0; i < prop.bins.length; i++) { for (int d = 0; d < prop.nbDims; d++) { biggest[d] = Math.max(biggest[d], prop.iSizes[d][i]); } if (!p...
java
public void postInitialize() throws ContradictionException { final int[] biggest = new int[prop.nbDims]; for (int i = 0; i < prop.bins.length; i++) { for (int d = 0; d < prop.nbDims; d++) { biggest[d] = Math.max(biggest[d], prop.iSizes[d][i]); } if (!p...
[ "public", "void", "postInitialize", "(", ")", "throws", "ContradictionException", "{", "final", "int", "[", "]", "biggest", "=", "new", "int", "[", "prop", ".", "nbDims", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "prop", ".", "bins",...
initialize the lists of candidates.
[ "initialize", "the", "lists", "of", "candidates", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java#L82-L108
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java
KnapsackDecorator.postRemoveItem
@SuppressWarnings("squid:S3346") public void postRemoveItem(int item, int bin) { assert candidate.get(bin).get(item); candidate.get(bin).clear(item); }
java
@SuppressWarnings("squid:S3346") public void postRemoveItem(int item, int bin) { assert candidate.get(bin).get(item); candidate.get(bin).clear(item); }
[ "@", "SuppressWarnings", "(", "\"squid:S3346\"", ")", "public", "void", "postRemoveItem", "(", "int", "item", ",", "int", "bin", ")", "{", "assert", "candidate", ".", "get", "(", "bin", ")", ".", "get", "(", "item", ")", ";", "candidate", ".", "get", "...
update the candidate list of a bin when an item is removed @param item the removed item @param bin the bin
[ "update", "the", "candidate", "list", "of", "a", "bin", "when", "an", "item", "is", "removed" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java#L148-L152
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java
KnapsackDecorator.knapsack
private void knapsack(int bin, int d) throws ContradictionException { final int maxLoad = prop.loads[d][bin].getUB(); final int free = maxLoad - prop.assignedLoad[d][bin].get(); if (free >= dynBiggest[d][bin].get()) { // fail fast. The remaining space > the biggest item. ...
java
private void knapsack(int bin, int d) throws ContradictionException { final int maxLoad = prop.loads[d][bin].getUB(); final int free = maxLoad - prop.assignedLoad[d][bin].get(); if (free >= dynBiggest[d][bin].get()) { // fail fast. The remaining space > the biggest item. ...
[ "private", "void", "knapsack", "(", "int", "bin", ",", "int", "d", ")", "throws", "ContradictionException", "{", "final", "int", "maxLoad", "=", "prop", ".", "loads", "[", "d", "]", "[", "bin", "]", ".", "getUB", "(", ")", ";", "final", "int", "free"...
Propagate a knapsack on a given dimension and bin. If the usage of an item exceeds the bin free capacity, it is filtered out. @param bin the bin @param d the dimension @throws ContradictionException
[ "Propagate", "a", "knapsack", "on", "a", "given", "dimension", "and", "bin", ".", "If", "the", "usage", "of", "an", "item", "exceeds", "the", "bin", "free", "capacity", "it", "is", "filtered", "out", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/KnapsackDecorator.java#L195-L226
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/runner/Metrics.java
Metrics.add
public void add(Metrics m) { timeCount += m.timeCount; readingTimeCount += m.readingTimeCount; nodes += m.nodes; backtracks += m.backtracks; fails += m.fails; restarts += m.restarts; }
java
public void add(Metrics m) { timeCount += m.timeCount; readingTimeCount += m.readingTimeCount; nodes += m.nodes; backtracks += m.backtracks; fails += m.fails; restarts += m.restarts; }
[ "public", "void", "add", "(", "Metrics", "m", ")", "{", "timeCount", "+=", "m", ".", "timeCount", ";", "readingTimeCount", "+=", "m", ".", "readingTimeCount", ";", "nodes", "+=", "m", ".", "nodes", ";", "backtracks", "+=", "m", ".", "backtracks", ";", ...
Add metrics. All the metrics are aggregated to the current instance @param m the metrics to add
[ "Add", "metrics", ".", "All", "the", "metrics", "are", "aggregated", "to", "the", "current", "instance" ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/runner/Metrics.java#L97-L104
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java
LayerImpl.generateCacheKey
protected String generateCacheKey(HttpServletRequest request, Map<String, ICacheKeyGenerator> cacheKeyGenerators) throws IOException { String cacheKey = null; if (cacheKeyGenerators != null) { // First, decompose any composite cache key generators into their // constituent cache key generators so that we ...
java
protected String generateCacheKey(HttpServletRequest request, Map<String, ICacheKeyGenerator> cacheKeyGenerators) throws IOException { String cacheKey = null; if (cacheKeyGenerators != null) { // First, decompose any composite cache key generators into their // constituent cache key generators so that we ...
[ "protected", "String", "generateCacheKey", "(", "HttpServletRequest", "request", ",", "Map", "<", "String", ",", "ICacheKeyGenerator", ">", "cacheKeyGenerators", ")", "throws", "IOException", "{", "String", "cacheKey", "=", "null", ";", "if", "(", "cacheKeyGenerator...
Generates a cache key for the layer. @param request the request object @param cacheKeyGenerators map of cache key generator class names to instance objects @return the cache key @throws IOException
[ "Generates", "a", "cache", "key", "for", "the", "layer", "." ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java#L654-L674
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java
LayerImpl.readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // Call the default implementation to de-serialize our object in.defaultReadObject(); // init transients _validateLastModified = new AtomicBoolean(true); _cacheKeyGenMutex = new Semaphore(1); _isReportCacheInfo ...
java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { // Call the default implementation to de-serialize our object in.defaultReadObject(); // init transients _validateLastModified = new AtomicBoolean(true); _cacheKeyGenMutex = new Semaphore(1); _isReportCacheInfo ...
[ "private", "void", "readObject", "(", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "// Call the default implementation to de-serialize our object\r", "in", ".", "defaultReadObject", "(", ")", ";", "// init transients\r", "_valid...
De-serialize this object from an ObjectInputStream @param in The ObjectInputStream @throws IOException @throws ClassNotFoundException
[ "De", "-", "serialize", "this", "object", "from", "an", "ObjectInputStream" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java#L763-L770
train
OpenNTF/JavascriptAggregator
jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java
LayerImpl.getLastModified
protected long getLastModified(IAggregator aggregator, ModuleList modules) { long result = 0L; for (ModuleList.ModuleListEntry entry : modules) { IResource resource = entry.getModule().getResource(aggregator); long lastMod = resource.lastModified(); result = Math.max(result, lastMod); } return r...
java
protected long getLastModified(IAggregator aggregator, ModuleList modules) { long result = 0L; for (ModuleList.ModuleListEntry entry : modules) { IResource resource = entry.getModule().getResource(aggregator); long lastMod = resource.lastModified(); result = Math.max(result, lastMod); } return r...
[ "protected", "long", "getLastModified", "(", "IAggregator", "aggregator", ",", "ModuleList", "modules", ")", "{", "long", "result", "=", "0L", ";", "for", "(", "ModuleList", ".", "ModuleListEntry", "entry", ":", "modules", ")", "{", "IResource", "resource", "=...
Returns the newest last modified time of the files in the list @param aggregator @param modules The list of ModuleFile objects @return The newest last modified time of all the files in the list
[ "Returns", "the", "newest", "last", "modified", "time", "of", "the", "files", "in", "the", "list" ]
9f47a96d778251638b1df9a368462176216d5b29
https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerImpl.java#L1031-L1039
train
nikolavp/approval
approval-core/src/main/java/com/github/approval/Approvals.java
Approvals.verify
public static void verify(short value, Path path) { Approval.of(short.class) .withReporter(reporter) .build() .verify(value, path); }
java
public static void verify(short value, Path path) { Approval.of(short.class) .withReporter(reporter) .build() .verify(value, path); }
[ "public", "static", "void", "verify", "(", "short", "value", ",", "Path", "path", ")", "{", "Approval", ".", "of", "(", "short", ".", "class", ")", ".", "withReporter", "(", "reporter", ")", ".", "build", "(", ")", ".", "verify", "(", "value", ",", ...
An overload for verifying a single short value. This will call the approval object with proper reporter and use the path for verification. @param value the short that needs to be verified @param path the path in which to store the approval file
[ "An", "overload", "for", "verifying", "a", "single", "short", "value", ".", "This", "will", "call", "the", "approval", "object", "with", "proper", "reporter", "and", "use", "the", "path", "for", "verification", "." ]
5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8
https://github.com/nikolavp/approval/blob/5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8/approval-core/src/main/java/com/github/approval/Approvals.java#L182-L187
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/element/DefaultBtrpOperand.java
DefaultBtrpOperand.prettyType
public static String prettyType(BtrpOperand o) { if (o == IgnorableOperand.getInstance()) { return "??"; } return prettyType(o.degree(), o.type()); }
java
public static String prettyType(BtrpOperand o) { if (o == IgnorableOperand.getInstance()) { return "??"; } return prettyType(o.degree(), o.type()); }
[ "public", "static", "String", "prettyType", "(", "BtrpOperand", "o", ")", "{", "if", "(", "o", "==", "IgnorableOperand", ".", "getInstance", "(", ")", ")", "{", "return", "\"??\"", ";", "}", "return", "prettyType", "(", "o", ".", "degree", "(", ")", ",...
Generate a pretty type for an operand. @param o the operand @return a string that describes the operand type.
[ "Generate", "a", "pretty", "type", "for", "an", "operand", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/element/DefaultBtrpOperand.java#L113-L118
train
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/element/DefaultBtrpOperand.java
DefaultBtrpOperand.prettyType
public static String prettyType(int degree, Type t) { StringBuilder b = new StringBuilder(); for (int i = degree; i > 0; i--) { b.append("set<"); } b.append(t.toString().toLowerCase()); for (int i = 0; i < degree; i++) { b.append(">"); } re...
java
public static String prettyType(int degree, Type t) { StringBuilder b = new StringBuilder(); for (int i = degree; i > 0; i--) { b.append("set<"); } b.append(t.toString().toLowerCase()); for (int i = 0; i < degree; i++) { b.append(">"); } re...
[ "public", "static", "String", "prettyType", "(", "int", "degree", ",", "Type", "t", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "degree", ";", "i", ">", "0", ";", "i", "--", ")", "{", "...
Pretty textual representation of a given element type. @param degree 0 for a literal, 1 for a set, 2 for a set of sets, ... @param t the literal @return a String
[ "Pretty", "textual", "representation", "of", "a", "given", "element", "type", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/element/DefaultBtrpOperand.java#L127-L137
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java
DefaultCumulatives.addDim
@Override public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); }
java
@Override public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) { capacities.add(c); cUsages.add(cUse); dUsages.add(dUse); }
[ "@", "Override", "public", "void", "addDim", "(", "List", "<", "IntVar", ">", "c", ",", "int", "[", "]", "cUse", ",", "IntVar", "[", "]", "dUse", ")", "{", "capacities", ".", "add", "(", "c", ")", ";", "cUsages", ".", "add", "(", "cUse", ")", "...
Add a dimension. @param c the resource capacity of each of the nodes @param cUse the resource usage of each of the cSlices @param dUse the resource usage of each of the dSlices
[ "Add", "a", "dimension", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java#L62-L67
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java
DefaultCumulatives.beforeSolve
@Override @SuppressWarnings("squid:S3346") public boolean beforeSolve(ReconfigurationProblem rp) { super.beforeSolve(rp); if (rp.getSourceModel().getMapping().getNbNodes() == 0 || capacities.isEmpty()) { return true; } int nbDims = capacities.size(); int nbRe...
java
@Override @SuppressWarnings("squid:S3346") public boolean beforeSolve(ReconfigurationProblem rp) { super.beforeSolve(rp); if (rp.getSourceModel().getMapping().getNbNodes() == 0 || capacities.isEmpty()) { return true; } int nbDims = capacities.size(); int nbRe...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"squid:S3346\"", ")", "public", "boolean", "beforeSolve", "(", "ReconfigurationProblem", "rp", ")", "{", "super", ".", "beforeSolve", "(", "rp", ")", ";", "if", "(", "rp", ".", "getSourceModel", "(", ")", ".",...
Build the constraint. @return the resulting constraint
[ "Build", "the", "constraint", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java#L74-L131
train
btrplace/scheduler
choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java
DefaultCumulatives.symmetryBreakingForStayingVMs
private boolean symmetryBreakingForStayingVMs(ReconfigurationProblem rp) { for (VM vm : rp.getFutureRunningVMs()) { VMTransition a = rp.getVMAction(vm); Slice dSlice = a.getDSlice(); Slice cSlice = a.getCSlice(); if (dSlice != null && cSlice != null) { ...
java
private boolean symmetryBreakingForStayingVMs(ReconfigurationProblem rp) { for (VM vm : rp.getFutureRunningVMs()) { VMTransition a = rp.getVMAction(vm); Slice dSlice = a.getDSlice(); Slice cSlice = a.getCSlice(); if (dSlice != null && cSlice != null) { ...
[ "private", "boolean", "symmetryBreakingForStayingVMs", "(", "ReconfigurationProblem", "rp", ")", "{", "for", "(", "VM", "vm", ":", "rp", ".", "getFutureRunningVMs", "(", ")", ")", "{", "VMTransition", "a", "=", "rp", ".", "getVMAction", "(", "vm", ")", ";", ...
Symmetry breaking for VMs that stay running, on the same node. @return {@code true} iff the symmetry breaking does not lead to a problem without solutions
[ "Symmetry", "breaking", "for", "VMs", "that", "stay", "running", "on", "the", "same", "node", "." ]
611063aad0b47a016e57ebf36fa4dfdf24de09e8
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/DefaultCumulatives.java#L165-L187
train
berkesa/datatree
src/main/java/io/datatree/Tree.java
Tree.getPath
protected StringBuilder getPath(StringBuilder path, int startIndex, boolean addPoint) { boolean simple = true; if (key != null) { if (addPoint && path.length() > 0) { path.insert(0, '.'); } if (key instanceof Integer) { path.insert(0, ']'); if (startIndex == 0) { path.insert(0, ke...
java
protected StringBuilder getPath(StringBuilder path, int startIndex, boolean addPoint) { boolean simple = true; if (key != null) { if (addPoint && path.length() > 0) { path.insert(0, '.'); } if (key instanceof Integer) { path.insert(0, ']'); if (startIndex == 0) { path.insert(0, ke...
[ "protected", "StringBuilder", "getPath", "(", "StringBuilder", "path", ",", "int", "startIndex", ",", "boolean", "addPoint", ")", "{", "boolean", "simple", "=", "true", ";", "if", "(", "key", "!=", "null", ")", "{", "if", "(", "addPoint", "&&", "path", "...
Recursive path-builder method. @param path path builder @param startIndex first index within array (startIndex = 0 -&gt; zero based array-indexing) @param addPoint a point is insertable into the path @return path of this node
[ "Recursive", "path", "-", "builder", "method", "." ]
79aea9b45c7b46ab28af0a09310bc01c421c6b3a
https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L402-L425
train
berkesa/datatree
src/main/java/io/datatree/Tree.java
Tree.setType
public Tree setType(Class<?> type) { if (value == null || value.getClass() == type) { return this; } value = DataConverterRegistry.convert(type, value); if (parent != null && key != null) { if (key instanceof String) { parent.putObjectInternal((String) key, value, false); } else { pare...
java
public Tree setType(Class<?> type) { if (value == null || value.getClass() == type) { return this; } value = DataConverterRegistry.convert(type, value); if (parent != null && key != null) { if (key instanceof String) { parent.putObjectInternal((String) key, value, false); } else { pare...
[ "public", "Tree", "setType", "(", "Class", "<", "?", ">", "type", ")", "{", "if", "(", "value", "==", "null", "||", "value", ".", "getClass", "(", ")", "==", "type", ")", "{", "return", "this", ";", "}", "value", "=", "DataConverterRegistry", ".", ...
Sets this node's type and converts the value into the specified type. @param type new type @return this node
[ "Sets", "this", "node", "s", "type", "and", "converts", "the", "value", "into", "the", "specified", "type", "." ]
79aea9b45c7b46ab28af0a09310bc01c421c6b3a
https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L446-L460
train
berkesa/datatree
src/main/java/io/datatree/Tree.java
Tree.insert
public Tree insert(int index, byte[] value, boolean asBase64String) { if (asBase64String) { return insertObjectInternal(index, BASE64.encode(value)); } return insertObjectInternal(index, value); }
java
public Tree insert(int index, byte[] value, boolean asBase64String) { if (asBase64String) { return insertObjectInternal(index, BASE64.encode(value)); } return insertObjectInternal(index, value); }
[ "public", "Tree", "insert", "(", "int", "index", ",", "byte", "[", "]", "value", ",", "boolean", "asBase64String", ")", "{", "if", "(", "asBase64String", ")", "{", "return", "insertObjectInternal", "(", "index", ",", "BASE64", ".", "encode", "(", "value", ...
Inserts the specified byte array at the specified position in this List. @param index index at which the specified element is to be inserted @param value array value to be inserted @param asBase64String store byte array as BASE64 String @return this node @throws IndexOutOfBoundsException if the index is out of range
[ "Inserts", "the", "specified", "byte", "array", "at", "the", "specified", "position", "in", "this", "List", "." ]
79aea9b45c7b46ab28af0a09310bc01c421c6b3a
https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L1485-L1490
train