Java Doc for RangeSet.java in  » GIS » GeoTools-2.4.1 » org » geotools » util » 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.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.AbstractSet
   org.geotools.util.RangeSet

RangeSet
public class RangeSet extends AbstractSet implements SortedSet,Cloneable,Serializable(Code)
An ordered set of ranges. RangeSet objects store an arbitrary number of in any Java's primitives ( int , float , etc.) or any objects. Ranges may be added in any order. When a range is added, RangeSet first looks for an existing range overlapping the specified range. If an overlapping range is found, ranges are merged as of Range.union . Consequently, ranges returned by RangeSet.iterator may not be the same than added ranges.

All entries in this set can be seen as Range objects. This class is not thread-safe.
since:
   2.0
version:
   $Id: RangeSet.java 22443 2006-10-27 20:47:22Z desruisseaux $
author:
   Martin Desruisseaux
author:
   Andrea Aime




Constructor Summary
public  RangeSet(Class type)
     Construct an empty set of range.
Parameters:
  type - The class of the range elements.

Method Summary
public  booleanadd(Object r)
     Add a range to this set.
public  booleanadd(Comparable lower, Comparable upper)
     Add a range of values to this set.
public  booleanadd(byte lower, byte upper)
     Add a range of values to this set.
public  booleanadd(short lower, short upper)
     Add a range of values to this set.
public  booleanadd(int lower, int upper)
     Add a range of values to this set.
public  booleanadd(long lower, long upper)
     Add a range of values to this set.
public  booleanadd(float lower, float upper)
     Add a range of values to this set.
public  booleanadd(double lower, double upper)
     Add a range of values to this set.
public  voidclear()
     Remove all elements from this set of ranges.
public  Objectclone()
     Returns a clone of this range set.
public  Comparatorcomparator()
     Returns the comparator associated with this sorted set.
public  booleancontains(Object object)
     Returns true if this set contains the specified element.
public  booleanequals(Object object)
     Compares the specified object with this set of ranges for equality.
public  Objectfirst()
     Returns the first (lowest) range currently in this sorted set.
final public  doublegetMaxValueAsDouble(int index)
     Returns a as a double . The index can be any value from 0 inclusive to the set's RangeSet.size size exclusive.
final public  doublegetMinValueAsDouble(int index)
     Returns a as a double . The index can be any value from 0 inclusive to the set's RangeSet.size size exclusive.
public  inthashCode()
     Returns a hash value for this set of ranges.
public  SortedSetheadSet(Object upper)
     Returns a view of the portion of this sorted set whose elements are strictly less than upper .
Parameters:
  upper - High endpoint (exclusive) of the headSet.
public  intindexOfRange(Comparable value)
     If the specified value is inside a range, returns the index of this range. Otherwise, returns -1 .
Parameters:
  value - The value to search.
public  java.util.Iteratoriterator()
     Returns an iterator over the elements in this set of ranges.
public  Objectlast()
     Returns the last (highest) range currently in this sorted set.
public  booleanremove(Comparable lower, Comparable upper)
     Remove a range of values from this set.
public  booleanremove(byte lower, byte upper)
     Remove a range of values from this set.
public  booleanremove(short lower, short upper)
     Remove a range of values from this set.
public  booleanremove(int lower, int upper)
     Remove a range of values from this set.
public  booleanremove(long lower, long upper)
     Remove a range of values from this set.
public  booleanremove(float lower, float upper)
     Remove a range of values from this set.
public  booleanremove(double lower, double upper)
     Remove a range of values from this set.
public  intsize()
     Returns the number of ranges in this set.
public  SortedSetsubSet(Object lower, Object upper)
     Returns a view of the portion of this sorted set whose elements range from lower , inclusive, to upper , exclusive.
Parameters:
  lower - Low endpoint (inclusive) of the sub set.
Parameters:
  upper - High endpoint (exclusive) of the sub set.
public  SortedSettailSet(Object lower)
     Returns a view of the portion of this sorted set whose elements are greater than or equal to lower .
Parameters:
  lower - Low endpoint (inclusive) of the tailSet.
public  StringtoString()
     Returns a string representation of this set of ranges.


Constructor Detail
RangeSet
public RangeSet(Class type) throws IllegalArgumentException(Code)
Construct an empty set of range.
Parameters:
  type - The class of the range elements. It must be a primitivetype or a class implementing Comparable.
throws:
  IllegalArgumentException - if type is not aprimitive type or a class implementing Comparable.




Method Detail
add
public boolean add(Object r) throws ClassCastException(Code)
Add a range to this set. Range may be added in any order. If the specified range overlap an existing range, the two range will be merged as of Range.union .

Note: current version do not support open interval (i.e. Range.is[Min/Max]Included() must return true ). It may be fixed in a future version.
Parameters:
  r - The range to add. The RangeSet classwill never modify the supplied Range object. true if this set changed as a result of the call.
throws:
  ClassCastException - if the argument is not a Range object.



add
public boolean add(Comparable lower, Comparable upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(byte lower, byte upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(short lower, short upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(int lower, int upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(long lower, long upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(float lower, float upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



add
public boolean add(double lower, double upper) throws IllegalArgumentException(Code)
Add a range of values to this set. Range may be added in any order. If the specified range overlap an existing range, the two ranges will be merged.
Parameters:
  lower - The lower value, inclusive.
Parameters:
  upper - The upper value, inclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



clear
public void clear()(Code)
Remove all elements from this set of ranges.



clone
public Object clone()(Code)
Returns a clone of this range set.



comparator
public Comparator comparator()(Code)
Returns the comparator associated with this sorted set.



contains
public boolean contains(Object object)(Code)
Returns true if this set contains the specified element.



equals
public boolean equals(Object object)(Code)
Compares the specified object with this set of ranges for equality.



first
public Object first() throws NoSuchElementException(Code)
Returns the first (lowest) range currently in this sorted set.
throws:
  NoSuchElementException - if the set is empty.



getMaxValueAsDouble
final public double getMaxValueAsDouble(int index) throws IndexOutOfBoundsException, ClassCastException(Code)
Returns a as a double . The index can be any value from 0 inclusive to the set's RangeSet.size size exclusive. The returned values always increase with index .
Parameters:
  index - The range index, from 0 inclusive to RangeSet.size size exclusive. The maximum value for the range at the specified index.
throws:
  IndexOutOfBoundsException - if index is out of bounds.
throws:
  ClassCastException - if range elements are not convertible to numbers.



getMinValueAsDouble
final public double getMinValueAsDouble(int index) throws IndexOutOfBoundsException, ClassCastException(Code)
Returns a as a double . The index can be any value from 0 inclusive to the set's RangeSet.size size exclusive. The returned values always increase with index .
Parameters:
  index - The range index, from 0 inclusive to RangeSet.size size exclusive. The minimum value for the range at the specified index.
throws:
  IndexOutOfBoundsException - if index is out of bounds.
throws:
  ClassCastException - if range elements are not convertible to numbers.



hashCode
public int hashCode()(Code)
Returns a hash value for this set of ranges. This value need not remain consistent between different implementations of the same class.



headSet
public SortedSet headSet(Object upper)(Code)
Returns a view of the portion of this sorted set whose elements are strictly less than upper .
Parameters:
  upper - High endpoint (exclusive) of the headSet. A view of the specified initial range of this sorted set.



indexOfRange
public int indexOfRange(Comparable value)(Code)
If the specified value is inside a range, returns the index of this range. Otherwise, returns -1 .
Parameters:
  value - The value to search. The index of the range which contains this value, or -1 if there is no such range.



iterator
public java.util.Iterator iterator()(Code)
Returns an iterator over the elements in this set of ranges. All elements are Range objects.



last
public Object last() throws NoSuchElementException(Code)
Returns the last (highest) range currently in this sorted set.
throws:
  NoSuchElementException - if the set is empty.



remove
public boolean remove(Comparable lower, Comparable upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(byte lower, byte upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(short lower, short upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(int lower, int upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(long lower, long upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(float lower, float upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



remove
public boolean remove(double lower, double upper) throws IllegalArgumentException(Code)
Remove a range of values from this set. Range may be removed in any order.
Parameters:
  lower - The lower value to remove, exclusive.
Parameters:
  upper - The upper value to remove, exclusive. true if this set changed as a result of the call.
throws:
  IllegalArgumentException - if lower is greater than upper .



size
public int size()(Code)
Returns the number of ranges in this set.



subSet
public SortedSet subSet(Object lower, Object upper)(Code)
Returns a view of the portion of this sorted set whose elements range from lower , inclusive, to upper , exclusive.
Parameters:
  lower - Low endpoint (inclusive) of the sub set.
Parameters:
  upper - High endpoint (exclusive) of the sub set. A view of the specified range within this sorted set.



tailSet
public SortedSet tailSet(Object lower)(Code)
Returns a view of the portion of this sorted set whose elements are greater than or equal to lower .
Parameters:
  lower - Low endpoint (inclusive) of the tailSet. A view of the specified final range of this sorted set.



toString
public String toString()(Code)
Returns a string representation of this set of ranges. The returned string is implementation dependent. It is usually provided for debugging purposes.



Methods inherited from java.util.AbstractSet
public boolean equals(Object o)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.