2 * This file is part of NixNote
\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
24 import com.evernote.edam.type.Note;
\r
26 import cx.fbn.nevernote.filters.DateAttributeFilter;
\r
27 import cx.fbn.nevernote.filters.DateAttributeFilterFactory;
\r
29 public class DateAttributeFilterTable {
\r
30 ArrayList<DateAttributeFilter> table;
\r
31 public DateAttributeFilterTable(boolean since, boolean created) {
\r
32 table = new ArrayList<DateAttributeFilter>();
\r
33 for (DateAttributeFilterFactory.FilterType type: DateAttributeFilterFactory.FilterType.values()) {
\r
34 table.add(DateAttributeFilterFactory.getFilter(type,since,created));
\r
38 public void reset() {
\r
39 for (int i=0; i<table.size(); i++)
\r
40 table.get(i).set(false);
\r
43 public void select(int i) {
\r
44 table.get(i).set(true);
\r
47 public boolean hasSelection() {
\r
48 for (int i=0; i<table.size(); i++) {
\r
49 if (table.get(i).isSet())
\r
55 public int size() {
\r
56 return table.size();
\r
59 public boolean check(Note n) {
\r
60 for (int i=0; i<table.size(); i++) {
\r
61 if (table.get(i).isSet()
\r
62 && !table.get(i).attributeCheck(n))
\r
68 // Get the name of a particular attribute check
\r
69 public String getLabel(int i) {
\r
70 return table.get(i).getLabel();
\r