svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / impl / DefaultFeatureStoreNotification.java @ 40559
History | View | Annotate | Download (3.61 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.feature.impl; |
25 |
|
26 |
import org.gvsig.fmap.dal.DataSet; |
27 |
import org.gvsig.fmap.dal.DataStore; |
28 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
29 |
import org.gvsig.fmap.dal.feature.Feature; |
30 |
import org.gvsig.fmap.dal.feature.FeatureIndex; |
31 |
import org.gvsig.fmap.dal.feature.FeatureStoreNotification; |
32 |
import org.gvsig.tools.undo.command.Command; |
33 |
|
34 |
public class DefaultFeatureStoreNotification implements |
35 |
FeatureStoreNotification { |
36 |
private Feature feature = null; |
37 |
private DataSet collectionResult = null; |
38 |
private boolean loadCollectionSucefully = false; |
39 |
private Exception exceptionLoading = null; |
40 |
private Command command = null; |
41 |
private EditableFeatureType featureType = null; |
42 |
private String type; |
43 |
private DataStore source;
|
44 |
private FeatureIndex index;
|
45 |
|
46 |
protected void init(DataStore source, String type) { |
47 |
this.source = source;
|
48 |
this.type = type;
|
49 |
} |
50 |
|
51 |
public DefaultFeatureStoreNotification(DataStore source, String type) { |
52 |
this.init(source, type);
|
53 |
} |
54 |
|
55 |
public DefaultFeatureStoreNotification(DataStore source, String type, Feature feature) { |
56 |
this.init(source, type);
|
57 |
this.feature = feature;
|
58 |
} |
59 |
public DefaultFeatureStoreNotification(DataStore source, String type, Command command) { |
60 |
this.init(source, type);
|
61 |
this.command = command;
|
62 |
} |
63 |
|
64 |
public DefaultFeatureStoreNotification(DataStore source, String type, Exception exception) { |
65 |
this.init(source, type);
|
66 |
this.loadCollectionSucefully = false; |
67 |
this.exceptionLoading = exception;
|
68 |
} |
69 |
|
70 |
public DefaultFeatureStoreNotification(DataStore source, String type, DataSet collection) { |
71 |
this.init(source, type);
|
72 |
this.loadCollectionSucefully = true; |
73 |
this.collectionResult = collection;
|
74 |
} |
75 |
|
76 |
|
77 |
public DefaultFeatureStoreNotification(DataStore source, String type, |
78 |
EditableFeatureType featureType) { |
79 |
this.init(source, type);
|
80 |
this.featureType = featureType;
|
81 |
} |
82 |
|
83 |
public DefaultFeatureStoreNotification(DataStore source, String type, |
84 |
FeatureIndex index) { |
85 |
this.init(source, type);
|
86 |
this.index = index;
|
87 |
} |
88 |
|
89 |
public Feature getFeature() {
|
90 |
return feature;
|
91 |
} |
92 |
|
93 |
public EditableFeatureType getFeatureType() {
|
94 |
return featureType;
|
95 |
} |
96 |
|
97 |
public DataSet getCollectionResult() {
|
98 |
return this.collectionResult; |
99 |
} |
100 |
|
101 |
public Exception getExceptionLoading() { |
102 |
return this.exceptionLoading; |
103 |
} |
104 |
|
105 |
public boolean loadSucefully() { |
106 |
return this.loadCollectionSucefully; |
107 |
} |
108 |
|
109 |
public Command getCommand() {
|
110 |
return this.command; |
111 |
} |
112 |
|
113 |
public DataStore getSource() {
|
114 |
return source;
|
115 |
} |
116 |
|
117 |
public String getType() { |
118 |
return type;
|
119 |
} |
120 |
|
121 |
public FeatureIndex getIndex() {
|
122 |
return index;
|
123 |
} |
124 |
} |