You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/12/14 00:54:09 UTC

svn commit: r726308 - /xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java

Author: mrglavas
Date: Sat Dec 13 15:54:09 2008
New Revision: 726308

URL: http://svn.apache.org/viewvc?rev=726308&view=rev
Log:
As a consequence of our choice to design XSModel in IDL instead of Java we ended
up creating many list type interfaces. If we had started this work in Java we
would have used java.util.List instead, an interface which is built into the Java
class library that has first class support in the Collections API and is used by
countless applications. When we revisit the XSModel for XML Schema 1.1 we should
retrofit java.util.List everywhere in the API where we are returning the XSModel
specific list types. In anticipation of this change I've updated each of the
list implementations so that they now implement java.util.List. This will make it
easier to update the API when the time comes.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java?rev=726308&r1=726307&r2=726308&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/PSVIErrorList.java Sat Dec 13 15:54:09 2008
@@ -17,6 +17,8 @@
 
 package org.apache.xerces.impl.xs;
 
+import java.util.AbstractList;
+
 import org.apache.xerces.xs.StringList;
 
 /**
@@ -28,7 +30,7 @@
  * 
  * @version $Id$
  */
-final class PSVIErrorList implements StringList {
+final class PSVIErrorList extends AbstractList implements StringList {
 
     private final String[] fArray;
     private final int fLength;
@@ -68,4 +70,20 @@
         }
         return fArray[(index << 1) + fOffset];
     }
-}
+    
+    /*
+     * List methods
+     */
+
+    public Object get(int index) {
+        if (index >= 0 && index < fLength) {
+            return fArray[(index << 1) + fOffset];
+        }
+        throw new IndexOutOfBoundsException("Index: " + index);
+    }
+
+    public int size() {
+        return getLength();
+    }
+    
+} // class PSVIErrorList



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org