Class PhenotypeNetwork


  • public class PhenotypeNetwork
    extends Object
    A network of Phenotypes with a single source Phenotype from which the network is created.
    • Constructor Detail

      • PhenotypeNetwork

        public PhenotypeNetwork​(Phenotype phenotype)
    • Method Detail

      • getSource

        public Phenotype getSource()
        Returns:
        the source phenotype (the only Phenotype with distance 0)
      • getDistances

        public Set<Integer> getDistances()
        Returns:
        all distances for which Phenotypes are stored.
      • getByDistance

        public Set<Phenotype> getByDistance​(int distance)
        Retrieves all Phenotypes that have the specified distance
        Parameters:
        distance - value to be used for Phenotype retrieval
        Returns:
        all Phenotypes with the given distance
      • getDistance

        public int getDistance​(Phenotype phenotype)
        Retrieve the stored distance belonging to a Phenotype
        Parameters:
        phenotype - the Phenotype to retrieve the distance from
        Returns:
        the distance belonging to the phenotype
      • add

        public boolean add​(Phenotype phenotype,
                           int distance)
        Adds a Phenotype to the PhenotypeNetwork. If the Phenotype is already stored, compares the new distance to the currently stored one. If the already stored distance is closer or equal, nothing is done. Otherwise, the old distance is replaced with the new one. If the Phenotype is not stored yet, it is simply added.
        Parameters:
        phenotype - the Phenotype to be added to the network
        distance - the distance the Phenotype is from the source
        Returns:
        true if added/distance is updated, otherwise false
      • contains

        public boolean contains​(Phenotype phenotype)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object