jkesselm    2003/02/12 10:36:48

  Modified:    java/src/org/apache/xml/utils Tag: xslt20 IntVector.java
  Log:
  Made it cloneable.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.16.2  +15 -1     xml-xalan/java/src/org/apache/xml/utils/IntVector.java
  
  Index: IntVector.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/IntVector.java,v
  retrieving revision 1.4.16.1
  retrieving revision 1.4.16.2
  diff -u -r1.4.16.1 -r1.4.16.2
  --- IntVector.java    30 Jan 2003 00:39:43 -0000      1.4.16.1
  +++ IntVector.java    12 Feb 2003 18:36:48 -0000      1.4.16.2
  @@ -66,7 +66,7 @@
    * access to existing nodes is O(1) fast but appending may be O(N**2)
    * slow. See also SuballocatedIntVector.
    */
  -public class IntVector
  +public class IntVector implements Cloneable
   {
   
     /** Size of blocks to allocate          */
  @@ -117,6 +117,20 @@
       m_blocksize = increaseSize;
       m_mapSize = blocksize;
       m_map = new int[blocksize];
  +  }
  +  
  +  public Object clone()
  +  {
  +     try
  +     {
  +             IntVector newVector=(IntVector)super.clone();
  +             newVector.m_map=(int[])m_map.clone();
  +             return newVector;
  +     } catch(CloneNotSupportedException e)
  +     {
  +             // can't happen.
  +             throw new InternalError(e.toString());
  +     }
     }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to