-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathPattern.java
More file actions
39 lines (34 loc) · 934 Bytes
/
Pattern.java
File metadata and controls
39 lines (34 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.variantsync.diffdetective.editclass;
/**
* Abstract class for edit patterns.
* A pattern has a unique name and may be matched on domain elements of a given type.
* @param <E> Type of elements on which the pattern may be matched.
* @author Sören Viegener, Paul Bittner
*/
public abstract class Pattern<E> {
/**
* The name that uniquely identifies this pattern.
*/
protected final String name;
/**
* Create a new pattern with the given name.
* @param name Unique identifier.
*/
public Pattern(final String name) {
this.name = name;
}
/**
* Returns true iff the given domain element matches this pattern.
*/
public abstract boolean matches(E e);
/**
* Returns the name of this pattern.
*/
public String getName(){
return this.name;
}
@Override
public String toString() {
return getName();
}
}