Package org.biopax.paxtools.pattern
Class Match
java.lang.Object
org.biopax.paxtools.pattern.Match
- All Implemented Interfaces:
Cloneable
A pattern match is an array of biopax elements that satisfies the list of mapped constraints in a
pattern.
- Author:
- Ozgun Babur
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones a match.get(int index) Gets element at the index.Gets elements corresponding to the given labels in the pattern.Gets element corresponding to the given label in the pattern.getAName(BioPAXElement ele) Finds a name for the variable.getFirst()Gets first element of the matchgetLast()Gets last element of the match.Getter for the element array.voidset(BioPAXElement ele, int index) Sets the given element to the given index.toString()Gets name of variables.intvarSize()Gets the array size.booleanvarsPresent(int... ind) Checks if all given indices are assigned.
-
Constructor Details
-
Match
public Match(int size) Constructor with size.- Parameters:
size- array size
-
-
Method Details
-
getVariables
Getter for the element array.- Returns:
- element array
-
get
Gets element at the index.- Parameters:
index- index of the element to get- Returns:
- element at the index
-
get
Gets element corresponding to the given label in the pattern.- Parameters:
label- label of the element in the patternp- related pattern- Returns:
- element of the given label
- Throws:
IllegalArgumentException- if the label not in the pattern
-
get
Gets elements corresponding to the given labels in the pattern.- Parameters:
label- labels of the element in the patternp- related pattern- Returns:
- elements of the given label
- Throws:
IllegalArgumentException- if one of the labels not in the pattern
-
getFirst
Gets first element of the match- Returns:
- first element
-
getLast
Gets last element of the match.- Returns:
- last element
-
varSize
public int varSize()Gets the array size.- Returns:
- array size
-
set
Sets the given element to the given index.- Parameters:
ele- element to setindex- 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
Clones a match. -
toString
Gets name of variables. -
getAName
Finds a name for the variable.- Parameters:
ele- element to check- Returns:
- a name
-