gnu.gnustep.base
Class NSRange

java.lang.Object
  |
  +--gnu.gnustep.base.NSRange
All Implemented Interfaces:
java.lang.Cloneable

public final class NSRange
extends java.lang.Object
implements java.lang.Cloneable

This class wraps the Objective-C struct NSRange. Instances of this class in Java contain two public fields: location, length. You are required to set and read these variables directly.


Field Summary
 int length
           
 int location
           
static NSRange ZeroRange
           
 
Constructor Summary
NSRange()
           
NSRange(int aLocation, int aLength)
           
NSRange(java.lang.String string)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object otherObject)
           
 int hashCode()
           
 void intersectRange(NSRange aRange)
           
 boolean intersectsRange(NSRange aRange)
           
 boolean isEmpty()
           
 boolean isEqualToRange(NSRange aRange)
           
 boolean isSubrangeOfRange(NSRange aRange)
           
 boolean locationInRange(int aLocation)
          Returns true if aLocation is contained in this range
 int maxRange()
           
 NSRange rangeByIntersectingRange(NSRange aRange)
           
 NSRange rangeByUnioningRange(NSRange aRange)
           
 java.lang.String toString()
           
 void unionRange(NSRange aRange)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZeroRange

public static NSRange ZeroRange

location

public int location

length

public int length
Constructor Detail

NSRange

public NSRange()

NSRange

public NSRange(int aLocation,
               int aLength)

NSRange

public NSRange(java.lang.String string)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object otherObject)
Overrides:
equals in class java.lang.Object

isEqualToRange

public boolean isEqualToRange(NSRange aRange)

locationInRange

public boolean locationInRange(int aLocation)
Returns true if aLocation is contained in this range

maxRange

public int maxRange()

intersectsRange

public boolean intersectsRange(NSRange aRange)

isSubrangeOfRange

public boolean isSubrangeOfRange(NSRange aRange)

rangeByIntersectingRange

public NSRange rangeByIntersectingRange(NSRange aRange)

rangeByUnioningRange

public NSRange rangeByUnioningRange(NSRange aRange)

intersectRange

public void intersectRange(NSRange aRange)

unionRange

public void unionRange(NSRange aRange)

isEmpty

public boolean isEmpty()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object