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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.either | public static IConjunct either( IConjunct conjunct1, IConjunct conjunct2)
{
IConjunct conjunct;
if( conjunct1.getDisjunctCount() == 0)
{
conjunct = conjunct2;
}
else if( conjunct2.getDisjunctCount() == 0)
{
conjunct = conjunct1;
}
else
{
Conjunction... | java | public static IConjunct either( IConjunct conjunct1, IConjunct conjunct2)
{
IConjunct conjunct;
if( conjunct1.getDisjunctCount() == 0)
{
conjunct = conjunct2;
}
else if( conjunct2.getDisjunctCount() == 0)
{
conjunct = conjunct1;
}
else
{
Conjunction... | [
"public",
"static",
"IConjunct",
"either",
"(",
"IConjunct",
"conjunct1",
",",
"IConjunct",
"conjunct2",
")",
"{",
"IConjunct",
"conjunct",
";",
"if",
"(",
"conjunct1",
".",
"getDisjunctCount",
"(",
")",
"==",
"0",
")",
"{",
"conjunct",
"=",
"conjunct2",
";"... | Returns the logical OR of the given CNF conditions. | [
"Returns",
"the",
"logical",
"OR",
"of",
"the",
"given",
"CNF",
"conditions",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L176-L213 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.refactor | public static IConjunct refactor( IConjunct conjunct)
{
// Is there a single assertion term?
Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts();
IAssertion assertion = null;
while( disjuncts.hasNext() && (assertion = toAssertion( disjuncts.next())) == null);
return
assertion == null
... | java | public static IConjunct refactor( IConjunct conjunct)
{
// Is there a single assertion term?
Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts();
IAssertion assertion = null;
while( disjuncts.hasNext() && (assertion = toAssertion( disjuncts.next())) == null);
return
assertion == null
... | [
"public",
"static",
"IConjunct",
"refactor",
"(",
"IConjunct",
"conjunct",
")",
"{",
"// Is there a single assertion term?",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
"=",
"conjunct",
".",
"getDisjuncts",
"(",
")",
";",
"IAssertion",
"assertion",
"=",
"null",
... | Return refactored conjunction formed by removing superfluous terms. | [
"Return",
"refactored",
"conjunction",
"formed",
"by",
"removing",
"superfluous",
"terms",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L218-L234 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.remainder | public static IConjunct remainder( IConjunct conjunct, IAssertion assertion)
{
Conjunction rest = new Conjunction();
for( Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts();
disjuncts.hasNext();)
{
IDisjunct disjunct = disjuncts.next();
if( !disjunct.contains( assertion))
... | java | public static IConjunct remainder( IConjunct conjunct, IAssertion assertion)
{
Conjunction rest = new Conjunction();
for( Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts();
disjuncts.hasNext();)
{
IDisjunct disjunct = disjuncts.next();
if( !disjunct.contains( assertion))
... | [
"public",
"static",
"IConjunct",
"remainder",
"(",
"IConjunct",
"conjunct",
",",
"IAssertion",
"assertion",
")",
"{",
"Conjunction",
"rest",
"=",
"new",
"Conjunction",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
"=",
"conjunct",
... | Returns the remainder after removing all terms that contain the given assertion. | [
"Returns",
"the",
"remainder",
"after",
"removing",
"all",
"terms",
"that",
"contain",
"the",
"given",
"assertion",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L239-L253 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.toAssertion | public static IAssertion toAssertion( IDisjunct disjunct)
{
return
disjunct.getAssertionCount() == 1
? disjunct.getAssertions().next()
: null;
} | java | public static IAssertion toAssertion( IDisjunct disjunct)
{
return
disjunct.getAssertionCount() == 1
? disjunct.getAssertions().next()
: null;
} | [
"public",
"static",
"IAssertion",
"toAssertion",
"(",
"IDisjunct",
"disjunct",
")",
"{",
"return",
"disjunct",
".",
"getAssertionCount",
"(",
")",
"==",
"1",
"?",
"disjunct",
".",
"getAssertions",
"(",
")",
".",
"next",
"(",
")",
":",
"null",
";",
"}"
] | If the given disjunction consists of a single assertion, returns the
equivalent assertion. Otherwise, return null. | [
"If",
"the",
"given",
"disjunction",
"consists",
"of",
"a",
"single",
"assertion",
"returns",
"the",
"equivalent",
"assertion",
".",
"Otherwise",
"return",
"null",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L259-L265 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.simplify | public static IConjunct simplify( IConjunct conjunct)
{
return
conjunct.getDisjunctCount() == 1
? conjunct.getDisjuncts().next()
: conjunct;
} | java | public static IConjunct simplify( IConjunct conjunct)
{
return
conjunct.getDisjunctCount() == 1
? conjunct.getDisjuncts().next()
: conjunct;
} | [
"public",
"static",
"IConjunct",
"simplify",
"(",
"IConjunct",
"conjunct",
")",
"{",
"return",
"conjunct",
".",
"getDisjunctCount",
"(",
")",
"==",
"1",
"?",
"conjunct",
".",
"getDisjuncts",
"(",
")",
".",
"next",
"(",
")",
":",
"conjunct",
";",
"}"
] | Returns the simple form of the given conjunction. | [
"Returns",
"the",
"simple",
"form",
"of",
"the",
"given",
"conjunction",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L270-L276 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.simplify | public static IDisjunct simplify( IDisjunct disjunct)
{
IAssertion assertion = toAssertion( disjunct);
return
assertion == null
? disjunct
: assertion;
} | java | public static IDisjunct simplify( IDisjunct disjunct)
{
IAssertion assertion = toAssertion( disjunct);
return
assertion == null
? disjunct
: assertion;
} | [
"public",
"static",
"IDisjunct",
"simplify",
"(",
"IDisjunct",
"disjunct",
")",
"{",
"IAssertion",
"assertion",
"=",
"toAssertion",
"(",
"disjunct",
")",
";",
"return",
"assertion",
"==",
"null",
"?",
"disjunct",
":",
"assertion",
";",
"}"
] | Returns the simple form of the given disjunction. | [
"Returns",
"the",
"simple",
"form",
"of",
"the",
"given",
"disjunction",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L281-L288 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.isTautology | public static boolean isTautology( IDisjunct disjunct)
{
boolean tautology = false;
if( disjunct != null)
{
IAssertion[] assertions = IteratorUtils.toArray( disjunct.getAssertions(), IAssertion.class);
int max = assertions.length;
int maxCompared = max - 1;
for( int comp... | java | public static boolean isTautology( IDisjunct disjunct)
{
boolean tautology = false;
if( disjunct != null)
{
IAssertion[] assertions = IteratorUtils.toArray( disjunct.getAssertions(), IAssertion.class);
int max = assertions.length;
int maxCompared = max - 1;
for( int comp... | [
"public",
"static",
"boolean",
"isTautology",
"(",
"IDisjunct",
"disjunct",
")",
"{",
"boolean",
"tautology",
"=",
"false",
";",
"if",
"(",
"disjunct",
"!=",
"null",
")",
"{",
"IAssertion",
"[",
"]",
"assertions",
"=",
"IteratorUtils",
".",
"toArray",
"(",
... | Returns true if the given disjunction is universally true. | [
"Returns",
"true",
"if",
"the",
"given",
"disjunction",
"is",
"universally",
"true",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L293-L315 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.satisfiesSome | public static boolean satisfiesSome( IConjunct condition, PropertySet properties)
{
boolean satisfies;
Iterator<IDisjunct> disjuncts;
for( disjuncts = condition.getDisjuncts(),
satisfies = !disjuncts.hasNext();
!satisfies
&& disjuncts.hasNext();
satisfi... | java | public static boolean satisfiesSome( IConjunct condition, PropertySet properties)
{
boolean satisfies;
Iterator<IDisjunct> disjuncts;
for( disjuncts = condition.getDisjuncts(),
satisfies = !disjuncts.hasNext();
!satisfies
&& disjuncts.hasNext();
satisfi... | [
"public",
"static",
"boolean",
"satisfiesSome",
"(",
"IConjunct",
"condition",
",",
"PropertySet",
"properties",
")",
"{",
"boolean",
"satisfies",
";",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
";",
"for",
"(",
"disjuncts",
"=",
"condition",
".",
"getDisju... | Returns true if the given properties partially satisfy the given condition. | [
"Returns",
"true",
"if",
"the",
"given",
"properties",
"partially",
"satisfy",
"the",
"given",
"condition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L328-L341 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.getUnsatisfied | public static IConjunct getUnsatisfied( IConjunct condition, PropertySet properties)
{
Conjunction unsatisfied = new Conjunction();
for( Iterator<IDisjunct> disjuncts = condition.getDisjuncts();
disjuncts.hasNext();)
{
IDisjunct disjunct = disjuncts.next();
if( !disjunct.satisfied... | java | public static IConjunct getUnsatisfied( IConjunct condition, PropertySet properties)
{
Conjunction unsatisfied = new Conjunction();
for( Iterator<IDisjunct> disjuncts = condition.getDisjuncts();
disjuncts.hasNext();)
{
IDisjunct disjunct = disjuncts.next();
if( !disjunct.satisfied... | [
"public",
"static",
"IConjunct",
"getUnsatisfied",
"(",
"IConjunct",
"condition",
",",
"PropertySet",
"properties",
")",
"{",
"Conjunction",
"unsatisfied",
"=",
"new",
"Conjunction",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
"=",... | Returns the part of the given condition unsatisfied by the given properties. | [
"Returns",
"the",
"part",
"of",
"the",
"given",
"condition",
"unsatisfied",
"by",
"the",
"given",
"properties",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L346-L360 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.addVarDef | public FunctionInputDef addVarDef( IVarDef varDef)
{
assert varDef != null;
assert varDef.getName() != null;
if( findVarDef( varDef.getName()) >= 0)
{
throw new IllegalStateException( "Variable=" + varDef.getName() + " already defined for function=" + getName());
}
vars_.add(... | java | public FunctionInputDef addVarDef( IVarDef varDef)
{
assert varDef != null;
assert varDef.getName() != null;
if( findVarDef( varDef.getName()) >= 0)
{
throw new IllegalStateException( "Variable=" + varDef.getName() + " already defined for function=" + getName());
}
vars_.add(... | [
"public",
"FunctionInputDef",
"addVarDef",
"(",
"IVarDef",
"varDef",
")",
"{",
"assert",
"varDef",
"!=",
"null",
";",
"assert",
"varDef",
".",
"getName",
"(",
")",
"!=",
"null",
";",
"if",
"(",
"findVarDef",
"(",
"varDef",
".",
"getName",
"(",
")",
")",
... | Adds a new variable definition. | [
"Adds",
"a",
"new",
"variable",
"definition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L64-L76 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.removeVarDef | public FunctionInputDef removeVarDef( String name)
{
int i = findVarDef( name);
if( i >= 0)
{
vars_.remove(i);
}
return this;
} | java | public FunctionInputDef removeVarDef( String name)
{
int i = findVarDef( name);
if( i >= 0)
{
vars_.remove(i);
}
return this;
} | [
"public",
"FunctionInputDef",
"removeVarDef",
"(",
"String",
"name",
")",
"{",
"int",
"i",
"=",
"findVarDef",
"(",
"name",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"vars_",
".",
"remove",
"(",
"i",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Removes a variable definition. | [
"Removes",
"a",
"variable",
"definition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L81-L90 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.getVarDef | public IVarDef getVarDef( String name)
{
int i = findVarDef( name);
return i >= 0? vars_.get(i) : null;
} | java | public IVarDef getVarDef( String name)
{
int i = findVarDef( name);
return i >= 0? vars_.get(i) : null;
} | [
"public",
"IVarDef",
"getVarDef",
"(",
"String",
"name",
")",
"{",
"int",
"i",
"=",
"findVarDef",
"(",
"name",
")",
";",
"return",
"i",
">=",
"0",
"?",
"vars_",
".",
"get",
"(",
"i",
")",
":",
"null",
";",
"}"
] | Returns the variable definition with the given name. | [
"Returns",
"the",
"variable",
"definition",
"with",
"the",
"given",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L95-L99 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.findVarDef | protected int findVarDef( String name)
{
int varCount = name==null? 0 : vars_.size();
int i;
for( i = 0; i < varCount && !name.equals( vars_.get(i).getName()); i++);
return i < varCount? i : -1;
} | java | protected int findVarDef( String name)
{
int varCount = name==null? 0 : vars_.size();
int i;
for( i = 0; i < varCount && !name.equals( vars_.get(i).getName()); i++);
return i < varCount? i : -1;
} | [
"protected",
"int",
"findVarDef",
"(",
"String",
"name",
")",
"{",
"int",
"varCount",
"=",
"name",
"==",
"null",
"?",
"0",
":",
"vars_",
".",
"size",
"(",
")",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"varCount",
"&&",
"!... | Returns the index of the variable definition with the given name. | [
"Returns",
"the",
"index",
"of",
"the",
"variable",
"definition",
"with",
"the",
"given",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L128-L134 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.findVarPath | public IVarDef findVarPath( String pathName)
{
String[] path = DefUtils.toPath( pathName);
IVarDef var;
return
path == null?
null :
(var = getVarDef( StringUtils.trimToNull( path[0]))) == null?
null :
var.find( Arrays.copyOfRange( path, 1, path.length));
} | java | public IVarDef findVarPath( String pathName)
{
String[] path = DefUtils.toPath( pathName);
IVarDef var;
return
path == null?
null :
(var = getVarDef( StringUtils.trimToNull( path[0]))) == null?
null :
var.find( Arrays.copyOfRange( path, 1, path.length));
} | [
"public",
"IVarDef",
"findVarPath",
"(",
"String",
"pathName",
")",
"{",
"String",
"[",
"]",
"path",
"=",
"DefUtils",
".",
"toPath",
"(",
"pathName",
")",
";",
"IVarDef",
"var",
";",
"return",
"path",
"==",
"null",
"?",
"null",
":",
"(",
"var",
"=",
... | Returns the variable definition with the given path name. | [
"Returns",
"the",
"variable",
"definition",
"with",
"the",
"given",
"path",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L139-L152 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java | FunctionInputDef.findVarDefPath | public VarDef findVarDefPath( String pathName)
{
IVarDef var = findVarPath( pathName);
return
var != null && var.getClass().equals( VarDef.class)
? (VarDef) var
: null;
} | java | public VarDef findVarDefPath( String pathName)
{
IVarDef var = findVarPath( pathName);
return
var != null && var.getClass().equals( VarDef.class)
? (VarDef) var
: null;
} | [
"public",
"VarDef",
"findVarDefPath",
"(",
"String",
"pathName",
")",
"{",
"IVarDef",
"var",
"=",
"findVarPath",
"(",
"pathName",
")",
";",
"return",
"var",
"!=",
"null",
"&&",
"var",
".",
"getClass",
"(",
")",
".",
"equals",
"(",
"VarDef",
".",
"class",... | Returns the individual variable definition with the given path name. | [
"Returns",
"the",
"individual",
"variable",
"definition",
"with",
"the",
"given",
"path",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/FunctionInputDef.java#L157-L164 | train |
Cornutum/tcases | tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java | TcasesTask.addConfiguredParam | public void addConfiguredParam( Parameter param)
{
options_.getTransformParams().put( param.getName(), param.getValue());
} | java | public void addConfiguredParam( Parameter param)
{
options_.getTransformParams().put( param.getName(), param.getValue());
} | [
"public",
"void",
"addConfiguredParam",
"(",
"Parameter",
"param",
")",
"{",
"options_",
".",
"getTransformParams",
"(",
")",
".",
"put",
"(",
"param",
".",
"getName",
"(",
")",
",",
"param",
".",
"getValue",
"(",
")",
")",
";",
"}"
] | Adds a transform parameter. | [
"Adds",
"a",
"transform",
"parameter",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java#L208-L211 | train |
Cornutum/tcases | tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java | TcasesTask.setTransformDef | public void setTransformDef( File transformDef)
{
options_.setTransformDef( transformDef);
if( transformDef != null)
{
options_.setTransformType( Options.TransformType.CUSTOM);
}
} | java | public void setTransformDef( File transformDef)
{
options_.setTransformDef( transformDef);
if( transformDef != null)
{
options_.setTransformType( Options.TransformType.CUSTOM);
}
} | [
"public",
"void",
"setTransformDef",
"(",
"File",
"transformDef",
")",
"{",
"options_",
".",
"setTransformDef",
"(",
"transformDef",
")",
";",
"if",
"(",
"transformDef",
"!=",
"null",
")",
"{",
"options_",
".",
"setTransformType",
"(",
"Options",
".",
"Transfo... | Changes the transform file. | [
"Changes",
"the",
"transform",
"file",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-ant/src/main/java/org/cornutum/tcases/ant/TcasesTask.java#L248-L255 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarBinding.java | VarBinding.create | public static VarBinding create( IVarDef varDef, VarValueDef valueDef)
{
VarBinding binding =
valueDef.isNA()
? new VarNaBinding( varDef.getPathName(), varDef.getType())
: new VarBinding( varDef.getPathName(), varDef.getType(), valueDef.getName());
binding.setValueValid( valueDef.isValid... | java | public static VarBinding create( IVarDef varDef, VarValueDef valueDef)
{
VarBinding binding =
valueDef.isNA()
? new VarNaBinding( varDef.getPathName(), varDef.getType())
: new VarBinding( varDef.getPathName(), varDef.getType(), valueDef.getName());
binding.setValueValid( valueDef.isValid... | [
"public",
"static",
"VarBinding",
"create",
"(",
"IVarDef",
"varDef",
",",
"VarValueDef",
"valueDef",
")",
"{",
"VarBinding",
"binding",
"=",
"valueDef",
".",
"isNA",
"(",
")",
"?",
"new",
"VarNaBinding",
"(",
"varDef",
".",
"getPathName",
"(",
")",
",",
"... | Creates a new VarBinding object. | [
"Creates",
"a",
"new",
"VarBinding",
"object",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarBinding.java#L54-L65 | train |
Cornutum/tcases | tcases-cli/src/main/java/org/cornutum/tcases/TcasesCommand.java | TcasesCommand.getProjectName | public static String getProjectName( File inputDefFile)
{
String projectName = null;
if( inputDefFile != null)
{
String inputBase = FilenameUtils.getBaseName( inputDefFile.getName());
projectName =
inputBase.toLowerCase().endsWith( "-input")
? inputBase.substring( 0, input... | java | public static String getProjectName( File inputDefFile)
{
String projectName = null;
if( inputDefFile != null)
{
String inputBase = FilenameUtils.getBaseName( inputDefFile.getName());
projectName =
inputBase.toLowerCase().endsWith( "-input")
? inputBase.substring( 0, input... | [
"public",
"static",
"String",
"getProjectName",
"(",
"File",
"inputDefFile",
")",
"{",
"String",
"projectName",
"=",
"null",
";",
"if",
"(",
"inputDefFile",
"!=",
"null",
")",
"{",
"String",
"inputBase",
"=",
"FilenameUtils",
".",
"getBaseName",
"(",
"inputDef... | Returns the name of the project for the given input definition file. | [
"Returns",
"the",
"name",
"of",
"the",
"project",
"for",
"the",
"given",
"input",
"definition",
"file",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-cli/src/main/java/org/cornutum/tcases/TcasesCommand.java#L1352-L1366 | train |
Cornutum/tcases | tcases-cli/src/main/java/org/cornutum/tcases/TcasesCommand.java | TcasesCommand.getVersion | public static String getVersion()
{
Properties tcasesProperties = new Properties();
String tcasesPropertyFileName = "/tcases.properties";
InputStream tcasesPropertyFile = null;
try
{
tcasesPropertyFile = Tcases.class.getResourceAsStream( tcasesPropertyFileName);
tcasesProperties.lo... | java | public static String getVersion()
{
Properties tcasesProperties = new Properties();
String tcasesPropertyFileName = "/tcases.properties";
InputStream tcasesPropertyFile = null;
try
{
tcasesPropertyFile = Tcases.class.getResourceAsStream( tcasesPropertyFileName);
tcasesProperties.lo... | [
"public",
"static",
"String",
"getVersion",
"(",
")",
"{",
"Properties",
"tcasesProperties",
"=",
"new",
"Properties",
"(",
")",
";",
"String",
"tcasesPropertyFileName",
"=",
"\"/tcases.properties\"",
";",
"InputStream",
"tcasesPropertyFile",
"=",
"null",
";",
"try"... | Returns a description of the current version. | [
"Returns",
"a",
"description",
"of",
"the",
"current",
"version",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-cli/src/main/java/org/cornutum/tcases/TcasesCommand.java#L1372-L1396 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.getPropertySources | public static Map<String,Collection<VarBindingDef>> getPropertySources( FunctionInputDef function)
{
SetValuedMap<String,VarBindingDef> sources = MultiMapUtils.newSetValuedHashMap();
toStream( new VarDefIterator( function))
.flatMap( var -> toStream( var.getValues()).map( value -> new VarBindingDef( ... | java | public static Map<String,Collection<VarBindingDef>> getPropertySources( FunctionInputDef function)
{
SetValuedMap<String,VarBindingDef> sources = MultiMapUtils.newSetValuedHashMap();
toStream( new VarDefIterator( function))
.flatMap( var -> toStream( var.getValues()).map( value -> new VarBindingDef( ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Collection",
"<",
"VarBindingDef",
">",
">",
"getPropertySources",
"(",
"FunctionInputDef",
"function",
")",
"{",
"SetValuedMap",
"<",
"String",
",",
"VarBindingDef",
">",
"sources",
"=",
"MultiMapUtils",
".",
"new... | Maps every property in the given function input definition to the variable value definitions that contribute it. | [
"Maps",
"every",
"property",
"in",
"the",
"given",
"function",
"input",
"definition",
"to",
"the",
"variable",
"value",
"definitions",
"that",
"contribute",
"it",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L39-L48 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.getPropertyReferences | public static Map<String,Collection<IConditional>> getPropertyReferences( FunctionInputDef function)
{
SetValuedMap<String,IConditional> refs = MultiMapUtils.newSetValuedHashMap();
conditionals( function)
.forEach( conditional -> propertiesReferenced( conditional.getCondition()).forEach( p -> refs.pu... | java | public static Map<String,Collection<IConditional>> getPropertyReferences( FunctionInputDef function)
{
SetValuedMap<String,IConditional> refs = MultiMapUtils.newSetValuedHashMap();
conditionals( function)
.forEach( conditional -> propertiesReferenced( conditional.getCondition()).forEach( p -> refs.pu... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Collection",
"<",
"IConditional",
">",
">",
"getPropertyReferences",
"(",
"FunctionInputDef",
"function",
")",
"{",
"SetValuedMap",
"<",
"String",
",",
"IConditional",
">",
"refs",
"=",
"MultiMapUtils",
".",
"newSe... | Maps every property in the given FunctionInputDef to the conditional elements that reference it. | [
"Maps",
"every",
"property",
"in",
"the",
"given",
"FunctionInputDef",
"to",
"the",
"conditional",
"elements",
"that",
"reference",
"it",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L53-L61 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.getPropertiesUnused | public static Map<String,Collection<VarBindingDef>> getPropertiesUnused( FunctionInputDef function)
{
Map<String,Collection<VarBindingDef>> sources = getPropertySources( function);
Collection<String> unused = CollectionUtils.subtract( sources.keySet(), getPropertyReferences( function).keySet());
return... | java | public static Map<String,Collection<VarBindingDef>> getPropertiesUnused( FunctionInputDef function)
{
Map<String,Collection<VarBindingDef>> sources = getPropertySources( function);
Collection<String> unused = CollectionUtils.subtract( sources.keySet(), getPropertyReferences( function).keySet());
return... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Collection",
"<",
"VarBindingDef",
">",
">",
"getPropertiesUnused",
"(",
"FunctionInputDef",
"function",
")",
"{",
"Map",
"<",
"String",
",",
"Collection",
"<",
"VarBindingDef",
">",
">",
"sources",
"=",
"getProp... | For every property in the given function input definition that is defined but never referenced,
maps the property to the variable value definitions that contribute it. | [
"For",
"every",
"property",
"in",
"the",
"given",
"function",
"input",
"definition",
"that",
"is",
"defined",
"but",
"never",
"referenced",
"maps",
"the",
"property",
"to",
"the",
"variable",
"value",
"definitions",
"that",
"contribute",
"it",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L67-L76 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.getPropertiesUndefined | public static Map<String,Collection<IConditional>> getPropertiesUndefined( FunctionInputDef function)
{
Map<String,Collection<IConditional>> refs = getPropertyReferences( function);
Collection<String> undefined = CollectionUtils.subtract( refs.keySet(), getPropertySources( function).keySet());
return
... | java | public static Map<String,Collection<IConditional>> getPropertiesUndefined( FunctionInputDef function)
{
Map<String,Collection<IConditional>> refs = getPropertyReferences( function);
Collection<String> undefined = CollectionUtils.subtract( refs.keySet(), getPropertySources( function).keySet());
return
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Collection",
"<",
"IConditional",
">",
">",
"getPropertiesUndefined",
"(",
"FunctionInputDef",
"function",
")",
"{",
"Map",
"<",
"String",
",",
"Collection",
"<",
"IConditional",
">",
">",
"refs",
"=",
"getProper... | For every property in the given function input definition that is referenced but never defined,
maps the property to the conditional elements that reference it. | [
"For",
"every",
"property",
"in",
"the",
"given",
"function",
"input",
"definition",
"that",
"is",
"referenced",
"but",
"never",
"defined",
"maps",
"the",
"property",
"to",
"the",
"conditional",
"elements",
"that",
"reference",
"it",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L82-L91 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.getReferenceName | public static String getReferenceName( IConditional conditional)
{
return
conditional instanceof IVarDef?
String.format
( "variable=%s",
((IVarDef) conditional).getPathName()) :
conditional instanceof VarBindingDef?
String.format
( "variable=%s, value=%s",
((... | java | public static String getReferenceName( IConditional conditional)
{
return
conditional instanceof IVarDef?
String.format
( "variable=%s",
((IVarDef) conditional).getPathName()) :
conditional instanceof VarBindingDef?
String.format
( "variable=%s, value=%s",
((... | [
"public",
"static",
"String",
"getReferenceName",
"(",
"IConditional",
"conditional",
")",
"{",
"return",
"conditional",
"instanceof",
"IVarDef",
"?",
"String",
".",
"format",
"(",
"\"variable=%s\"",
",",
"(",
"(",
"IVarDef",
")",
"conditional",
")",
".",
"getPa... | Returns the full reference name for the given IConditional. | [
"Returns",
"the",
"full",
"reference",
"name",
"for",
"the",
"given",
"IConditional",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L96-L111 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.conditionals | private static Stream<IConditional> conditionals( FunctionInputDef function)
{
return toStream( function.getVarDefs()).flatMap( var -> conditionals( var));
} | java | private static Stream<IConditional> conditionals( FunctionInputDef function)
{
return toStream( function.getVarDefs()).flatMap( var -> conditionals( var));
} | [
"private",
"static",
"Stream",
"<",
"IConditional",
">",
"conditionals",
"(",
"FunctionInputDef",
"function",
")",
"{",
"return",
"toStream",
"(",
"function",
".",
"getVarDefs",
"(",
")",
")",
".",
"flatMap",
"(",
"var",
"->",
"conditionals",
"(",
"var",
")"... | Returns the IConditional instances defined by the given function input definition. | [
"Returns",
"the",
"IConditional",
"instances",
"defined",
"by",
"the",
"given",
"function",
"input",
"definition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L116-L119 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java | SystemInputs.conditionals | private static Stream<IConditional> conditionals( IVarDef var)
{
return
Stream.concat
( Stream.of( var),
Stream.concat
( Optional.ofNullable( var.getMembers()).map( members -> toStream( members).flatMap( member -> conditionals( member))).orElse( Stream.empty()),
Optional.of... | java | private static Stream<IConditional> conditionals( IVarDef var)
{
return
Stream.concat
( Stream.of( var),
Stream.concat
( Optional.ofNullable( var.getMembers()).map( members -> toStream( members).flatMap( member -> conditionals( member))).orElse( Stream.empty()),
Optional.of... | [
"private",
"static",
"Stream",
"<",
"IConditional",
">",
"conditionals",
"(",
"IVarDef",
"var",
")",
"{",
"return",
"Stream",
".",
"concat",
"(",
"Stream",
".",
"of",
"(",
"var",
")",
",",
"Stream",
".",
"concat",
"(",
"Optional",
".",
"ofNullable",
"(",... | Returns the IConditional instances defined by the given variable definition. | [
"Returns",
"the",
"IConditional",
"instances",
"defined",
"by",
"the",
"given",
"variable",
"definition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/SystemInputs.java#L124-L132 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java | MapBuilder.of | public static <K,V> MapBuilder<K,V> of( K key, V value)
{
return new MapBuilder<K,V>().put( key, value);
} | java | public static <K,V> MapBuilder<K,V> of( K key, V value)
{
return new MapBuilder<K,V>().put( key, value);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"MapBuilder",
"<",
"K",
",",
"V",
">",
"of",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"new",
"MapBuilder",
"<",
"K",
",",
"V",
">",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
... | Returns a new MapBuilder with the given entry. | [
"Returns",
"a",
"new",
"MapBuilder",
"with",
"the",
"given",
"entry",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java#L46-L49 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java | MapBuilder.put | public MapBuilder<K,V> put( K key, V value)
{
map_.put( key, value);
return this;
} | java | public MapBuilder<K,V> put( K key, V value)
{
map_.put( key, value);
return this;
} | [
"public",
"MapBuilder",
"<",
"K",
",",
"V",
">",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"map_",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds an entry to the map for this builder. | [
"Adds",
"an",
"entry",
"to",
"the",
"map",
"for",
"this",
"builder",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java#L54-L58 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java | MapBuilder.putIf | public MapBuilder<K,V> putIf( K key, Optional<V> value)
{
value.ifPresent( v -> map_.put( key, v));
return this;
} | java | public MapBuilder<K,V> putIf( K key, Optional<V> value)
{
value.ifPresent( v -> map_.put( key, v));
return this;
} | [
"public",
"MapBuilder",
"<",
"K",
",",
"V",
">",
"putIf",
"(",
"K",
"key",
",",
"Optional",
"<",
"V",
">",
"value",
")",
"{",
"value",
".",
"ifPresent",
"(",
"v",
"->",
"map_",
".",
"put",
"(",
"key",
",",
"v",
")",
")",
";",
"return",
"this",
... | Adds an entry to the map for this builder if the given value is present. | [
"Adds",
"an",
"entry",
"to",
"the",
"map",
"for",
"this",
"builder",
"if",
"the",
"given",
"value",
"is",
"present",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/MapBuilder.java#L63-L67 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/RandSeq.java | RandSeq.reorder | public <T> List<T> reorder( List<T> sequence)
{
int elementCount = sequence.size();
if( elementCount > 1)
{
List<T> elements = new ArrayList<T>( sequence);
sequence.clear();
for( ; elementCount > 0; elementCount--)
{
sequence.add( elements.remove( generator_.nextInt(... | java | public <T> List<T> reorder( List<T> sequence)
{
int elementCount = sequence.size();
if( elementCount > 1)
{
List<T> elements = new ArrayList<T>( sequence);
sequence.clear();
for( ; elementCount > 0; elementCount--)
{
sequence.add( elements.remove( generator_.nextInt(... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"reorder",
"(",
"List",
"<",
"T",
">",
"sequence",
")",
"{",
"int",
"elementCount",
"=",
"sequence",
".",
"size",
"(",
")",
";",
"if",
"(",
"elementCount",
">",
"1",
")",
"{",
"List",
"<",
"T",
">... | Returns the given list with its elements rearranged in a random order. | [
"Returns",
"the",
"given",
"list",
"with",
"its",
"elements",
"rearranged",
"in",
"a",
"random",
"order",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/RandSeq.java#L52-L67 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/RandSeq.java | RandSeq.reorder | public <T> Iterator<T> reorder( Iterator<T> sequence)
{
return reorder( IteratorUtils.toList( sequence)).iterator();
} | java | public <T> Iterator<T> reorder( Iterator<T> sequence)
{
return reorder( IteratorUtils.toList( sequence)).iterator();
} | [
"public",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"reorder",
"(",
"Iterator",
"<",
"T",
">",
"sequence",
")",
"{",
"return",
"reorder",
"(",
"IteratorUtils",
".",
"toList",
"(",
"sequence",
")",
")",
".",
"iterator",
"(",
")",
";",
"}"
] | Returns an iterator that visits the elements of the given sequence in a random order. | [
"Returns",
"an",
"iterator",
"that",
"visits",
"the",
"elements",
"of",
"the",
"given",
"sequence",
"in",
"a",
"random",
"order",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/RandSeq.java#L72-L75 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.setTupleSize | public void setTupleSize( int tupleSize)
{
Integer onceSize =
onceTuples_.isEmpty()
? null
: getOnceTuples().next().size();
if( !(onceSize == null || onceSize == tupleSize))
{
throw new IllegalArgumentException( "Tuple size=" + tupleSize + " is not compatible with existing onc... | java | public void setTupleSize( int tupleSize)
{
Integer onceSize =
onceTuples_.isEmpty()
? null
: getOnceTuples().next().size();
if( !(onceSize == null || onceSize == tupleSize))
{
throw new IllegalArgumentException( "Tuple size=" + tupleSize + " is not compatible with existing onc... | [
"public",
"void",
"setTupleSize",
"(",
"int",
"tupleSize",
")",
"{",
"Integer",
"onceSize",
"=",
"onceTuples_",
".",
"isEmpty",
"(",
")",
"?",
"null",
":",
"getOnceTuples",
"(",
")",
".",
"next",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"!",
... | Changes the tuple size for input variable combinations. A non-positive tupleSize specifies
all permutations. | [
"Changes",
"the",
"tuple",
"size",
"for",
"input",
"variable",
"combinations",
".",
"A",
"non",
"-",
"positive",
"tupleSize",
"specifies",
"all",
"permutations",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L51-L64 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getIncluded | public String[] getIncluded()
{
return
IteratorUtils.toArray(
IteratorUtils.transformedIterator(
includedVars_.iterator(),
VarNamePattern::toString),
String.class);
} | java | public String[] getIncluded()
{
return
IteratorUtils.toArray(
IteratorUtils.transformedIterator(
includedVars_.iterator(),
VarNamePattern::toString),
String.class);
} | [
"public",
"String",
"[",
"]",
"getIncluded",
"(",
")",
"{",
"return",
"IteratorUtils",
".",
"toArray",
"(",
"IteratorUtils",
".",
"transformedIterator",
"(",
"includedVars_",
".",
"iterator",
"(",
")",
",",
"VarNamePattern",
"::",
"toString",
")",
",",
"String... | Returns the set of input variables to be included in this combination. | [
"Returns",
"the",
"set",
"of",
"input",
"variables",
"to",
"be",
"included",
"in",
"this",
"combination",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L94-L102 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getExcluded | public String[] getExcluded()
{
return
IteratorUtils.toArray(
IteratorUtils.transformedIterator(
excludedVars_.iterator(),
VarNamePattern::toString),
String.class);
} | java | public String[] getExcluded()
{
return
IteratorUtils.toArray(
IteratorUtils.transformedIterator(
excludedVars_.iterator(),
VarNamePattern::toString),
String.class);
} | [
"public",
"String",
"[",
"]",
"getExcluded",
"(",
")",
"{",
"return",
"IteratorUtils",
".",
"toArray",
"(",
"IteratorUtils",
".",
"transformedIterator",
"(",
"excludedVars_",
".",
"iterator",
"(",
")",
",",
"VarNamePattern",
"::",
"toString",
")",
",",
"String... | Returns the set of input variables to be excluded from this combination. | [
"Returns",
"the",
"set",
"of",
"input",
"variables",
"to",
"be",
"excluded",
"from",
"this",
"combination",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L150-L158 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.addOnceTuple | public TupleCombiner addOnceTuple( TupleRef tupleRef)
{
if( tupleRef != null)
{
if( tupleRef.size() != getTupleSize())
{
throw new IllegalArgumentException( "Once-only tuple=" + tupleRef + " has size=" + tupleRef.size() + ", expected size=" + getTupleSize());
}
onceTupl... | java | public TupleCombiner addOnceTuple( TupleRef tupleRef)
{
if( tupleRef != null)
{
if( tupleRef.size() != getTupleSize())
{
throw new IllegalArgumentException( "Once-only tuple=" + tupleRef + " has size=" + tupleRef.size() + ", expected size=" + getTupleSize());
}
onceTupl... | [
"public",
"TupleCombiner",
"addOnceTuple",
"(",
"TupleRef",
"tupleRef",
")",
"{",
"if",
"(",
"tupleRef",
"!=",
"null",
")",
"{",
"if",
"(",
"tupleRef",
".",
"size",
"(",
")",
"!=",
"getTupleSize",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Adds a once-only tuple to this combination. | [
"Adds",
"a",
"once",
"-",
"only",
"tuple",
"to",
"this",
"combination",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L206-L218 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getTuples | public Collection<Tuple> getTuples( FunctionInputDef inputDef)
{
List<VarDef> combinedVars = getCombinedVars( inputDef);
return getCombinedTuples( combinedVars, getTuples( combinedVars, getTupleSize()));
} | java | public Collection<Tuple> getTuples( FunctionInputDef inputDef)
{
List<VarDef> combinedVars = getCombinedVars( inputDef);
return getCombinedTuples( combinedVars, getTuples( combinedVars, getTupleSize()));
} | [
"public",
"Collection",
"<",
"Tuple",
">",
"getTuples",
"(",
"FunctionInputDef",
"inputDef",
")",
"{",
"List",
"<",
"VarDef",
">",
"combinedVars",
"=",
"getCombinedVars",
"(",
"inputDef",
")",
";",
"return",
"getCombinedTuples",
"(",
"combinedVars",
",",
"getTup... | Returns all valid N-tuples of values for the included input variables. | [
"Returns",
"all",
"valid",
"N",
"-",
"tuples",
"of",
"values",
"for",
"the",
"included",
"input",
"variables",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L241-L245 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getTuples | public static Collection<Tuple> getTuples( List<VarDef> varDefs, int tupleSize)
{
if( tupleSize < 1)
{
tupleSize = varDefs.size();
}
int varEnd = varDefs.size() - tupleSize + 1;
if( varEnd <= 0)
{
throw new IllegalArgumentException( "Can't create " + tupleSize + "-tuples fo... | java | public static Collection<Tuple> getTuples( List<VarDef> varDefs, int tupleSize)
{
if( tupleSize < 1)
{
tupleSize = varDefs.size();
}
int varEnd = varDefs.size() - tupleSize + 1;
if( varEnd <= 0)
{
throw new IllegalArgumentException( "Can't create " + tupleSize + "-tuples fo... | [
"public",
"static",
"Collection",
"<",
"Tuple",
">",
"getTuples",
"(",
"List",
"<",
"VarDef",
">",
"varDefs",
",",
"int",
"tupleSize",
")",
"{",
"if",
"(",
"tupleSize",
"<",
"1",
")",
"{",
"tupleSize",
"=",
"varDefs",
".",
"size",
"(",
")",
";",
"}",... | Returns all valid N-tuples of values for the given input variables. A non-positive tupleSize specifies
all permutations. | [
"Returns",
"all",
"valid",
"N",
"-",
"tuples",
"of",
"values",
"for",
"the",
"given",
"input",
"variables",
".",
"A",
"non",
"-",
"positive",
"tupleSize",
"specifies",
"all",
"permutations",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L251-L263 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getTuples | private static Collection<Tuple> getTuples( List<VarDef> varDefs, int varStart, int varEnd, int tupleSize)
{
Collection<Tuple> tuples = new ArrayList<Tuple>();
// For each variable up to the last included...
for( int i = varStart; i < varEnd; i++)
{
// Combine each valid value...
VarD... | java | private static Collection<Tuple> getTuples( List<VarDef> varDefs, int varStart, int varEnd, int tupleSize)
{
Collection<Tuple> tuples = new ArrayList<Tuple>();
// For each variable up to the last included...
for( int i = varStart; i < varEnd; i++)
{
// Combine each valid value...
VarD... | [
"private",
"static",
"Collection",
"<",
"Tuple",
">",
"getTuples",
"(",
"List",
"<",
"VarDef",
">",
"varDefs",
",",
"int",
"varStart",
",",
"int",
"varEnd",
",",
"int",
"tupleSize",
")",
"{",
"Collection",
"<",
"Tuple",
">",
"tuples",
"=",
"new",
"ArrayL... | Returns all valid tuples of values for the given input variables. | [
"Returns",
"all",
"valid",
"tuples",
"of",
"values",
"for",
"the",
"given",
"input",
"variables",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L268-L319 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getCombinedTuples | private Collection<Tuple> getCombinedTuples( List<VarDef> combinedVars, Collection<Tuple> tuples)
{
// Apply any once-only constraints.
Set<Tuple> onceTuples = getOnceTupleDefs( combinedVars);
if( !onceTuples.isEmpty())
{
for( Tuple tuple : tuples)
{
tuple.setOnce( onceTuples... | java | private Collection<Tuple> getCombinedTuples( List<VarDef> combinedVars, Collection<Tuple> tuples)
{
// Apply any once-only constraints.
Set<Tuple> onceTuples = getOnceTupleDefs( combinedVars);
if( !onceTuples.isEmpty())
{
for( Tuple tuple : tuples)
{
tuple.setOnce( onceTuples... | [
"private",
"Collection",
"<",
"Tuple",
">",
"getCombinedTuples",
"(",
"List",
"<",
"VarDef",
">",
"combinedVars",
",",
"Collection",
"<",
"Tuple",
">",
"tuples",
")",
"{",
"// Apply any once-only constraints.",
"Set",
"<",
"Tuple",
">",
"onceTuples",
"=",
"getOn... | Returns all fully-combined N-tuples of values for the included input variables. | [
"Returns",
"all",
"fully",
"-",
"combined",
"N",
"-",
"tuples",
"of",
"values",
"for",
"the",
"included",
"input",
"variables",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L324-L337 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getOnceTupleDefs | private Set<Tuple> getOnceTupleDefs( final List<VarDef> combinedVars)
{
try
{
return
new HashSet<Tuple>(
IteratorUtils.toList(
IteratorUtils.transformedIterator(
getOnceTuples(),
tupleRef -> toTuple( combinedVars, tupleRef))));
}
ca... | java | private Set<Tuple> getOnceTupleDefs( final List<VarDef> combinedVars)
{
try
{
return
new HashSet<Tuple>(
IteratorUtils.toList(
IteratorUtils.transformedIterator(
getOnceTuples(),
tupleRef -> toTuple( combinedVars, tupleRef))));
}
ca... | [
"private",
"Set",
"<",
"Tuple",
">",
"getOnceTupleDefs",
"(",
"final",
"List",
"<",
"VarDef",
">",
"combinedVars",
")",
"{",
"try",
"{",
"return",
"new",
"HashSet",
"<",
"Tuple",
">",
"(",
"IteratorUtils",
".",
"toList",
"(",
"IteratorUtils",
".",
"transfo... | Returns the set of once-only tuple definitions for this combiner. | [
"Returns",
"the",
"set",
"of",
"once",
"-",
"only",
"tuple",
"definitions",
"for",
"this",
"combiner",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L342-L357 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.toTuple | private Tuple toTuple( List<VarDef> combinedVars, TupleRef tupleRef)
{
if( tupleRef.size() != getTupleSize())
{
throw new IllegalStateException( String.valueOf( tupleRef) + " does not match combiner tuple size=" + getTupleSize());
}
Tuple tuple = new Tuple();
for( Iterator<VarBinding>... | java | private Tuple toTuple( List<VarDef> combinedVars, TupleRef tupleRef)
{
if( tupleRef.size() != getTupleSize())
{
throw new IllegalStateException( String.valueOf( tupleRef) + " does not match combiner tuple size=" + getTupleSize());
}
Tuple tuple = new Tuple();
for( Iterator<VarBinding>... | [
"private",
"Tuple",
"toTuple",
"(",
"List",
"<",
"VarDef",
">",
"combinedVars",
",",
"TupleRef",
"tupleRef",
")",
"{",
"if",
"(",
"tupleRef",
".",
"size",
"(",
")",
"!=",
"getTupleSize",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"... | Converts a reference to a tuple of combined variables. | [
"Converts",
"a",
"reference",
"to",
"a",
"tuple",
"of",
"combined",
"variables",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L362-L394 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.findVarPath | private VarDef findVarPath( List<VarDef> combinedVars, String varPath)
{
int i;
for( i = 0;
i < combinedVars.size()
&& !varPath.equals( combinedVars.get(i).getPathName());
i++);
return
i < combinedVars.size()
? combinedVars.get(i)
: null;
} | java | private VarDef findVarPath( List<VarDef> combinedVars, String varPath)
{
int i;
for( i = 0;
i < combinedVars.size()
&& !varPath.equals( combinedVars.get(i).getPathName());
i++);
return
i < combinedVars.size()
? combinedVars.get(i)
: null;
} | [
"private",
"VarDef",
"findVarPath",
"(",
"List",
"<",
"VarDef",
">",
"combinedVars",
",",
"String",
"varPath",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"combinedVars",
".",
"size",
"(",
")",
"&&",
"!",
"varPath",
".",
"e... | Returns the member of the given variable list with the given path. | [
"Returns",
"the",
"member",
"of",
"the",
"given",
"variable",
"list",
"with",
"the",
"given",
"path",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L399-L411 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.getCombinedVars | public List<VarDef> getCombinedVars( FunctionInputDef inputDef)
{
assertApplicable( inputDef);
List<VarDef> combinedVars = new ArrayList<VarDef>();
for( VarDefIterator varDefs = new VarDefIterator( inputDef); varDefs.hasNext(); )
{
VarDef varDef = varDefs.next();
if( isEligible( varDe... | java | public List<VarDef> getCombinedVars( FunctionInputDef inputDef)
{
assertApplicable( inputDef);
List<VarDef> combinedVars = new ArrayList<VarDef>();
for( VarDefIterator varDefs = new VarDefIterator( inputDef); varDefs.hasNext(); )
{
VarDef varDef = varDefs.next();
if( isEligible( varDe... | [
"public",
"List",
"<",
"VarDef",
">",
"getCombinedVars",
"(",
"FunctionInputDef",
"inputDef",
")",
"{",
"assertApplicable",
"(",
"inputDef",
")",
";",
"List",
"<",
"VarDef",
">",
"combinedVars",
"=",
"new",
"ArrayList",
"<",
"VarDef",
">",
"(",
")",
";",
"... | Returns the set of input variables to be combined. | [
"Returns",
"the",
"set",
"of",
"input",
"variables",
"to",
"be",
"combined",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L416-L439 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.isExcluded | private boolean isExcluded( VarNamePattern varNamePath)
{
boolean excluded = false;
Iterator<VarNamePattern> excludedVars = getExcludedVars().iterator();
while( excludedVars.hasNext() && !(excluded = excludedVars.next().matches( varNamePath)));
return excluded;
} | java | private boolean isExcluded( VarNamePattern varNamePath)
{
boolean excluded = false;
Iterator<VarNamePattern> excludedVars = getExcludedVars().iterator();
while( excludedVars.hasNext() && !(excluded = excludedVars.next().matches( varNamePath)));
return excluded;
} | [
"private",
"boolean",
"isExcluded",
"(",
"VarNamePattern",
"varNamePath",
")",
"{",
"boolean",
"excluded",
"=",
"false",
";",
"Iterator",
"<",
"VarNamePattern",
">",
"excludedVars",
"=",
"getExcludedVars",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"("... | Returns true if the given variable matches any excluded input variable. | [
"Returns",
"true",
"if",
"the",
"given",
"variable",
"matches",
"any",
"excluded",
"input",
"variable",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L444-L450 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.isIncluded | private boolean isIncluded( VarNamePattern varNamePath)
{
// If no included patterns specified, include all variables.
boolean included = getIncludedVars().isEmpty();
if( !included)
{
// Otherwise, look for a matching pattern.
Iterator<VarNamePattern> includedVars = getIncludedVars().i... | java | private boolean isIncluded( VarNamePattern varNamePath)
{
// If no included patterns specified, include all variables.
boolean included = getIncludedVars().isEmpty();
if( !included)
{
// Otherwise, look for a matching pattern.
Iterator<VarNamePattern> includedVars = getIncludedVars().i... | [
"private",
"boolean",
"isIncluded",
"(",
"VarNamePattern",
"varNamePath",
")",
"{",
"// If no included patterns specified, include all variables.",
"boolean",
"included",
"=",
"getIncludedVars",
"(",
")",
".",
"isEmpty",
"(",
")",
";",
"if",
"(",
"!",
"included",
")",... | Returns true if the given variable matches any included input variable. | [
"Returns",
"true",
"if",
"the",
"given",
"variable",
"matches",
"any",
"included",
"input",
"variable",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L455-L467 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.assertApplicable | private void assertApplicable( FunctionInputDef inputDef, VarNamePattern varNamePattern) throws IllegalArgumentException
{
if( !varNamePattern.isApplicable( inputDef))
{
throw new IllegalArgumentException( "Can't find variable matching pattern=" + varNamePattern);
}
} | java | private void assertApplicable( FunctionInputDef inputDef, VarNamePattern varNamePattern) throws IllegalArgumentException
{
if( !varNamePattern.isApplicable( inputDef))
{
throw new IllegalArgumentException( "Can't find variable matching pattern=" + varNamePattern);
}
} | [
"private",
"void",
"assertApplicable",
"(",
"FunctionInputDef",
"inputDef",
",",
"VarNamePattern",
"varNamePattern",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"varNamePattern",
".",
"isApplicable",
"(",
"inputDef",
")",
")",
"{",
"throw",
"new"... | Throws an exception if the given variable pattern is not applicable to the given input definition. | [
"Throws",
"an",
"exception",
"if",
"the",
"given",
"variable",
"pattern",
"is",
"not",
"applicable",
"to",
"the",
"given",
"input",
"definition",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L494-L500 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.isEligible | public boolean isEligible( IVarDef varDef)
{
VarNamePattern varNamePath = new VarNamePattern( varDef.getPathName());
return !isExcluded( varNamePath) && isIncluded( varNamePath);
} | java | public boolean isEligible( IVarDef varDef)
{
VarNamePattern varNamePath = new VarNamePattern( varDef.getPathName());
return !isExcluded( varNamePath) && isIncluded( varNamePath);
} | [
"public",
"boolean",
"isEligible",
"(",
"IVarDef",
"varDef",
")",
"{",
"VarNamePattern",
"varNamePath",
"=",
"new",
"VarNamePattern",
"(",
"varDef",
".",
"getPathName",
"(",
")",
")",
";",
"return",
"!",
"isExcluded",
"(",
"varNamePath",
")",
"&&",
"isIncluded... | Returns true if the given input variable is eligible to be combined. | [
"Returns",
"true",
"if",
"the",
"given",
"input",
"variable",
"is",
"eligible",
"to",
"be",
"combined",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L505-L509 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.setTarget | public void setTarget( File target)
{
try
{
OutputStream targetStream = target==null? null : new FileOutputStream( target);
setTarget( targetStream);
}
catch( Exception e)
{
throw new RuntimeException( "Can't create target stream", e);
}
} | java | public void setTarget( File target)
{
try
{
OutputStream targetStream = target==null? null : new FileOutputStream( target);
setTarget( targetStream);
}
catch( Exception e)
{
throw new RuntimeException( "Can't create target stream", e);
}
} | [
"public",
"void",
"setTarget",
"(",
"File",
"target",
")",
"{",
"try",
"{",
"OutputStream",
"targetStream",
"=",
"target",
"==",
"null",
"?",
"null",
":",
"new",
"FileOutputStream",
"(",
"target",
")",
";",
"setTarget",
"(",
"targetStream",
")",
";",
"}",
... | Changes the target for filter output. | [
"Changes",
"the",
"target",
"for",
"filter",
"output",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L54-L65 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.initializeSource | private OutputStream initializeSource()
{
try
{
PipedOutputStream pipeOut = new PipedOutputStream();
PipedInputStream pipeIn = new PipedInputStream( pipeOut);
filterInput_ = pipeIn;
return new FilterSourceStream( pipeOut);
}
catch( Exception e)
{
throw new Ru... | java | private OutputStream initializeSource()
{
try
{
PipedOutputStream pipeOut = new PipedOutputStream();
PipedInputStream pipeIn = new PipedInputStream( pipeOut);
filterInput_ = pipeIn;
return new FilterSourceStream( pipeOut);
}
catch( Exception e)
{
throw new Ru... | [
"private",
"OutputStream",
"initializeSource",
"(",
")",
"{",
"try",
"{",
"PipedOutputStream",
"pipeOut",
"=",
"new",
"PipedOutputStream",
"(",
")",
";",
"PipedInputStream",
"pipeIn",
"=",
"new",
"PipedInputStream",
"(",
"pipeOut",
")",
";",
"filterInput_",
"=",
... | Initializes the source for filter input. | [
"Initializes",
"the",
"source",
"for",
"filter",
"input",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L101-L115 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.getFilterOutput | protected OutputStream getFilterOutput()
{
OutputStream target = getTarget();
return target == null? System.out : target;
} | java | protected OutputStream getFilterOutput()
{
OutputStream target = getTarget();
return target == null? System.out : target;
} | [
"protected",
"OutputStream",
"getFilterOutput",
"(",
")",
"{",
"OutputStream",
"target",
"=",
"getTarget",
"(",
")",
";",
"return",
"target",
"==",
"null",
"?",
"System",
".",
"out",
":",
"target",
";",
"}"
] | Returns the stream that provides output from the filter. | [
"Returns",
"the",
"stream",
"that",
"provides",
"output",
"from",
"the",
"filter",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L136-L140 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.start | private void start()
{
try
{
// Initialize filter.
initializeFilter( getFilterInput(), getFilterOutput());
// Start filter thread.
failure_ = null;
thread_ = new Thread( this, String.valueOf( this));
thread_.start();
}
catch( Exception e)
{
throw ... | java | private void start()
{
try
{
// Initialize filter.
initializeFilter( getFilterInput(), getFilterOutput());
// Start filter thread.
failure_ = null;
thread_ = new Thread( this, String.valueOf( this));
thread_.start();
}
catch( Exception e)
{
throw ... | [
"private",
"void",
"start",
"(",
")",
"{",
"try",
"{",
"// Initialize filter.",
"initializeFilter",
"(",
"getFilterInput",
"(",
")",
",",
"getFilterOutput",
"(",
")",
")",
";",
"// Start filter thread.",
"failure_",
"=",
"null",
";",
"thread_",
"=",
"new",
"Th... | Starts filter output. | [
"Starts",
"filter",
"output",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L151-L167 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.close | public void close()
{
IOUtils.closeQuietly( source_);
try
{
complete();
}
catch( Exception e)
{
logger_.error( "Can't complete filtering", e);
}
} | java | public void close()
{
IOUtils.closeQuietly( source_);
try
{
complete();
}
catch( Exception e)
{
logger_.error( "Can't complete filtering", e);
}
} | [
"public",
"void",
"close",
"(",
")",
"{",
"IOUtils",
".",
"closeQuietly",
"(",
"source_",
")",
";",
"try",
"{",
"complete",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger_",
".",
"error",
"(",
"\"Can't complete filtering\"",
",",
... | Terminates filter output. | [
"Terminates",
"filter",
"output",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L172-L183 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java | AbstractFilter.complete | private void complete() throws IOException
{
if( source_ != null)
{
try
{
thread_.join();
}
catch( Exception e)
{
logger_.error( "Thread=" + thread_ + " not completed", e);
}
IOException failure =
failure_ == null
? null
... | java | private void complete() throws IOException
{
if( source_ != null)
{
try
{
thread_.join();
}
catch( Exception e)
{
logger_.error( "Thread=" + thread_ + " not completed", e);
}
IOException failure =
failure_ == null
? null
... | [
"private",
"void",
"complete",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"source_",
"!=",
"null",
")",
"{",
"try",
"{",
"thread_",
".",
"join",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"logger_",
".",
"error",
"(",
"\"... | Completes filter output. | [
"Completes",
"filter",
"output",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/AbstractFilter.java#L188-L217 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.setCondition | public void setCondition( ICondition condition)
{
super.setCondition( condition);
// Reset ancestry for all descendants.
if( members_ != null)
{
for( IVarDef member : members_)
{
member.setParent( this);
}
}
} | java | public void setCondition( ICondition condition)
{
super.setCondition( condition);
// Reset ancestry for all descendants.
if( members_ != null)
{
for( IVarDef member : members_)
{
member.setParent( this);
}
}
} | [
"public",
"void",
"setCondition",
"(",
"ICondition",
"condition",
")",
"{",
"super",
".",
"setCondition",
"(",
"condition",
")",
";",
"// Reset ancestry for all descendants.",
"if",
"(",
"members_",
"!=",
"null",
")",
"{",
"for",
"(",
"IVarDef",
"member",
":",
... | Changes the condition that defines when this element is applicable. | [
"Changes",
"the",
"condition",
"that",
"defines",
"when",
"this",
"element",
"is",
"applicable",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L78-L90 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.find | public IVarDef find( String... path)
{
return
path == null || path.length == 0
? this
: getDescendant( path);
} | java | public IVarDef find( String... path)
{
return
path == null || path.length == 0
? this
: getDescendant( path);
} | [
"public",
"IVarDef",
"find",
"(",
"String",
"...",
"path",
")",
"{",
"return",
"path",
"==",
"null",
"||",
"path",
".",
"length",
"==",
"0",
"?",
"this",
":",
"getDescendant",
"(",
"path",
")",
";",
"}"
] | Returns the descendant variable with the given name path, relative to this variable. | [
"Returns",
"the",
"descendant",
"variable",
"with",
"the",
"given",
"name",
"path",
"relative",
"to",
"this",
"variable",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L95-L101 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.addMember | public VarSet addMember( IVarDef var)
{
assert var != null;
assert var.getName() != null;
if( findMember( var.getName()) >= 0)
{
throw new IllegalStateException( "Member=" + var.getName() + " already defined for varSet=" + getPathName());
}
members_.add( var);
var.setParent( ... | java | public VarSet addMember( IVarDef var)
{
assert var != null;
assert var.getName() != null;
if( findMember( var.getName()) >= 0)
{
throw new IllegalStateException( "Member=" + var.getName() + " already defined for varSet=" + getPathName());
}
members_.add( var);
var.setParent( ... | [
"public",
"VarSet",
"addMember",
"(",
"IVarDef",
"var",
")",
"{",
"assert",
"var",
"!=",
"null",
";",
"assert",
"var",
".",
"getName",
"(",
")",
"!=",
"null",
";",
"if",
"(",
"findMember",
"(",
"var",
".",
"getName",
"(",
")",
")",
">=",
"0",
")",
... | Adds an input variable to this set. | [
"Adds",
"an",
"input",
"variable",
"to",
"this",
"set",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L106-L121 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.removeMember | public VarSet removeMember( String name)
{
int i = findMember( name);
if( i >= 0)
{
members_.remove(i).setParent( null) ;
}
return this;
} | java | public VarSet removeMember( String name)
{
int i = findMember( name);
if( i >= 0)
{
members_.remove(i).setParent( null) ;
}
return this;
} | [
"public",
"VarSet",
"removeMember",
"(",
"String",
"name",
")",
"{",
"int",
"i",
"=",
"findMember",
"(",
"name",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{",
"members_",
".",
"remove",
"(",
"i",
")",
".",
"setParent",
"(",
"null",
")",
";",
"}"... | Removes an input variable from this set. | [
"Removes",
"an",
"input",
"variable",
"from",
"this",
"set",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L126-L135 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.getMember | public IVarDef getMember( String name)
{
int i = findMember( name);
return i >= 0? members_.get(i) : null;
} | java | public IVarDef getMember( String name)
{
int i = findMember( name);
return i >= 0? members_.get(i) : null;
} | [
"public",
"IVarDef",
"getMember",
"(",
"String",
"name",
")",
"{",
"int",
"i",
"=",
"findMember",
"(",
"name",
")",
";",
"return",
"i",
">=",
"0",
"?",
"members_",
".",
"get",
"(",
"i",
")",
":",
"null",
";",
"}"
] | Returns the member variable with the given name. | [
"Returns",
"the",
"member",
"variable",
"with",
"the",
"given",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L140-L144 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.getDescendant | private IVarDef getDescendant( String[] path)
{
int pathLength = path == null? 0 : path.length;
int parentPathLength = pathLength - 1;
int i;
VarSet parent;
IVarDef descendant;
for( i = 0,
parent = this,
descendant = null;
i < p... | java | private IVarDef getDescendant( String[] path)
{
int pathLength = path == null? 0 : path.length;
int parentPathLength = pathLength - 1;
int i;
VarSet parent;
IVarDef descendant;
for( i = 0,
parent = this,
descendant = null;
i < p... | [
"private",
"IVarDef",
"getDescendant",
"(",
"String",
"[",
"]",
"path",
")",
"{",
"int",
"pathLength",
"=",
"path",
"==",
"null",
"?",
"0",
":",
"path",
".",
"length",
";",
"int",
"parentPathLength",
"=",
"pathLength",
"-",
"1",
";",
"int",
"i",
";",
... | Returns the descendant variable with the given path, relative to this set. | [
"Returns",
"the",
"descendant",
"variable",
"with",
"the",
"given",
"path",
"relative",
"to",
"this",
"set",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L157-L180 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java | VarSet.findMember | protected int findMember( String name)
{
int memberCount = name==null? 0 : members_.size();
int i;
for( i = 0; i < memberCount && !name.equals( members_.get(i).getName()); i++);
return i < memberCount? i : -1;
} | java | protected int findMember( String name)
{
int memberCount = name==null? 0 : members_.size();
int i;
for( i = 0; i < memberCount && !name.equals( members_.get(i).getName()); i++);
return i < memberCount? i : -1;
} | [
"protected",
"int",
"findMember",
"(",
"String",
"name",
")",
"{",
"int",
"memberCount",
"=",
"name",
"==",
"null",
"?",
"0",
":",
"members_",
".",
"size",
"(",
")",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"memberCount",
"... | Returns the index of the member variable with the given name. | [
"Returns",
"the",
"index",
"of",
"the",
"member",
"variable",
"with",
"the",
"given",
"name",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSet.java#L185-L191 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java | CollectionUtils.toStream | public static <T> Stream<T> toStream( Iterator<T> iterator)
{
Iterable<T> iterable = () -> iterator;
return toStream( iterable);
} | java | public static <T> Stream<T> toStream( Iterator<T> iterator)
{
Iterable<T> iterable = () -> iterator;
return toStream( iterable);
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"toStream",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
")",
"{",
"Iterable",
"<",
"T",
">",
"iterable",
"=",
"(",
")",
"->",
"iterator",
";",
"return",
"toStream",
"(",
"iterable",
")",
"... | Returns a stream that produces the sequence defined by the given Iterator. | [
"Returns",
"a",
"stream",
"that",
"produces",
"the",
"sequence",
"defined",
"by",
"the",
"given",
"Iterator",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java#L36-L40 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java | CollectionUtils.iterableOf | public static <T> List<T> iterableOf( Optional<T> value)
{
return value.map( Arrays::asList).orElse( Collections.emptyList());
} | java | public static <T> List<T> iterableOf( Optional<T> value)
{
return value.map( Arrays::asList).orElse( Collections.emptyList());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"iterableOf",
"(",
"Optional",
"<",
"T",
">",
"value",
")",
"{",
"return",
"value",
".",
"map",
"(",
"Arrays",
"::",
"asList",
")",
".",
"orElse",
"(",
"Collections",
".",
"emptyList",
"(",
... | If the given value is present, returns it as a singleton list. Otherwise, returns an empty list. | [
"If",
"the",
"given",
"value",
"is",
"present",
"returns",
"it",
"as",
"a",
"singleton",
"list",
".",
"Otherwise",
"returns",
"an",
"empty",
"list",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java#L53-L56 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java | CollectionUtils.streamOf | public static <T> Stream<T> streamOf( Optional<T> value)
{
return value.map( Stream::of).orElse( Stream.empty());
} | java | public static <T> Stream<T> streamOf( Optional<T> value)
{
return value.map( Stream::of).orElse( Stream.empty());
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"streamOf",
"(",
"Optional",
"<",
"T",
">",
"value",
")",
"{",
"return",
"value",
".",
"map",
"(",
"Stream",
"::",
"of",
")",
".",
"orElse",
"(",
"Stream",
".",
"empty",
"(",
")",
")",
... | If the given value is present, returns it as a single-element stream. Otherwise, returns an empty stream. | [
"If",
"the",
"given",
"value",
"is",
"present",
"returns",
"it",
"as",
"a",
"single",
"-",
"element",
"stream",
".",
"Otherwise",
"returns",
"an",
"empty",
"stream",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java#L61-L64 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java | CollectionUtils.membersOf | public static <T,C extends Collection<T>> Stream<T> membersOf( C collection)
{
return
collection == null
? Stream.empty()
: collection.stream();
} | java | public static <T,C extends Collection<T>> Stream<T> membersOf( C collection)
{
return
collection == null
? Stream.empty()
: collection.stream();
} | [
"public",
"static",
"<",
"T",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"Stream",
"<",
"T",
">",
"membersOf",
"(",
"C",
"collection",
")",
"{",
"return",
"collection",
"==",
"null",
"?",
"Stream",
".",
"empty",
"(",
")",
":",
"collection... | Returns a stream containing the members of the given collection. | [
"Returns",
"a",
"stream",
"containing",
"the",
"members",
"of",
"the",
"given",
"collection",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java#L69-L75 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java | CollectionUtils.entriesOf | public static <K,V,M extends Map<K,V>> Stream<Map.Entry<K,V>> entriesOf( M map)
{
return
map == null
? Stream.empty()
: map.entrySet().stream();
} | java | public static <K,V,M extends Map<K,V>> Stream<Map.Entry<K,V>> entriesOf( M map)
{
return
map == null
? Stream.empty()
: map.entrySet().stream();
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"M",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
">",
"Stream",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"entriesOf",
"(",
"M",
"map",
")",
"{",
"return",
"map",
"==",
"null",
"?",
... | Returns a stream containing the entries of the given map. | [
"Returns",
"a",
"stream",
"containing",
"the",
"entries",
"of",
"the",
"given",
"map",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/util/CollectionUtils.java#L80-L86 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java | Resource.open | protected InputStream open()
{
try
{
if( getType() == null)
{
throw new IllegalStateException( String.format( "Unknown type for %s", this));
}
URL location = getLocation();
return
location == null
? System.in
: (stream_ = location.ope... | java | protected InputStream open()
{
try
{
if( getType() == null)
{
throw new IllegalStateException( String.format( "Unknown type for %s", this));
}
URL location = getLocation();
return
location == null
? System.in
: (stream_ = location.ope... | [
"protected",
"InputStream",
"open",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"getType",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"format",
"(",
"\"Unknown type for %s\"",
",",
"this",
")",
")",
";",
"}",... | Opens a stream to read the contents of this resource. | [
"Opens",
"a",
"stream",
"to",
"read",
"the",
"contents",
"of",
"this",
"resource",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java#L115-L135 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java | Resource.withDefaultType | public static <T extends Resource> T withDefaultType( T resource, Type defaultType)
{
if( resource.getType() == null)
{
resource.setType( defaultType);
}
return resource;
} | java | public static <T extends Resource> T withDefaultType( T resource, Type defaultType)
{
if( resource.getType() == null)
{
resource.setType( defaultType);
}
return resource;
} | [
"public",
"static",
"<",
"T",
"extends",
"Resource",
">",
"T",
"withDefaultType",
"(",
"T",
"resource",
",",
"Type",
"defaultType",
")",
"{",
"if",
"(",
"resource",
".",
"getType",
"(",
")",
"==",
"null",
")",
"{",
"resource",
".",
"setType",
"(",
"def... | Returns the given resource, assigning the default type if no type yet defined. | [
"Returns",
"the",
"given",
"resource",
"assigning",
"the",
"default",
"type",
"if",
"no",
"type",
"yet",
"defined",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java#L163-L171 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java | Resource.withDefaultType | public static File withDefaultType( File file, Type defaultType)
{
return
file != null && FilenameUtils.getExtension( file.getName()).isEmpty()
? new File( String.format( "%s.%s", file.getPath(), String.valueOf( defaultType).toLowerCase()))
: file;
} | java | public static File withDefaultType( File file, Type defaultType)
{
return
file != null && FilenameUtils.getExtension( file.getName()).isEmpty()
? new File( String.format( "%s.%s", file.getPath(), String.valueOf( defaultType).toLowerCase()))
: file;
} | [
"public",
"static",
"File",
"withDefaultType",
"(",
"File",
"file",
",",
"Type",
"defaultType",
")",
"{",
"return",
"file",
"!=",
"null",
"&&",
"FilenameUtils",
".",
"getExtension",
"(",
"file",
".",
"getName",
"(",
")",
")",
".",
"isEmpty",
"(",
")",
"?... | Returns the given file name, assigning the default type if no type defined. | [
"Returns",
"the",
"given",
"file",
"name",
"assigning",
"the",
"default",
"type",
"if",
"no",
"type",
"defined",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/Resource.java#L176-L182 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarValueDef.java | VarValueDef.addProperties | public VarValueDef addProperties( Collection<String> properties)
{
if( properties != null)
{
assertPropertyIdentifiers( properties);
properties_.addAll( properties);
}
return this;
} | java | public VarValueDef addProperties( Collection<String> properties)
{
if( properties != null)
{
assertPropertyIdentifiers( properties);
properties_.addAll( properties);
}
return this;
} | [
"public",
"VarValueDef",
"addProperties",
"(",
"Collection",
"<",
"String",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"assertPropertyIdentifiers",
"(",
"properties",
")",
";",
"properties_",
".",
"addAll",
"(",
"properties",
... | Adds to the set of test case properties contributed by this value. | [
"Adds",
"to",
"the",
"set",
"of",
"test",
"case",
"properties",
"contributed",
"by",
"this",
"value",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarValueDef.java#L174-L183 | train |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJsonWriter.java | ProjectJsonWriter.write | public void write( Project project)
{
JsonWriterFactory writerFactory = Json.createWriterFactory( MapBuilder.of( PRETTY_PRINTING, true).build());
JsonWriter jsonWriter = writerFactory.createWriter( getWriter());
jsonWriter.write( ProjectJson.toJson( project));
} | java | public void write( Project project)
{
JsonWriterFactory writerFactory = Json.createWriterFactory( MapBuilder.of( PRETTY_PRINTING, true).build());
JsonWriter jsonWriter = writerFactory.createWriter( getWriter());
jsonWriter.write( ProjectJson.toJson( project));
} | [
"public",
"void",
"write",
"(",
"Project",
"project",
")",
"{",
"JsonWriterFactory",
"writerFactory",
"=",
"Json",
".",
"createWriterFactory",
"(",
"MapBuilder",
".",
"of",
"(",
"PRETTY_PRINTING",
",",
"true",
")",
".",
"build",
"(",
")",
")",
";",
"JsonWrit... | Writes the given project definition the form of a JSON document. | [
"Writes",
"the",
"given",
"project",
"definition",
"the",
"form",
"of",
"a",
"JSON",
"document",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJsonWriter.java#L57-L63 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.of | public static Tuple of( Collection<VarBindingDef> tupleBindings)
{
Tuple tuple = new Tuple();
boolean bindingsCompatible;
Iterator<VarBindingDef> bindings;
VarBindingDef nextBinding;
for( bindings = tupleBindings.iterator(),
bindingsCompatible = true;
bindings.hasNext(... | java | public static Tuple of( Collection<VarBindingDef> tupleBindings)
{
Tuple tuple = new Tuple();
boolean bindingsCompatible;
Iterator<VarBindingDef> bindings;
VarBindingDef nextBinding;
for( bindings = tupleBindings.iterator(),
bindingsCompatible = true;
bindings.hasNext(... | [
"public",
"static",
"Tuple",
"of",
"(",
"Collection",
"<",
"VarBindingDef",
">",
"tupleBindings",
")",
"{",
"Tuple",
"tuple",
"=",
"new",
"Tuple",
"(",
")",
";",
"boolean",
"bindingsCompatible",
";",
"Iterator",
"<",
"VarBindingDef",
">",
"bindings",
";",
"V... | Returns null if all of the given bindings cannot be included in compatible Tuple.
Otherwise, returns a new compatible Tuple containing all of the given bindings. | [
"Returns",
"null",
"if",
"all",
"of",
"the",
"given",
"bindings",
"cannot",
"be",
"included",
"in",
"compatible",
"Tuple",
".",
"Otherwise",
"returns",
"a",
"new",
"compatible",
"Tuple",
"containing",
"all",
"of",
"the",
"given",
"bindings",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L69-L88 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.isBindingCompatible | private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding)
{
VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
return (currentValue == null || currentValue.equals( binding.getValueDef()));
} | java | private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding)
{
VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
return (currentValue == null || currentValue.equals( binding.getValueDef()));
} | [
"private",
"static",
"boolean",
"isBindingCompatible",
"(",
"Tuple",
"tuple",
",",
"VarBindingDef",
"binding",
")",
"{",
"VarValueDef",
"currentValue",
"=",
"tuple",
".",
"getBinding",
"(",
"binding",
".",
"getVarDef",
"(",
")",
")",
";",
"return",
"(",
"curre... | Returns true if the given binding can be added to the give tuple. | [
"Returns",
"true",
"if",
"the",
"given",
"binding",
"can",
"be",
"added",
"to",
"the",
"give",
"tuple",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L93-L97 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.setBindings | public void setBindings( Collection<VarBindingDef> bindings)
{
bindings_ = new HashMap<VarDef,VarBindingDef>();
properties_ = new PropertySet();
if( bindings != null)
{
for( VarBindingDef binding : bindings)
{
add( binding);
}
}
} | java | public void setBindings( Collection<VarBindingDef> bindings)
{
bindings_ = new HashMap<VarDef,VarBindingDef>();
properties_ = new PropertySet();
if( bindings != null)
{
for( VarBindingDef binding : bindings)
{
add( binding);
}
}
} | [
"public",
"void",
"setBindings",
"(",
"Collection",
"<",
"VarBindingDef",
">",
"bindings",
")",
"{",
"bindings_",
"=",
"new",
"HashMap",
"<",
"VarDef",
",",
"VarBindingDef",
">",
"(",
")",
";",
"properties_",
"=",
"new",
"PropertySet",
"(",
")",
";",
"if",... | Changes the variable bindings for this tuple. | [
"Changes",
"the",
"variable",
"bindings",
"for",
"this",
"tuple",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L102-L114 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.getBinding | public VarValueDef getBinding( VarDef var)
{
VarBindingDef binding = bindings_.get( var);
return
binding == null
? null
: binding.getValueDef();
} | java | public VarValueDef getBinding( VarDef var)
{
VarBindingDef binding = bindings_.get( var);
return
binding == null
? null
: binding.getValueDef();
} | [
"public",
"VarValueDef",
"getBinding",
"(",
"VarDef",
"var",
")",
"{",
"VarBindingDef",
"binding",
"=",
"bindings_",
".",
"get",
"(",
"var",
")",
";",
"return",
"binding",
"==",
"null",
"?",
"null",
":",
"binding",
".",
"getValueDef",
"(",
")",
";",
"}"
... | Returns the value bound by this tuple for the given variable. | [
"Returns",
"the",
"value",
"bound",
"by",
"this",
"tuple",
"for",
"the",
"given",
"variable",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L135-L142 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.add | public Tuple add( VarBindingDef binding)
{
if( binding != null)
{
VarDef var = binding.getVarDef();
if( var == null)
{
throw new IllegalArgumentException( "Invalid binding=" + binding + ": variable undefined");
}
VarValueDef value = binding.getValueDef();
i... | java | public Tuple add( VarBindingDef binding)
{
if( binding != null)
{
VarDef var = binding.getVarDef();
if( var == null)
{
throw new IllegalArgumentException( "Invalid binding=" + binding + ": variable undefined");
}
VarValueDef value = binding.getValueDef();
i... | [
"public",
"Tuple",
"add",
"(",
"VarBindingDef",
"binding",
")",
"{",
"if",
"(",
"binding",
"!=",
"null",
")",
"{",
"VarDef",
"var",
"=",
"binding",
".",
"getVarDef",
"(",
")",
";",
"if",
"(",
"var",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArg... | Adds a binding to this tuple. | [
"Adds",
"a",
"binding",
"to",
"this",
"tuple",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L163-L186 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.addAll | public Tuple addAll( Tuple tuple)
{
if( tuple != null)
{
for( Iterator<VarBindingDef> bindings = tuple.getBindings(); bindings.hasNext();)
{
add( bindings.next());
}
}
return this;
} | java | public Tuple addAll( Tuple tuple)
{
if( tuple != null)
{
for( Iterator<VarBindingDef> bindings = tuple.getBindings(); bindings.hasNext();)
{
add( bindings.next());
}
}
return this;
} | [
"public",
"Tuple",
"addAll",
"(",
"Tuple",
"tuple",
")",
"{",
"if",
"(",
"tuple",
"!=",
"null",
")",
"{",
"for",
"(",
"Iterator",
"<",
"VarBindingDef",
">",
"bindings",
"=",
"tuple",
".",
"getBindings",
"(",
")",
";",
"bindings",
".",
"hasNext",
"(",
... | Adds all bindings from the given tuple. | [
"Adds",
"all",
"bindings",
"from",
"the",
"given",
"tuple",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L191-L202 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.remove | public Tuple remove( VarDef var)
{
VarBindingDef binding = bindings_.remove( var);
if( binding != null)
{
properties_.removeAll( binding.getValueDef().getProperties().iterator());
}
return this;
} | java | public Tuple remove( VarDef var)
{
VarBindingDef binding = bindings_.remove( var);
if( binding != null)
{
properties_.removeAll( binding.getValueDef().getProperties().iterator());
}
return this;
} | [
"public",
"Tuple",
"remove",
"(",
"VarDef",
"var",
")",
"{",
"VarBindingDef",
"binding",
"=",
"bindings_",
".",
"remove",
"(",
"var",
")",
";",
"if",
"(",
"binding",
"!=",
"null",
")",
"{",
"properties_",
".",
"removeAll",
"(",
"binding",
".",
"getValueD... | Removes a binding from this tuple. | [
"Removes",
"a",
"binding",
"from",
"this",
"tuple",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L207-L216 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java | Tuple.isCompatible | public boolean isCompatible()
{
boolean compatible;
Iterator<VarBindingDef> bindings;
VarBindingDef binding = null;
for( compatible = true,
bindings = getBindings();
compatible
&& bindings.hasNext();
compatible =
(binding = bindings.next())
... | java | public boolean isCompatible()
{
boolean compatible;
Iterator<VarBindingDef> bindings;
VarBindingDef binding = null;
for( compatible = true,
bindings = getBindings();
compatible
&& bindings.hasNext();
compatible =
(binding = bindings.next())
... | [
"public",
"boolean",
"isCompatible",
"(",
")",
"{",
"boolean",
"compatible",
";",
"Iterator",
"<",
"VarBindingDef",
">",
"bindings",
";",
"VarBindingDef",
"binding",
"=",
"null",
";",
"for",
"(",
"compatible",
"=",
"true",
",",
"bindings",
"=",
"getBindings",
... | Returns true if this tuple contains compatible variable bindings. | [
"Returns",
"true",
"if",
"this",
"tuple",
"contains",
"compatible",
"variable",
"bindings",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/Tuple.java#L237-L264 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.makeSatisfied | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples)
{
// Test case still missing a required property?
boolean satisfied = testCase.isSatisfied();
if( !satisfied)
{
// Yes, find tuples that contain satisfying bindings.
int prevBindings = testCase.getBindingCount();
... | java | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples)
{
// Test case still missing a required property?
boolean satisfied = testCase.isSatisfied();
if( !satisfied)
{
// Yes, find tuples that contain satisfying bindings.
int prevBindings = testCase.getBindingCount();
... | [
"private",
"boolean",
"makeSatisfied",
"(",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"tuples",
")",
"{",
"// Test case still missing a required property?",
"boolean",
"satisfied",
"=",
"testCase",
".",
"isSatisfied",
"(",
")",
";",
"if",
"(",
"!",
"satisfied",
... | Using selections from the given set of tuples, completes bindings to satisfy all current test case conditions.
Returns true if and only if all conditions satisfied. | [
"Using",
"selections",
"from",
"the",
"given",
"set",
"of",
"tuples",
"completes",
"bindings",
"to",
"satisfy",
"all",
"current",
"test",
"case",
"conditions",
".",
"Returns",
"true",
"if",
"and",
"only",
"if",
"all",
"conditions",
"satisfied",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L482-L501 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.makeSatisfied | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples, Tuple satisfyingTuple)
{
return
// Compatible tuple found?
testCase.addCompatible( satisfyingTuple) != null
// Did this tuple create an infeasible combination?
&& !testCase.isInfeasible()
// Can also we sati... | java | private boolean makeSatisfied( TestCaseDef testCase, VarTupleSet tuples, Tuple satisfyingTuple)
{
return
// Compatible tuple found?
testCase.addCompatible( satisfyingTuple) != null
// Did this tuple create an infeasible combination?
&& !testCase.isInfeasible()
// Can also we sati... | [
"private",
"boolean",
"makeSatisfied",
"(",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"tuples",
",",
"Tuple",
"satisfyingTuple",
")",
"{",
"return",
"// Compatible tuple found?",
"testCase",
".",
"addCompatible",
"(",
"satisfyingTuple",
")",
"!=",
"null",
"// Did... | Starting with the given tuple, completes bindings to satisfy all current test case conditions,
using additional selections from the given set of tuples if necessary.
Returns true if and only if all conditions satisfied. | [
"Starting",
"with",
"the",
"given",
"tuple",
"completes",
"bindings",
"to",
"satisfy",
"all",
"current",
"test",
"case",
"conditions",
"using",
"additional",
"selections",
"from",
"the",
"given",
"set",
"of",
"tuples",
"if",
"necessary",
".",
"Returns",
"true",
... | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L508-L519 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getBindingsFor | private Iterator<Tuple> getBindingsFor( VarTupleSet tuples, VarDef var)
{
return
IteratorUtils.chainedIterator(
tuples.getUnused( var),
IteratorUtils.chainedIterator(
tuples.getUsed( var),
tuples.getUsedOnce( var)));
} | java | private Iterator<Tuple> getBindingsFor( VarTupleSet tuples, VarDef var)
{
return
IteratorUtils.chainedIterator(
tuples.getUnused( var),
IteratorUtils.chainedIterator(
tuples.getUsed( var),
tuples.getUsedOnce( var)));
} | [
"private",
"Iterator",
"<",
"Tuple",
">",
"getBindingsFor",
"(",
"VarTupleSet",
"tuples",
",",
"VarDef",
"var",
")",
"{",
"return",
"IteratorUtils",
".",
"chainedIterator",
"(",
"tuples",
".",
"getUnused",
"(",
"var",
")",
",",
"IteratorUtils",
".",
"chainedIt... | Returns a set of 1-tuples containing the bindings for the given variable that are applicable to the given test case. | [
"Returns",
"a",
"set",
"of",
"1",
"-",
"tuples",
"containing",
"the",
"bindings",
"for",
"the",
"given",
"variable",
"that",
"are",
"applicable",
"to",
"the",
"given",
"test",
"case",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L524-L532 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getSatisfyingTuples | private Iterator<Tuple> getSatisfyingTuples( final TestCaseDef testCase, VarTupleSet varTupleSet)
{
final Comparator<VarBindingDef> byUsage = byUsage( varTupleSet);
return
IteratorUtils.transformedIterator(
// Iterate over all combinations of bindings...
new CartesianProduct<VarBindin... | java | private Iterator<Tuple> getSatisfyingTuples( final TestCaseDef testCase, VarTupleSet varTupleSet)
{
final Comparator<VarBindingDef> byUsage = byUsage( varTupleSet);
return
IteratorUtils.transformedIterator(
// Iterate over all combinations of bindings...
new CartesianProduct<VarBindin... | [
"private",
"Iterator",
"<",
"Tuple",
">",
"getSatisfyingTuples",
"(",
"final",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"varTupleSet",
")",
"{",
"final",
"Comparator",
"<",
"VarBindingDef",
">",
"byUsage",
"=",
"byUsage",
"(",
"varTupleSet",
")",
";",
"ret... | Returns the set of tuples that could satisfy conditions required by the given test case. | [
"Returns",
"the",
"set",
"of",
"tuples",
"that",
"could",
"satisfy",
"conditions",
"required",
"by",
"the",
"given",
"test",
"case",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L545-L590 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getVarsRemaining | private List<VarDef> getVarsRemaining( FunctionInputDef inputDef, TestCaseDef testCase)
{
return getVarsRemaining( new VarDefIterator( inputDef), testCase);
} | java | private List<VarDef> getVarsRemaining( FunctionInputDef inputDef, TestCaseDef testCase)
{
return getVarsRemaining( new VarDefIterator( inputDef), testCase);
} | [
"private",
"List",
"<",
"VarDef",
">",
"getVarsRemaining",
"(",
"FunctionInputDef",
"inputDef",
",",
"TestCaseDef",
"testCase",
")",
"{",
"return",
"getVarsRemaining",
"(",
"new",
"VarDefIterator",
"(",
"inputDef",
")",
",",
"testCase",
")",
";",
"}"
] | Returns the set of input variables not yet bound by the given test case. | [
"Returns",
"the",
"set",
"of",
"input",
"variables",
"not",
"yet",
"bound",
"by",
"the",
"given",
"test",
"case",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L595-L598 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getValidTupleSet | private VarTupleSet getValidTupleSet( RandSeq randSeq, FunctionInputDef inputDef)
{
List<Tuple> validTuples = new ArrayList<Tuple>();
// Get tuple sets required for each specified combiner, ordered for "greedy" processing, i.e. biggest tuples first.
// For this purpose, "all permutations" is considered... | java | private VarTupleSet getValidTupleSet( RandSeq randSeq, FunctionInputDef inputDef)
{
List<Tuple> validTuples = new ArrayList<Tuple>();
// Get tuple sets required for each specified combiner, ordered for "greedy" processing, i.e. biggest tuples first.
// For this purpose, "all permutations" is considered... | [
"private",
"VarTupleSet",
"getValidTupleSet",
"(",
"RandSeq",
"randSeq",
",",
"FunctionInputDef",
"inputDef",
")",
"{",
"List",
"<",
"Tuple",
">",
"validTuples",
"=",
"new",
"ArrayList",
"<",
"Tuple",
">",
"(",
")",
";",
"// Get tuple sets required for each specifie... | Returns the all valid input tuples required for generated test cases. | [
"Returns",
"the",
"all",
"valid",
"input",
"tuples",
"required",
"for",
"generated",
"test",
"cases",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L623-L657 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getUncombinedTuples | private Collection<Tuple> getUncombinedTuples( List<VarDef> uncombinedVars, int defaultTupleSize)
{
Collection<Tuple> tuples = TupleCombiner.getTuples( uncombinedVars, defaultTupleSize);
if( defaultTupleSize == 1)
{
for( Tuple tuple : tuples)
{
VarValueDef value = tuple.getBindin... | java | private Collection<Tuple> getUncombinedTuples( List<VarDef> uncombinedVars, int defaultTupleSize)
{
Collection<Tuple> tuples = TupleCombiner.getTuples( uncombinedVars, defaultTupleSize);
if( defaultTupleSize == 1)
{
for( Tuple tuple : tuples)
{
VarValueDef value = tuple.getBindin... | [
"private",
"Collection",
"<",
"Tuple",
">",
"getUncombinedTuples",
"(",
"List",
"<",
"VarDef",
">",
"uncombinedVars",
",",
"int",
"defaultTupleSize",
")",
"{",
"Collection",
"<",
"Tuple",
">",
"tuples",
"=",
"TupleCombiner",
".",
"getTuples",
"(",
"uncombinedVar... | Returns default tuples for all uncombined variables. | [
"Returns",
"default",
"tuples",
"for",
"all",
"uncombined",
"variables",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L670-L682 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getFailureTupleSet | private VarTupleSet getFailureTupleSet( RandSeq randSeq, FunctionInputDef inputDef)
{
List<Tuple> failureTuples = new ArrayList<Tuple>();
for( VarDefIterator vars = new VarDefIterator( inputDef); vars.hasNext(); )
{
VarDef var = vars.next();
for( Iterator<VarValueDef> failures = var.getFa... | java | private VarTupleSet getFailureTupleSet( RandSeq randSeq, FunctionInputDef inputDef)
{
List<Tuple> failureTuples = new ArrayList<Tuple>();
for( VarDefIterator vars = new VarDefIterator( inputDef); vars.hasNext(); )
{
VarDef var = vars.next();
for( Iterator<VarValueDef> failures = var.getFa... | [
"private",
"VarTupleSet",
"getFailureTupleSet",
"(",
"RandSeq",
"randSeq",
",",
"FunctionInputDef",
"inputDef",
")",
"{",
"List",
"<",
"Tuple",
">",
"failureTuples",
"=",
"new",
"ArrayList",
"<",
"Tuple",
">",
"(",
")",
";",
"for",
"(",
"VarDefIterator",
"vars... | Returns the all failure input tuples required for generated test cases. | [
"Returns",
"the",
"all",
"failure",
"input",
"tuples",
"required",
"for",
"generated",
"test",
"cases",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L714-L728 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.createPropertyProviders | private MultiValuedMap<String,VarBindingDef> createPropertyProviders( FunctionInputDef inputDef)
{
propertyProviders_ = MultiMapUtils.newListValuedHashMap();
for( VarDefIterator varDefs = new VarDefIterator( inputDef.getVarDefs()); varDefs.hasNext(); )
{
VarDef varDef = varDefs.next();
for... | java | private MultiValuedMap<String,VarBindingDef> createPropertyProviders( FunctionInputDef inputDef)
{
propertyProviders_ = MultiMapUtils.newListValuedHashMap();
for( VarDefIterator varDefs = new VarDefIterator( inputDef.getVarDefs()); varDefs.hasNext(); )
{
VarDef varDef = varDefs.next();
for... | [
"private",
"MultiValuedMap",
"<",
"String",
",",
"VarBindingDef",
">",
"createPropertyProviders",
"(",
"FunctionInputDef",
"inputDef",
")",
"{",
"propertyProviders_",
"=",
"MultiMapUtils",
".",
"newListValuedHashMap",
"(",
")",
";",
"for",
"(",
"VarDefIterator",
"varD... | Return a map that associates each value property with the set of bindings that provide it. | [
"Return",
"a",
"map",
"that",
"associates",
"each",
"value",
"property",
"with",
"the",
"set",
"of",
"bindings",
"that",
"provide",
"it",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L733-L754 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.getPropertyProviders | private Set<VarBindingDef> getPropertyProviders( Set<String> properties)
{
Set<VarBindingDef> bindings = new HashSet<VarBindingDef>();
for( String property : properties)
{
bindings.addAll( propertyProviders_.get( property));
}
return bindings;
} | java | private Set<VarBindingDef> getPropertyProviders( Set<String> properties)
{
Set<VarBindingDef> bindings = new HashSet<VarBindingDef>();
for( String property : properties)
{
bindings.addAll( propertyProviders_.get( property));
}
return bindings;
} | [
"private",
"Set",
"<",
"VarBindingDef",
">",
"getPropertyProviders",
"(",
"Set",
"<",
"String",
">",
"properties",
")",
"{",
"Set",
"<",
"VarBindingDef",
">",
"bindings",
"=",
"new",
"HashSet",
"<",
"VarBindingDef",
">",
"(",
")",
";",
"for",
"(",
"String"... | Returns the set of bindings that provide at least one of the given properties | [
"Returns",
"the",
"set",
"of",
"bindings",
"that",
"provide",
"at",
"least",
"one",
"of",
"the",
"given",
"properties"
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L759-L768 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.byUsage | private Comparator<VarBindingDef> byUsage( final VarTupleSet varTupleSet)
{
return
new Comparator<VarBindingDef>()
{
public int compare( VarBindingDef binding1, VarBindingDef binding2)
{
// Compare by usage score: higher score is preferred.
int resultScore = g... | java | private Comparator<VarBindingDef> byUsage( final VarTupleSet varTupleSet)
{
return
new Comparator<VarBindingDef>()
{
public int compare( VarBindingDef binding1, VarBindingDef binding2)
{
// Compare by usage score: higher score is preferred.
int resultScore = g... | [
"private",
"Comparator",
"<",
"VarBindingDef",
">",
"byUsage",
"(",
"final",
"VarTupleSet",
"varTupleSet",
")",
"{",
"return",
"new",
"Comparator",
"<",
"VarBindingDef",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"VarBindingDef",
"binding1",
",",
"Va... | Returns a comparator that orders bindings by decreasing preference, preferring bindings that are
less used. | [
"Returns",
"a",
"comparator",
"that",
"orders",
"bindings",
"by",
"decreasing",
"preference",
"preferring",
"bindings",
"that",
"are",
"less",
"used",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L783-L818 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/GeneratorSetBuilder.java | GeneratorSetBuilder.generator | public GeneratorSetBuilder generator( String functionName, ITestCaseGenerator generator)
{
generatorSet_.addGenerator( functionName, generator);
return this;
} | java | public GeneratorSetBuilder generator( String functionName, ITestCaseGenerator generator)
{
generatorSet_.addGenerator( functionName, generator);
return this;
} | [
"public",
"GeneratorSetBuilder",
"generator",
"(",
"String",
"functionName",
",",
"ITestCaseGenerator",
"generator",
")",
"{",
"generatorSet_",
".",
"addGenerator",
"(",
"functionName",
",",
"generator",
")",
";",
"return",
"this",
";",
"}"
] | Adds a generator to this set for the given function. | [
"Adds",
"a",
"generator",
"to",
"this",
"set",
"for",
"the",
"given",
"function",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/GeneratorSetBuilder.java#L74-L78 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java | VarBindingBuilder.start | public VarBindingBuilder start( VarBinding binding)
{
varBinding_ =
binding == null
? new VarBinding( "V", IVarDef.ARG, "?")
: binding;
return this;
} | java | public VarBindingBuilder start( VarBinding binding)
{
varBinding_ =
binding == null
? new VarBinding( "V", IVarDef.ARG, "?")
: binding;
return this;
} | [
"public",
"VarBindingBuilder",
"start",
"(",
"VarBinding",
"binding",
")",
"{",
"varBinding_",
"=",
"binding",
"==",
"null",
"?",
"new",
"VarBinding",
"(",
"\"V\"",
",",
"IVarDef",
".",
"ARG",
",",
"\"?\"",
")",
":",
"binding",
";",
"return",
"this",
";",
... | Starts building a new binding. | [
"Starts",
"building",
"a",
"new",
"binding",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java#L72-L80 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java | VarBindingBuilder.has | public VarBindingBuilder has( String name, Object value)
{
varBinding_.setAnnotation( name, Objects.toString( value, null));
return this;
} | java | public VarBindingBuilder has( String name, Object value)
{
varBinding_.setAnnotation( name, Objects.toString( value, null));
return this;
} | [
"public",
"VarBindingBuilder",
"has",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"varBinding_",
".",
"setAnnotation",
"(",
"name",
",",
"Objects",
".",
"toString",
"(",
"value",
",",
"null",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a binding annotation. | [
"Adds",
"a",
"binding",
"annotation",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java#L130-L134 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java | VarBindingBuilder.hasIf | public VarBindingBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | java | public VarBindingBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | [
"public",
"VarBindingBuilder",
"hasIf",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"value",
"!=",
"null",
"?",
"has",
"(",
"name",
",",
"value",
")",
":",
"this",
";",
"}"
] | Adds a binding annotation if the given value is non-null | [
"Adds",
"a",
"binding",
"annotation",
"if",
"the",
"given",
"value",
"is",
"non",
"-",
"null"
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarBindingBuilder.java#L139-L145 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java | VarValueDefBuilder.has | public VarValueDefBuilder has( String name, Object value)
{
varValueDef_.setAnnotation( name, Objects.toString( value, null));
return this;
} | java | public VarValueDefBuilder has( String name, Object value)
{
varValueDef_.setAnnotation( name, Objects.toString( value, null));
return this;
} | [
"public",
"VarValueDefBuilder",
"has",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"varValueDef_",
".",
"setAnnotation",
"(",
"name",
",",
"Objects",
".",
"toString",
"(",
"value",
",",
"null",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a value annotation. | [
"Adds",
"a",
"value",
"annotation",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java#L116-L120 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java | VarValueDefBuilder.hasIf | public VarValueDefBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | java | public VarValueDefBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | [
"public",
"VarValueDefBuilder",
"hasIf",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"value",
"!=",
"null",
"?",
"has",
"(",
"name",
",",
"value",
")",
":",
"this",
";",
"}"
] | Adds a value annotation if the given value is non-null | [
"Adds",
"a",
"value",
"annotation",
"if",
"the",
"given",
"value",
"is",
"non",
"-",
"null"
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java#L125-L131 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java | VarValueDefBuilder.hasIf | public VarValueDefBuilder hasIf( String name, Optional<Object> value)
{
return hasIf( name, value.orElse( null));
} | java | public VarValueDefBuilder hasIf( String name, Optional<Object> value)
{
return hasIf( name, value.orElse( null));
} | [
"public",
"VarValueDefBuilder",
"hasIf",
"(",
"String",
"name",
",",
"Optional",
"<",
"Object",
">",
"value",
")",
"{",
"return",
"hasIf",
"(",
"name",
",",
"value",
".",
"orElse",
"(",
"null",
")",
")",
";",
"}"
] | Adds a value annotation if the given value is defined | [
"Adds",
"a",
"value",
"annotation",
"if",
"the",
"given",
"value",
"is",
"defined"
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java#L136-L139 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java | VarValueDefBuilder.properties | public VarValueDefBuilder properties( Optional<String> property)
{
property.ifPresent( p -> varValueDef_.addProperties( p));
return this;
} | java | public VarValueDefBuilder properties( Optional<String> property)
{
property.ifPresent( p -> varValueDef_.addProperties( p));
return this;
} | [
"public",
"VarValueDefBuilder",
"properties",
"(",
"Optional",
"<",
"String",
">",
"property",
")",
"{",
"property",
".",
"ifPresent",
"(",
"p",
"->",
"varValueDef_",
".",
"addProperties",
"(",
"p",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a value property, if present. | [
"Adds",
"a",
"value",
"property",
"if",
"present",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarValueDefBuilder.java#L162-L166 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSetBuilder.java | VarSetBuilder.has | public VarSetBuilder has( String name, Object value)
{
varSet_.setAnnotation( name, Objects.toString( value, null));
return this;
} | java | public VarSetBuilder has( String name, Object value)
{
varSet_.setAnnotation( name, Objects.toString( value, null));
return this;
} | [
"public",
"VarSetBuilder",
"has",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"varSet_",
".",
"setAnnotation",
"(",
"name",
",",
"Objects",
".",
"toString",
"(",
"value",
",",
"null",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds a variable set annotation. | [
"Adds",
"a",
"variable",
"set",
"annotation",
"."
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSetBuilder.java#L116-L120 | train |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/VarSetBuilder.java | VarSetBuilder.hasIf | public VarSetBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | java | public VarSetBuilder hasIf( String name, Object value)
{
return
value != null
? has( name, value)
: this;
} | [
"public",
"VarSetBuilder",
"hasIf",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"value",
"!=",
"null",
"?",
"has",
"(",
"name",
",",
"value",
")",
":",
"this",
";",
"}"
] | Adds a variable set annotation if the given value is non-null | [
"Adds",
"a",
"variable",
"set",
"annotation",
"if",
"the",
"given",
"value",
"is",
"non",
"-",
"null"
] | 21e15cf107fa149620c40f4bda1829c1224fcfb1 | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/VarSetBuilder.java#L125-L131 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.