Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5827 amar.kumar 1
/*
2
 *	Copyright 2005 stat4j.org
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *	You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
17
 package net.sourceforge.stat4j.filter;
18
 
19
import java.util.ArrayList;
20
import java.util.regex.Matcher;
21
import java.util.regex.Pattern;
22
 
23
/**
24
 * Name:		FilterStatisticMap.java
25
 * Date:		Sep 2, 2004
26
 * Description:
27
 * 
28
 * 
29
 * @author Lara D'Abreo
30
 */
31
public class FilterStatisticMap {
32
 
33
	public Pattern 	pattern;
34
	public ArrayList firsts;
35
	public ArrayList seconds;
36
 
37
	public FilterStatisticMap(String regexp) {
38
		this.pattern = Pattern.compile(regexp);
39
		this.firsts = new ArrayList();
40
		this.seconds = new ArrayList();
41
	}
42
 
43
	public boolean isMatch(String str) {
44
		Matcher m = pattern.matcher(str);
45
		return m.matches();
46
	}
47
 
48
 
49
	/**
50
	 * @return
51
	 */
52
	public ArrayList getFirsts() {
53
		return firsts;
54
	}
55
 
56
	/**
57
	 * @return
58
	 */
59
	public Pattern getPattern() {
60
		return pattern;
61
	}
62
 
63
	/**
64
	 * @return
65
	 */
66
	public ArrayList getSeconds() {
67
		return seconds;
68
	}
69
 
70
};