Source Code Cross Referenced for OrdinateList.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » oracle » sdo » 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.oracle.sdo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2003-2006, Geotools Project Managment Committee (PMC)
005:         *    (C) 2003  Refractions Research Inc.
006:         *    
007:         *    This library is free software; you can redistribute it and/or
008:         *    modify it under the terms of the GNU Lesser General Public
009:         *    License as published by the Free Software Foundation; either
010:         *    version 2.1 of the License, or (at your option) any later version.
011:         *
012:         *    This library is distributed in the hope that it will be useful,
013:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *    Lesser General Public License for more details.
016:         *
017:         *    Refractions Research Inc. Can be found on the web at:
018:         *    http://www.refractions.net/
019:         */
020:        package org.geotools.data.oracle.sdo;
021:
022:        import java.util.AbstractList;
023:
024:        /**
025:         * Used to provide a List API of an ordinate array. 
026:         * <p>
027:         * Insertions are not supported</p>
028:         * 
029:         * @see net.refractions.jspatial.jts
030:         * @author jgarnett, Refractions Reasearch Inc.
031:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/oracle-spatial/src/main/java/org/geotools/data/oracle/sdo/OrdinateList.java $
032:         * @version CVS Version
033:         */
034:        public class OrdinateList extends AbstractList {
035:            final double ARRAY[];
036:            final int OFFSET;
037:            final int LEN; // number of things in stuff
038:            final int SIZE; // number of "elements"
039:            final int START;
040:            final int END;
041:            final int STEP;
042:
043:            public OrdinateList(double array[]) {
044:                this (array, 0, 1);
045:            }
046:
047:            public OrdinateList(double array[], int offset, int len) {
048:                this (array, offset, len, 0, array.length);
049:            }
050:
051:            public OrdinateList(double array[], int offset, int len, int start,
052:                    int end) {
053:                START = start;
054:                END = end;
055:                ARRAY = array;
056:                OFFSET = offset;
057:                LEN = len;
058:                SIZE = Math.abs(START - END) / LEN;
059:                STEP = START < END ? LEN : -LEN;
060:
061:                if (ARRAY.length % LEN != 0) {
062:                    throw new IllegalArgumentException(
063:                            "You have requested Coordiantes of "
064:                                    + LEN
065:                                    + " ordinates. "
066:                                    + "This is inconsistent with an array of length "
067:                                    + ARRAY.length);
068:                }
069:            }
070:
071:            /**
072:             * Used to grab value from array.
073:             * <p>
074:             * Description of get.
075:             * </p>
076:             * @param index
077:             * 
078:             * @see java.util.List#get(int)
079:             */
080:            public Object get(int index) {
081:                return new Double(getDouble(index));
082:            }
083:
084:            /** Quick double access */
085:            public double getDouble(int index) {
086:                rangeCheck(index);
087:                return ARRAY[START + STEP * index + OFFSET];
088:            }
089:
090:            public double[] toDoubleArray() {
091:                double array[] = new double[size()];
092:                for (int i = 0; i < size(); i++) {
093:                    array[i] = getDouble(i);
094:                }
095:                return array;
096:            }
097:
098:            /**
099:             * Check if the given index is in range.  If not, throw an appropriate
100:             * runtime exception.  This method does *not* check if the index is
101:             * negative: It is always used immediately prior to an array access,
102:             * which throws an ArrayIndexOutOfBoundsException if index is negative.
103:             */
104:            private void rangeCheck(int index) {
105:                if (index >= SIZE)
106:                    throw new IndexOutOfBoundsException("Index: " + index
107:                            + ", Size: " + SIZE);
108:            }
109:
110:            /**
111:             * Used to
112:             * <p>
113:             * Description of size.
114:             * </p>
115:             * 
116:             * @see java.util.Collection#size()
117:             */
118:            public int size() {
119:                return SIZE;
120:            }
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.