Java Doc for Range.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » 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 » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.jai.util.Range

Range
public class Range implements Serializable(Code)
A class to represent ranges of values. A range is defined to contain all the values between the minimum and maximum values, where the minimum/maximum value can be considered either included or excluded from the range.

This example creates a range of Integers whose minimum value is 1 and the maximum value is 5. The range is inclusive at both ends:

Range intRange = new Range(Integer.class, new Integer(1), new Integer(5));

A Range can be unbounded at either or both of its ends. An unbounded end is specified by passing null for the value of that end. A Range unbounded at both of its ends represents a range of all possible values for the Class of elements in that Range. The isMinIncluded() method will always return true for a Range unbounded on the minimum side and correspondingly the isMaxIncluded() method will always return true for a Range unbounded on the maximum side.

An empty range is defined as a Range whose minimum value is greater than it's maximum value if the ends are included, or as a Range whose minimum value is greater than or equal to it's maximum value, if the minimum or the maximum value is excluded.
since:
   JAI 1.1




Constructor Summary
public  Range(Class elementClass, Comparable minValue, Comparable maxValue)
     Constructs a Range object given the Class of the elements in the Range, the minimum value and the maximum value.
public  Range(Class elementClass, Comparable minValue, boolean isMinIncluded, Comparable maxValue, boolean isMaxIncluded)
     Constructs a Range object given the Class of the elements in the Range, the minimum value and the maximum value.

Method Summary
public  booleancontains(Comparable value)
     Returns true if the specified value is within this Range, i.e.
public  booleancontains(Range range)
     Returns true if the supplied Range is fully contained within this Range.
public  booleanequals(Object other)
     Returns true if this Range and the given Range both have elements of the same Class, their minimum and maximum values are the same, and their isMinIncluded() and isMaxIncluded() methods return the same values.
public  ClassgetElementClass()
     Returns the Class of the elements of this Range.
public  ComparablegetMaxValue()
     Returns the maximum value of this Range.
public  ComparablegetMinValue()
     Returns the minimum value of this Range.
public  inthashCode()
     Compute a hash code value for this Range object.
public  Rangeintersect(Range range)
     Returns the intersection of this Range with the given Range.
public  booleanintersects(Range range)
     Returns true if this Range intersects the given Range.
public  booleanisEmpty()
     Returns true if this Range is empty, i.e.
public  booleanisMaxIncluded()
     Returns true if the maximum value is included within this Range.
public  booleanisMinIncluded()
     Returns true if the minimum value is included within this Range.
public  Range[]subtract(Range range)
     Returns the Range of values that are in this Range but not in the given Range.
public  StringtoString()
     Returns a String representation of this Range.
public  Rangeunion(Range range)
     Returns the union of this Range with the given Range.


Constructor Detail
Range
public Range(Class elementClass, Comparable minValue, Comparable maxValue)(Code)
Constructs a Range object given the Class of the elements in the Range, the minimum value and the maximum value. The minimum and the maximum value are considered inclusive.

An unbounded range can be specified by passing in a null for either of the two values, in which case the Range is unbounded on one side, or for both, in which case the Range represents an all inclusive set.
Parameters:
  elementClass - The Class of the Rangeelements.
Parameters:
  minValue - The lowest value included in the Range.
Parameters:
  maxValue - The highest value included in the Range.
throws:
  IllegalArgumentException - if minValue and maxValue are both null,and elementClass is not one of the subclasses of Comparable.
throws:
  IllegalArgumentException - if minValue is not the same Class as elementClass.
throws:
  IllegalArgumentException - if maxValue is not the same Class as elementClass.




Range
public Range(Class elementClass, Comparable minValue, boolean isMinIncluded, Comparable maxValue, boolean isMaxIncluded)(Code)
Constructs a Range object given the Class of the elements in the Range, the minimum value and the maximum value. Whether the minimum value and the maximum value are considered inclusive is specified via the isMinIncluded and isMaxIncluded variables.

An unbounded range can be specified by passing in a null for either of the two values, in which case the Range is unbounded at one end, or for both, in which case the Range represents an all inclusive set. If null is passed in for either variable, the boolean variables have no effect.
Parameters:
  elementClass - The Class of the Rangeelements.
Parameters:
  minValue - The lowest value for the Range.
Parameters:
  isMinIncluded - A boolean that defines whether the minimum value isincluded in the Range.
Parameters:
  maxValue - The highest value for the Range.
Parameters:
  isMaxIncluded - A boolean that defines whether the maximum value isincluded in the Range.
throws:
  IllegalArgumentException - if minValue and maxValue are both null,and elementClass is not one of thesubclasses of Comparable.
throws:
  IllegalArgumentException - if minValue is not the same Class as elementClass.
throws:
  IllegalArgumentException - if maxValue is not the same Class as elementClass.





Method Detail
contains
public boolean contains(Comparable value)(Code)
Returns true if the specified value is within this Range, i.e. is either equal to or greater than the minimum value of this Range and is either lesser than or equal to the maximum value of this Range.
Parameters:
  value - The value to be checked for being within this Range.
throws:
  IllegalArgumentException - if the Class of the valueparameter is not the same as the elementClass of this Range.



contains
public boolean contains(Range range)(Code)
Returns true if the supplied Range is fully contained within this Range. Fully contained is defined as having the minimum and maximum values of the fully contained range lie within the range of values of the containing Range.
throws:
  IllegalArgumentException - if the Class of theelements of the given Range is not the same as the Class of the elements of this Range.
throws:
  IllegalArgumentException - if the given Range is null



equals
public boolean equals(Object other)(Code)
Returns true if this Range and the given Range both have elements of the same Class, their minimum and maximum values are the same, and their isMinIncluded() and isMaxIncluded() methods return the same values. If this Range and the given Range are both empty and the Class of their elements is the same, they will be found to be equal and true will be returned.



getElementClass
public Class getElementClass()(Code)
Returns the Class of the elements of this Range.



getMaxValue
public Comparable getMaxValue()(Code)
Returns the maximum value of this Range. Returns null if the Range is unbounded at this end.



getMinValue
public Comparable getMinValue()(Code)
Returns the minimum value of this Range. Returns null if the Range is unbounded at this end.



hashCode
public int hashCode()(Code)
Compute a hash code value for this Range object. a hash code value for this Range object.



intersect
public Range intersect(Range range)(Code)
Returns the intersection of this Range with the given Range.
throws:
  IllegalArgumentException - if the Class of theelements of the given Range is not the same as the Class of the elements of this Range.
throws:
  IllegalArgumentException - if the given Range is null



intersects
public boolean intersects(Range range)(Code)
Returns true if this Range intersects the given Range.
throws:
  IllegalArgumentException - if the Class of theelements of the given Range is not the same as the Class of the elements of this Range.
throws:
  IllegalArgumentException - if the given Range is null



isEmpty
public boolean isEmpty()(Code)
Returns true if this Range is empty, i.e. if the minimum value is greater than the maximum value, if both are included, or if the minimum value is greater than equal to the maximum value if either the minimum or maximum value is excluded.



isMaxIncluded
public boolean isMaxIncluded()(Code)
Returns true if the maximum value is included within this Range. If the range is unbounded at this end, this method will return true.



isMinIncluded
public boolean isMinIncluded()(Code)
Returns true if the minimum value is included within this Range. If the range is unbounded at this end, this method will return true.



subtract
public Range[] subtract(Range range)(Code)
Returns the Range of values that are in this Range but not in the given Range. If the subtraction results in two disjoint Ranges, they will be returned as two elements of a Range array, otherwise the resultant Range will be returned as the first element of a one element array. When this Range and the given Range are both unbounded at both the ends (i.e both the Ranges are all inclusive), this method will return null as the first element of one element array, as a result of the subtraction. When this Range is completely contained in the given Range, an empty Range is returned.
throws:
  IllegalArgumentException - if the Class of theelements of the given Range is not the same as the Class of the elements of this Range.



toString
public String toString()(Code)
Returns a String representation of this Range.



union
public Range union(Range range)(Code)
Returns the union of this Range with the given Range. If this Range and the given Range are disjoint, the Range returned as a result of the union will have a minimum value set to the minimum of the two disjoint range's minimum values, and the maximum set to the maximum of the two disjoint range's maximum values, thus including the disjoint range within it.
throws:
  IllegalArgumentException - if the Class of theelements of the given Range is not the same as the Class of the elements of this Range.
throws:
  IllegalArgumentException - if the given Range is null



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.