Coverage Report - net.wotonomy.foundation.NSMutableRange
 
Classes in this File Line Coverage Branch Coverage Complexity
NSMutableRange
0% 
N/A 
1
 
 1  
 /*
 2  
 Wotonomy: OpenStep design patterns for pure Java applications.
 3  
 Copyright (C) 2000 Blacksmith, Inc.
 4  
 
 5  
 This library is free software; you can redistribute it and/or
 6  
 modify it under the terms of the GNU Lesser General Public
 7  
 License as published by the Free Software Foundation; either
 8  
 version 2.1 of the License, or (at your option) any later version.
 9  
 
 10  
 This library is distributed in the hope that it will be useful,
 11  
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
 Lesser General Public License for more details.
 14  
 
 15  
 You should have received a copy of the GNU Lesser General Public
 16  
 License along with this library; if not, see http://www.gnu.org
 17  
 */
 18  
 
 19  
 package net.wotonomy.foundation;
 20  
 
 21  
 /**
 22  
 * A pure java implementation of NSMutableRange.
 23  
 * An NSMutableRange is a modifiable NSRange.
 24  
 *
 25  
 * @author michael@mpowers.net
 26  
 * @author $Author: cgruber $
 27  
 * @version $Revision: 893 $
 28  
 */
 29  
 public class NSMutableRange extends NSRange
 30  
 {
 31  
     /**
 32  
     * Default constructor produces an empty range.
 33  
     */
 34  
     public NSMutableRange ()
 35  
     {
 36  0
             super();
 37  0
     }
 38  
 
 39  
     /**
 40  
     * Produces a range that has the same location and length as 
 41  
     * the specified range.
 42  
     */
 43  
     public NSMutableRange (NSRange aRange)
 44  
     {
 45  0
             super( aRange );
 46  0
     }
 47  
 
 48  
     /**
 49  
     * Produces a range with the specified location and length.
 50  
     */
 51  
     public NSMutableRange (int location, int length)
 52  
     {
 53  0
             super( location, length );
 54  0
     }
 55  
 
 56  
     /**
 57  
     * Sets the location of this range.
 58  
     */
 59  
     public void setLocation (int location)
 60  
     {
 61  0
             loc = location;
 62  0
     }
 63  
 
 64  
     /**
 65  
     * Sets the length of this range.
 66  
     */
 67  
     public void setLength (int length)
 68  
     {
 69  0
             len = length;
 70  0
     }
 71  
     
 72  
     /**
 73  
     * Modifies this range to be the union of this
 74  
     * range and the specified range.
 75  
         */
 76  
     public void unionRange (NSRange aRange)
 77  
     {
 78  0
             NSRange range = rangeByUnioningRange( aRange );
 79  0
             setLocation( range.location() );
 80  0
             setLength( range.length() );
 81  0
     }
 82  
 
 83  
     /**
 84  
     * Modifies this range to be the intersection of this
 85  
     * range and the specified range.
 86  
         */
 87  
     public void intersectRange (NSRange aRange)
 88  
     {
 89  0
             NSRange range = rangeByIntersectingRange( aRange );
 90  0
             setLocation( range.location() );
 91  0
             setLength( range.length() );
 92  0
     }
 93  
 
 94  
     /**
 95  
     * Returns a copy of this range.
 96  
         */
 97  
     public Object clone ()
 98  
     {
 99  0
             return new NSMutableRange( location(), length() );
 100  
     }
 101  
 }
 102  
 
 103  
 /*
 104  
  * $Log$
 105  
  * Revision 1.2  2006/02/16 13:15:00  cgruber
 106  
  * Check in all sources in eclipse-friendly maven-enabled packages.
 107  
  *
 108  
  * Revision 1.1.1.1  2000/12/21 15:47:36  mpowers
 109  
  * Contributing wotonomy.
 110  
  *
 111  
  * Revision 1.3  2000/12/20 16:25:38  michael
 112  
  * Added log to all files.
 113  
  *
 114  
  *
 115  
  */
 116