01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.databinding.datagrid.api.filter;
20:
21: /**
22: * <p>
23: * A filter operation is an abstract representation of an operation that can be performed when filtering a data set.
24: * The operations that can be performed are not provided here; rather subclasses and external utilities can create
25: * FilterOperation instances that map to concrete operations for query languages like XQuery or SQL. The
26: * process for performing this mapping is left to filtering utilities.
27: * </p>
28: */
29: public class FilterOperation implements java.io.Serializable {
30:
31: private int _id;
32: private String _abbreviation;
33: private String _resourceKey;
34: private FilterOperationHint _operationHint;
35:
36: /**
37: * Construct a FilterOperation given a set of metadata about the filter.
38: * @param id the operation identifier
39: * @param abbreviation the abbreviation for the filter
40: * @param resourceKey a resource key used to lookup a readable String for a filter operation
41: * @param operationHint a hint for the operation that classifies the operation into a language independent
42: * operation category.
43: */
44: public FilterOperation(int id, String abbreviation,
45: String resourceKey, FilterOperationHint operationHint) {
46: _id = id;
47: _abbreviation = abbreviation;
48: _operationHint = operationHint;
49: _resourceKey = resourceKey;
50: }
51:
52: /**
53: * Get the filter operation's id.
54: * @return the id
55: */
56: public int getId() {
57: return _id;
58: }
59:
60: /**
61: * Get the filter operation's abbreviation
62: * @return the abbreviation
63: */
64: public String getAbbreviation() {
65: return _abbreviation;
66: }
67:
68: /**
69: * Get the filter operation's resource key. Discoverying the readable text for an operation is left
70: * to the client or other filtering utilities.
71: * @return the resource key
72: */
73: public String getResourceKey() {
74: return _resourceKey;
75: }
76:
77: /**
78: * Get the filter operation's {@link FilterOperationHint}.
79: * @return the operation hint
80: */
81: public FilterOperationHint getOperationHint() {
82: return _operationHint;
83: }
84: }
|