2 * This file is part of NeverNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\r
8 * Software distributed under the License is distributed
\r
9 * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
\r
10 * express or implied. See the GPL for the specific language
\r
11 * governing rights and limitations.
\r
13 * You should have received a copy of the GPL along with this
\r
14 * program. If not, go to http://www.gnu.org/licenses/gpl.html
\r
15 * or write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
20 package cx.fbn.nevernote.gui;
\r
22 import java.util.ArrayList;
\r
23 import com.evernote.edam.type.Note;
\r
24 import cx.fbn.nevernote.filters.DateAttributeFilter;
\r
25 import cx.fbn.nevernote.filters.DateAttributeFilterFactory;
\r
27 public class DateAttributeFilterTable {
\r
28 ArrayList<DateAttributeFilter> table;
\r
29 public DateAttributeFilterTable(boolean since, boolean created) {
\r
30 table = new ArrayList<DateAttributeFilter>();
\r
31 for (DateAttributeFilterFactory.FilterType type: DateAttributeFilterFactory.FilterType.values()) {
\r
32 table.add(DateAttributeFilterFactory.getFilter(type,since,created));
\r
36 public void reset() {
\r
37 for (int i=0; i<table.size(); i++)
\r
38 table.get(i).set(false);
\r
41 public void select(int i) {
\r
42 table.get(i).set(true);
\r
45 public boolean hasSelection() {
\r
46 for (int i=0; i<table.size(); i++) {
\r
47 if (table.get(i).isSet())
\r
53 public int size() {
\r
54 return table.size();
\r
57 public boolean check(Note n) {
\r
58 for (int i=0; i<table.size(); i++) {
\r
59 if (table.get(i).isSet()
\r
60 && !table.get(i).attributeCheck(n))
\r
66 // Get the name of a particular attribute check
\r
67 public String getLabel(int i) {
\r
68 return table.get(i).getLabel();
\r