1 |
/* |
2 |
* jlscp - a java LinuxSampler control protocol API |
3 |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
6 |
* This file is part of jlscp. |
7 |
* |
8 |
* jlscp is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License version 2 |
10 |
* as published by the Free Software Foundation. |
11 |
* |
12 |
* jlscp is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with jlscp; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
* MA 02111-1307 USA |
21 |
*/ |
22 |
|
23 |
package org.linuxsampler.lscp; |
24 |
|
25 |
import java.text.DateFormat; |
26 |
import java.text.SimpleDateFormat; |
27 |
|
28 |
import java.util.Date; |
29 |
import java.util.Vector; |
30 |
|
31 |
/** |
32 |
* This class represents a query containg the search criterias |
33 |
* for the instruments to obtain. |
34 |
* @author Grigor Iliev |
35 |
*/ |
36 |
public class DbSearchQuery { |
37 |
private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
38 |
|
39 |
public String name = null; |
40 |
public Vector<String> formatFamilies = new Vector<String>(); |
41 |
public long minSize = -1; |
42 |
public long maxSize = -1; |
43 |
public Date createdBefore = null; |
44 |
public Date createdAfter = null; |
45 |
public Date modifiedBefore = null; |
46 |
public Date modifiedAfter = null; |
47 |
public String description = null; |
48 |
public String product = null; |
49 |
public String artists = null; |
50 |
public String keywords = null; |
51 |
public InstrumentType instrumentType = InstrumentType.BOTH; |
52 |
|
53 |
public enum InstrumentType { |
54 |
CHROMATIC, |
55 |
DRUM, |
56 |
BOTH |
57 |
} |
58 |
|
59 |
|
60 |
/** Creates a new instance of <code>DbSearchQuery</code> */ |
61 |
public |
62 |
DbSearchQuery() { |
63 |
|
64 |
} |
65 |
|
66 |
public String |
67 |
getCreatedBefore() { |
68 |
if(createdBefore == null) return null; |
69 |
return dateFormat.format(createdBefore); |
70 |
} |
71 |
|
72 |
public String |
73 |
getCreatedAfter() { |
74 |
if(createdAfter == null) return null; |
75 |
return dateFormat.format(createdAfter); |
76 |
} |
77 |
|
78 |
public String |
79 |
getModifiedBefore() { |
80 |
if(modifiedBefore == null) return null; |
81 |
return dateFormat.format(modifiedBefore); |
82 |
} |
83 |
|
84 |
public String |
85 |
getModifiedAfter() { |
86 |
if(modifiedAfter == null) return null; |
87 |
return dateFormat.format(modifiedAfter); |
88 |
} |
89 |
} |