Class Match

java.lang.Object
org.biopax.paxtools.pattern.Match
All Implemented Interfaces:
Cloneable

public class Match extends Object implements Cloneable
A pattern match is an array of biopax elements that satisfies the list of mapped constraints in a pattern.
Author:
Ozgun Babur
  • Constructor Details

    • Match

      public Match(int size)
      Constructor with size.
      Parameters:
      size - array size
  • Method Details

    • getVariables

      public BioPAXElement[] getVariables()
      Getter for the element array.
      Returns:
      element array
    • get

      public BioPAXElement get(int index)
      Gets element at the index.
      Parameters:
      index - index of the element to get
      Returns:
      element at the index
    • get

      public BioPAXElement get(String label, Pattern p)
      Gets element corresponding to the given label in the pattern.
      Parameters:
      label - label of the element in the pattern
      p - related pattern
      Returns:
      element of the given label
      Throws:
      IllegalArgumentException - if the label not in the pattern
    • get

      public List<BioPAXElement> get(String[] label, Pattern p)
      Gets elements corresponding to the given labels in the pattern.
      Parameters:
      label - labels of the element in the pattern
      p - related pattern
      Returns:
      elements of the given label
      Throws:
      IllegalArgumentException - if one of the labels not in the pattern
    • getFirst

      public BioPAXElement getFirst()
      Gets first element of the match
      Returns:
      first element
    • getLast

      public BioPAXElement getLast()
      Gets last element of the match.
      Returns:
      last element
    • varSize

      public int varSize()
      Gets the array size.
      Returns:
      array size
    • set

      public void set(BioPAXElement ele, int index)
      Sets the given element to the given index.
      Parameters:
      ele - element to set
      index - index to set
    • varsPresent

      public boolean varsPresent(int... ind)
      Checks if all given indices are assigned.
      Parameters:
      ind - indices to check
      Returns:
      true if none of them are null
    • clone

      public Object clone()
      Clones a match.
      Overrides:
      clone in class Object
      Returns:
      clone of the match
    • toString

      public String toString()
      Gets name of variables.
      Overrides:
      toString in class Object
      Returns:
      names of variables
    • getAName

      public String getAName(BioPAXElement ele)
      Finds a name for the variable.
      Parameters:
      ele - element to check
      Returns:
      a name