[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-cvs
Subject:    [Jibx-cvs] core/build/src/org/jibx/runtime/impl StringArray.java,
From:       Dennis Sosnoski <dsosnoski () users ! sourceforge ! net>
Date:       2008-07-26 2:11:20
Message-ID: E1KMZFg-0006wU-LK () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/jibx/core/build/src/org/jibx/runtime/impl
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv32087/src/org/jibx/runtime/impl

Modified Files:
	StringArray.java 
Log Message:
Add set() and addAll() methods, clean up formatting.

Index: StringArray.java
===================================================================
RCS file: /cvsroot/jibx/core/build/src/org/jibx/runtime/impl/StringArray.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StringArray.java	21 May 2006 21:01:33 -0000	1.1
--- StringArray.java	26 Jul 2008 02:11:18 -0000	1.2
***************
*** 1,4 ****
  /*
! Copyright (c) 2000-2005, Dennis M. Sosnoski
  All rights reserved.
  
--- 1,4 ----
  /*
! Copyright (c) 2000-2008, Dennis M. Sosnoski.
  All rights reserved.
  
***************
*** 39,43 ****
   *
   * @author Dennis M. Sosnoski
-  * @version 1.0
   */
  public class StringArray
--- 39,42 ----
***************
*** 159,162 ****
--- 158,175 ----
  
      /**
+      * Overwrite an existing value in the array.
+      *
+      * @param index position of value to be overwritten
+      * @param value value to be added
+      */
+     public void set(int index, String value) {
+         if (index < m_countPresent) {
+             m_baseArray[index] = value;
+         } else {
+             throw new IllegalArgumentException("Index value out of range");
+         }
+     }
+ 
+     /**
       * Add a value at the end of the array.
       *
***************
*** 169,172 ****
--- 182,197 ----
  
      /**
+      * Add an array of values at the end of the array.
+      *
+      * @param values values to be added
+      */
+     public void addAll(String[] values) {
+         ensureCapacity(m_countPresent+values.length);
+         for (int i = 0; i < values.length; i++) {
+             m_baseArray[m_countPresent++] = values[i];
+         }
+     }
+ 
+     /**
       * Remove some number of values from the end of the array.
       *


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jibx-cvs mailing list
Jibx-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic