public class Pattern extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<MappedConst> |
constraints
List of mapped constraints.
|
protected Map<String,Integer> |
labelMap
Indexes in a pattern can be labeled using this map.
|
protected int |
lastIndex
How many elements are there in a pattern match.
|
protected Class<? extends BioPAXElement> |
startingClass
Class of the first elements to match with this pattern.
|
| Constructor and Description |
|---|
Pattern(Class<? extends BioPAXElement> startingClass,
Constraint firstConstraint,
String... label)
Constructor with the first constraint and labels it uses.
|
Pattern(Class<? extends BioPAXElement> startingClass,
String label)
Constructor with a label for the element at index 0.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Constraint constr,
String... label)
Creates a mapped constraint with the given generative constraint and the indexes it applies.
|
void |
add(Pattern p)
Appends the constraints in the parameter pattern to the desired location.
|
List<MappedConst> |
getConstraints()
Getter for the constraint list.
|
Class<? extends BioPAXElement> |
getStartingClass()
Gets the type of the initial element.
|
boolean |
hasLabel(int index)
Checks if the given location has a label.
|
boolean |
hasLabel(String labelText)
Checks if the label is already in use.
|
int |
indexOf(String labelText)
Gets the index of the given label.
|
void |
insertPointConstraint(Constraint con,
int... ind)
A point constraint deals with only one element in a match, checks its validity.
|
void |
label(String labelText,
int index)
Puts the given label for the given index.
|
void |
optimizeConstraintOrder() |
void |
removeLastConstraint()
Removes the last constraint added to the pattern.
|
int |
size()
Gets the element size of the pattern.
|
void |
updateLabel(String oldLabel,
String newLabel)
Changes a label.
|
protected int lastIndex
protected Class<? extends BioPAXElement> startingClass
protected List<MappedConst> constraints
public Pattern(Class<? extends BioPAXElement> startingClass, Constraint firstConstraint, String... label)
startingClass - type of initial elementfirstConstraint - first constraintlabel - labels for the constraintpublic Pattern(Class<? extends BioPAXElement> startingClass, String label)
startingClass - type of the initial elementlabel - a label for the initial elementpublic void removeLastConstraint()
public void optimizeConstraintOrder()
public void add(Constraint constr, String... label)
constr - constraint to addlabel - a label for the last of the given indicespublic void add(Pattern p)
p - the parameter patternpublic void insertPointConstraint(Constraint con, int... ind)
con - constraint to addind - indices to add this point constraintpublic List<MappedConst> getConstraints()
public int size()
public Class<? extends BioPAXElement> getStartingClass()
public void label(String labelText, int index)
labelText - the labelindex - index to labelpublic boolean hasLabel(String labelText)
labelText - label to checkpublic boolean hasLabel(int index)
index - index to checkpublic int indexOf(String labelText)
labelText - label to checkCopyright © 2015 BioPAX. All rights reserved.