Class MappedConst

java.lang.Object
org.biopax.paxtools.pattern.MappedConst
All Implemented Interfaces:
Constraint

public class MappedConst extends Object implements Constraint
This is a mapping from a constraint to the elements in a match.
Author:
Ozgun Babur
  • Constructor Details

    • MappedConst

      public MappedConst(Constraint constr, int... inds)
      Constructor with the constraint and the index mapping.
      Parameters:
      constr - constraint to map
      inds - mapped indexes
  • Method Details

    • getConstr

      public Constraint getConstr()
      Getter for the constraint.
      Returns:
      the wrapped constraint
    • getInds

      public int[] getInds()
      Getter for the mapped indices.
      Returns:
      mapped indices
    • getMaxInd

      public int getMaxInd()
      Gets the maximum index.
      Returns:
      maximum index
    • translate

      protected int[] translate(int[] outer)
      This methods translates the indexes of outer constraint, to this inner constraint.
      Parameters:
      outer - mapped indices for the outer constraints
      Returns:
      translated indices
    • canGenerate

      public boolean canGenerate()
      Can generate only if the wrapped constraint is generative.
      Specified by:
      canGenerate in interface Constraint
      Returns:
      if the wrapped constraint is generative
    • generate

      public Collection<BioPAXElement> generate(Match match, int... outer)
      Calls generate method of the constraint with index translation.
      Specified by:
      generate in interface Constraint
      Parameters:
      match - current pattern match
      outer - untranslated indices
      Returns:
      generated satisfying elements
    • satisfies

      public boolean satisfies(Match match, int... outer)
      Directs to satisfies method of the wrapped constraint with index translation.
      Specified by:
      satisfies in interface Constraint
      Parameters:
      match - current pattern match
      outer - untranslated indices
      Returns:
      true if the constraint is satisfied
    • getVariableSize

      public int getVariableSize()
      Gets variable size of the wrapped constraint.
      Specified by:
      getVariableSize in interface Constraint
      Returns:
      variable size of the wrapped constraint