0
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package com.nokia.s60tools.appdep.search;
|
|
19 |
|
|
20 |
/**
|
|
21 |
* Class for search match type
|
|
22 |
*/
|
|
23 |
public class MatchType {
|
|
24 |
|
|
25 |
/**
|
|
26 |
* <code>true</code> in case of case sensitive search.
|
|
27 |
*/
|
|
28 |
private boolean isCaseSensitiveSearch = false;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Match type used for the search.
|
|
32 |
*/
|
|
33 |
private MatchTypes matchType;
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Constructor.
|
|
37 |
* @param matchType Match type used for the search.
|
|
38 |
*/
|
|
39 |
public MatchType(MatchTypes matchType){
|
|
40 |
this.matchType = matchType;
|
|
41 |
}
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Match types selectable in search Options
|
|
45 |
*/
|
|
46 |
public enum MatchTypes{
|
|
47 |
CONTAINS, // Matches when the search string is contained in object's name
|
|
48 |
STARTS_WITH, // Matches when object's name starts with the search string
|
|
49 |
ENDS_WITH, // Matches when object's name ends with the search string
|
|
50 |
EXACT_MATCH, // Matches when object's name and the search string equals
|
|
51 |
REGULAR_EXPRESSION, // Matches when the search string as regular expression matches with object's name
|
|
52 |
}
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Gets case sensitive check status.
|
|
56 |
* @return <code>true</code> in case of case sensitive search, otherwise <code>false</code>.
|
|
57 |
*/
|
|
58 |
public boolean isCaseSensitiveSearch() {
|
|
59 |
return isCaseSensitiveSearch;
|
|
60 |
}
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Sets case sensitiveness for the search.
|
|
64 |
* @param isCaseSensitiveSearch the isCaseSensitiveSearch to set
|
|
65 |
*/
|
|
66 |
public void setCaseSensitiveSearch(boolean isCaseSensitiveSearch) {
|
|
67 |
this.isCaseSensitiveSearch = isCaseSensitiveSearch;
|
|
68 |
}
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Gets match type.
|
|
72 |
* @return the matchType
|
|
73 |
*/
|
|
74 |
public MatchTypes getMatchType() {
|
|
75 |
return matchType;
|
|
76 |
}
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Sets match type.
|
|
80 |
* @param matchType the matchType to set
|
|
81 |
*/
|
|
82 |
public void setMatchType(MatchTypes matchType) {
|
|
83 |
this.matchType = matchType;
|
|
84 |
}
|
|
85 |
|
|
86 |
}
|