More contracts on LazyGenotypesContext
This commit is contained in:
parent
2e9ecf639e
commit
e467b8e1ae
|
|
@ -604,7 +604,7 @@ public class GenotypesContext implements List<Genotype> {
|
|||
}
|
||||
}
|
||||
|
||||
private final static boolean sameSamples(List<Genotype> genotypes, Collection<String> sampleNamesInOrder) {
|
||||
protected final static boolean sameSamples(List<Genotype> genotypes, Collection<String> sampleNamesInOrder) {
|
||||
Set<String> names = new HashSet<String>(sampleNamesInOrder);
|
||||
if ( names.size() != sampleNamesInOrder.size() )
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ public class LazyGenotypesContext extends GenotypesContext {
|
|||
* to the LazyGenotypesContext holding encoded genotypes data
|
||||
*/
|
||||
public interface LazyParser {
|
||||
@Requires("data != null")
|
||||
@Ensures("result != null")
|
||||
public LazyData parse(Object data);
|
||||
}
|
||||
|
||||
|
|
@ -78,6 +80,9 @@ public class LazyGenotypesContext extends GenotypesContext {
|
|||
final Map<String, Integer> sampleNameToOffset;
|
||||
final List<String> sampleNamesInOrder;
|
||||
|
||||
@Requires({"genotypes != null", "sampleNamesInOrder != null", "sampleNameToOffset != null",
|
||||
"sameSamples(genotypes, sampleNamesInOrder)",
|
||||
"sameSamples(genotypes, sampleNameToOffset.keySet())"})
|
||||
public LazyData(final ArrayList<Genotype> genotypes,
|
||||
final List<String> sampleNamesInOrder,
|
||||
final Map<String, Integer> sampleNameToOffset) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue