Source Code Cross Referenced for ContentState.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » store » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.data.store 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2006, GeoTools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.data.store;
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:
021:        import org.geotools.data.FeatureListener;
022:        import org.geotools.feature.FeatureType;
023:
024:        import com.vividsolutions.jts.geom.Envelope;
025:
026:        /**
027:         * State for a content entry.
028:         * <p>
029:         * This class maintains a cache of certain aspects of a feature type which are
030:         * subject to the state of a dataset modified in a transaction. Examples of 
031:         * such content:
032:         * <ul>
033:         * <li>
034:         * <li>Type FeatureType (per FeatureTypeFactory )
035:         * <li>key: "bounds"; value: Envelope of dataset
036:         * <li>key: "count"; value: Number of features in dataset
037:         * </ul>
038:         * </p>
039:         * 
040:         * @author Jody Garnett, Refractions Research Inc.
041:         * @author Justin Deoliveira, The Open Planning Project
042:         */
043:        public class ContentState {
044:
045:            /**
046:             * cached feature type
047:             */
048:            protected FeatureType memberType;
049:            /**
050:             * cached feature collection type
051:             */
052:            protected FeatureType collectionType;
053:            /**
054:             * cached number of features
055:             */
056:            protected int count = -1;
057:            /**
058:             * cached bounds of features
059:             */
060:            protected Envelope bounds;
061:
062:            /**
063:             * entry maintaining the state
064:             */
065:            protected ContentEntry entry;
066:
067:            /**
068:             * observers
069:             */
070:            private List listeners = new ArrayList(2);
071:
072:            /**
073:             * Creates a new state.
074:             *
075:             * @param entry The entry for the state.
076:             */
077:            public ContentState(ContentEntry entry) {
078:                this .entry = entry;
079:                this .listeners = new ArrayList(2);
080:            }
081:
082:            protected ContentState(ContentState state) {
083:                this (state.getEntry());
084:
085:                memberType = state.memberType;
086:                collectionType = state.collectionType;
087:                count = state.count;
088:                bounds = state.bounds == null ? null : new Envelope(
089:                        state.bounds);
090:            }
091:
092:            public FeatureType getMemberType() {
093:                return memberType;
094:            }
095:
096:            public void setMemberType(FeatureType memberType) {
097:                this .memberType = memberType;
098:            }
099:
100:            public FeatureType getCollectionType() {
101:                return collectionType;
102:            }
103:
104:            public void setCollectionType(FeatureType featureType) {
105:                collectionType = featureType;
106:            }
107:
108:            public int getCount() {
109:                return count;
110:            }
111:
112:            public void setCount(int count) {
113:                this .count = count;
114:            }
115:
116:            public Envelope getBounds() {
117:                return bounds;
118:            }
119:
120:            public void setBounds(Envelope bounds) {
121:                this .bounds = bounds;
122:            }
123:
124:            /**
125:             * Flushes the cache.
126:             */
127:            public void flush() {
128:                memberType = null;
129:                collectionType = null;
130:                count = -1;
131:                bounds = null;
132:            }
133:
134:            /**
135:             * Access to content entry (containing content definition )
136:             */
137:            public ContentEntry getEntry() {
138:                return entry;
139:            }
140:
141:            /**
142:             * Cleans up the state object by clearing cache and listeners.
143:             */
144:            public void close() {
145:                memberType = null;
146:                collectionType = null;
147:                if (listeners != null) {
148:                    listeners.clear();
149:                    listeners = null;
150:                }
151:            }
152:
153:            /**
154:             * Adds a listener for collection events.
155:             *
156:             * @param listener The listener to add
157:             */
158:            public void addListener(FeatureListener listener) {
159:                listeners.add(listener);
160:            }
161:
162:            /**
163:             * Removes a listener for collection events.
164:             *
165:             * @param listener The listener to remove
166:             */
167:            public void removeListener(FeatureListener listener) {
168:                listeners.remove(listener);
169:            }
170:
171:            /**
172:             * Copies the state.
173:             *
174:             * @return A copy of the state.
175:             */
176:            public ContentState copy() {
177:                return new ContentState(this);
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.