Package org.molgenis.vibe.core.formats
Class PhenotypeNetwork
- java.lang.Object
-
- org.molgenis.vibe.core.formats.PhenotypeNetwork
-
public class PhenotypeNetwork extends Object
-
-
Constructor Summary
Constructors Constructor Description PhenotypeNetwork(Phenotype phenotype)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Collection<Phenotype> phenotypes, int distance)booleanadd(Phenotype phenotype, int distance)Adds aPhenotypeto thePhenotypeNetwork.booleancontains(Phenotype phenotype)booleanequals(Object o)Set<Phenotype>getByDistance(int distance)intgetDistance(Phenotype phenotype)Retrieve the storeddistancebelonging to aPhenotypeSet<Integer>getDistances()Set<Phenotype>getPhenotypes()PhenotypegetSource()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
PhenotypeNetwork
public PhenotypeNetwork(Phenotype phenotype)
-
-
Method Detail
-
getSource
public Phenotype getSource()
- Returns:
- the source phenotype (the only
Phenotypewithdistance0)
-
getDistances
public Set<Integer> getDistances()
- Returns:
- all
distancesfor whichPhenotypesare stored.
-
getDistance
public int getDistance(Phenotype phenotype)
Retrieve the storeddistancebelonging to aPhenotype- Parameters:
phenotype- thePhenotypeto retrieve thedistancefrom- Returns:
- the
distancebelonging to thephenotype
-
add
public void add(Collection<Phenotype> phenotypes, int distance)
-
add
public boolean add(Phenotype phenotype, int distance)
Adds aPhenotypeto thePhenotypeNetwork. If thePhenotypeis already stored, compares the newdistanceto the currently stored one. If the already stored distance is closer or equal, nothing is done. Otherwise, the olddistanceis replaced with the new one. If thePhenotypeis not stored yet, it is simply added.
-
contains
public boolean contains(Phenotype phenotype)
-
-