2
Copyright 2008-2010 Gephi
3
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
4
Website : http://www.gephi.org
6
This file is part of Gephi.
8
Gephi is free software: you can redistribute it and/or modify
9
it under the terms of the GNU Affero General Public License as
10
published by the Free Software Foundation, either version 3 of the
11
License, or (at your option) any later version.
13
Gephi is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU Affero General Public License for more details.
18
You should have received a copy of the GNU Affero General Public License
19
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
21
package org.gephi.filters;
23
import org.gephi.filters.spi.Filter;
24
import org.gephi.filters.spi.FilterProperty;
28
* @author Mathieu Bastian
30
public class FilterQueryImpl extends AbstractQueryImpl {
32
private Parameters[] parameters;
33
private Filter filter;
36
public FilterQueryImpl(Filter filter) {
38
this.name = filter.getName();
42
public final void updateParameters() {
43
FilterProperty[] properties = filter.getProperties();
44
parameters = new Parameters[properties == null ? 0 : properties.length];
45
if (properties != null) {
46
for (int i = 0; i < properties.length; i++) {
47
parameters[i] = new Parameters(i, properties[i].getValue());
53
public int getChildrenSlotsCount() {
58
public String getName() {
63
public void setName(String name) {
67
public int getPropertiesCount() {
68
return parameters.length;
71
public String getPropertyName(int index) {
72
return parameters[index].getKey();
75
public Object getPropertyValue(int index) {
76
return parameters[index].getValue();
79
public Filter getFilter() {
83
private class Parameters {
88
public Parameters(int index, Object value) {
93
public String getKey() {
94
return filter.getProperties()[index].getName();
97
public Object getValue() {