4A Server -
2.0
Main Page
Packages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Enumerator
MatcherWrapper.java
Go to the documentation of this file.
1
/*
2
* Project: Server for annotations sharing
3
* Subproject: Position of fragment of text in XML document
4
* Authors: Peter Bartoš, Michael Angelov
5
* File: MatcherWrapper.java
6
* Description: Wrapper class for matcher
7
*/
8
9
/**
10
* @file MatcherWrapper.java
11
*
12
* @brief Wrapper class for matcher
13
*/
14
15
package
cz.vutbr.fit.knot.annotations.fragmentUpdater;
16
17
/**
18
* Wrapper class for matcher
19
*
20
* @brief Wrapper class for matcher
21
* @author Peter Bartoš, Michael Angelov
22
*/
23
public
class
MatcherWrapper
implements
Comparable {
24
25
public
Matcher
matcher
;
26
private
int
priority
;
27
28
/**
29
* Constructor
30
*
31
* @param matcher matcher
32
* @param priority priority of matcher
33
*/
34
public
MatcherWrapper
(
Matcher
matcher
,
int
priority
) {
35
this.matcher =
matcher
;
36
this.priority =
priority
;
37
}
38
39
/**
40
* Setter for priority
41
*
42
* @param priority priority of matcher
43
*/
44
public
void
setPriority
(
int
priority
) {
45
this.priority =
priority
;
46
}
47
48
49
/**
50
* Getter for priority
51
*
52
* @return priority of matcher
53
*/
54
public
int
getPriority
() {
55
return
priority
;
56
}
57
58
59
/**
60
* Implemented comparedTo() method
61
*
62
* @param o distant object
63
* @return {0, 1, -1} according to matchers priority
64
*/
65
public
int
compareTo
(Object o) {
66
MatcherWrapper
mw = (
MatcherWrapper
) o;
67
if
(mw.
priority
>
priority
) {
68
return
-1;
69
}
else
if
(mw.
priority
<
priority
) {
70
return
1;
71
}
else
{
72
return
0;
73
}
74
}
75
76
/**
77
* Overriden toString() method
78
*
79
* @return string representation of class
80
*/
81
@Override
82
public
String
toString
() {
83
return
priority
+
"-"
+
matcher
;
84
}
85
}
// class MatcherWrapper
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.compareTo
int compareTo(Object o)
Definition:
MatcherWrapper.java:65
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.MatcherWrapper
MatcherWrapper(Matcher matcher, int priority)
Definition:
MatcherWrapper.java:34
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.setPriority
void setPriority(int priority)
Definition:
MatcherWrapper.java:44
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.getPriority
int getPriority()
Definition:
MatcherWrapper.java:54
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.toString
String toString()
Definition:
MatcherWrapper.java:82
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.priority
int priority
Definition:
MatcherWrapper.java:26
cz.vutbr.fit.knot.annotations.fragmentUpdater.Matcher
Class for matcher consisting of comparator and node iterator.
Definition:
Matcher.java:32
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper
Wrapper class for matcher.
Definition:
MatcherWrapper.java:23
cz.vutbr.fit.knot.annotations.fragmentUpdater.MatcherWrapper.matcher
Matcher matcher
Definition:
MatcherWrapper.java:25
src
java
cz
vutbr
fit
knot
annotations
fragmentUpdater
MatcherWrapper.java
Generated on Wed Aug 24 2016 14:10:34 for 4A Server - by
1.8.6