コード例 #1
0
ファイル: DriverManager.cs プロジェクト: bastie/NetVampire
        /**
         * Returns an {@code Enumeration} that contains all of the loaded JDBC
         * drivers that the current caller can access.
         *
         * @return An {@code Enumeration} containing all the currently loaded JDBC
         *         {@code Drivers}.
         */
        public static java.util.Enumeration <Driver> getDrivers()
        {
            java.lang.ClassLoader callerClassLoader = java.lang.Runtime.getRuntime().getClass().getClassLoader();// Basties note: sometime do the same as VM.callerClassLoader();

            /*
             * Synchronize to avoid clashes with additions and removals of drivers
             * in the DriverSet
             */
            lock (theDrivers)
            {
                /*
                 * Create the Enumeration by building a Vector from the elements of
                 * the DriverSet
                 */
                java.util.Vector <Driver>   theVector   = new java.util.Vector <Driver>();
                java.util.Iterator <Driver> theIterator = theDrivers.iterator();
                while (theIterator.hasNext())
                {
                    Driver theDriver = theIterator.next();
                    if (DriverManager.isClassFromClassLoader(theDriver,
                                                             callerClassLoader))
                    {
                        theVector.add(theDriver);
                    }
                }
                return(theVector.elements());
            }
        }
コード例 #2
0
 /**
  * Constructs a new {@code SequenceInputStream} using the two streams
  * {@code s1} and {@code s2} as the sequence of streams to read from.
  *
  * @param s1
  *            the first stream to get bytes from.
  * @param s2
  *            the second stream to get bytes from.
  * @throws NullPointerException
  *             if {@code s1} is {@code null}.
  */
 public SequenceInputStream(InputStream s1, InputStream s2)
 {
     if (s1 == null) {
         throw new java.lang.NullPointerException ();
     }
     java.util.Vector<InputStream> inVector = new java.util.Vector<InputStream> (1);
     inVector.addElement (s2);
     e = inVector.elements ();
     inJ = s1;
 }
コード例 #3
0
 /**
  * Constructs a new {@code SequenceInputStream} using the two streams
  * {@code s1} and {@code s2} as the sequence of streams to read from.
  *
  * @param s1
  *            the first stream to get bytes from.
  * @param s2
  *            the second stream to get bytes from.
  * @throws NullPointerException
  *             if {@code s1} is {@code null}.
  */
 public SequenceInputStream(InputStream s1, InputStream s2)
 {
     if (s1 == null)
     {
         throw new java.lang.NullPointerException();
     }
     java.util.Vector <InputStream> inVector = new java.util.Vector <InputStream> (1);
     inVector.addElement(s2);
     e   = inVector.elements();
     inJ = s1;
 }
コード例 #4
0
ファイル: NamespaceSupport.cs プロジェクト: minam365/JavApi
 /*
  * Return anjava.util.Enumeration&lt;Object&gt; of all prefixes for a given URI whose
  * declarations are active in the current context.
  * This includes declarations from parent contexts that have
  * not been overridden.
  *
  * <p/>This method returns prefixes mapped to a specific Namespace
  * URI.  The xml: prefix will be included.  If you want only one
  * prefix that's mapped to the Namespace URI, and you don't care
  * which one you get, use the {@link #getPrefix getPrefix}
  *  method instead.
  *
  * <p/><strong>Note:</strong> the empty (default) prefix is <em>never</em> included
  * in thisjava.util.Enumeration&lt;Object&gt;; to check for the presence of a default
  * Namespace, use the {@link #getURI getURI} method with an
  * argument of "".
  *
  * @param uri The Namespace URI.
  * @return Anjava.util.Enumeration&lt;Object&gt; of prefixes (never empty).
  * @see #getPrefix
  * @see #getDeclaredPrefixes
  * @see #getURI
  */
 public java.util.Enumeration <Object> getPrefixes(String uri)
 {
     java.util.Vector <Object>      prefixes    = new java.util.Vector <Object>();
     java.util.Enumeration <Object> allPrefixes = getPrefixes();
     while (allPrefixes.hasMoreElements())
     {
         String prefix = (String)allPrefixes.nextElement();
         if (uri.equals(getURI(prefix)))
         {
             prefixes.addElement(prefix);
         }
     }
     return(prefixes.elements());
 }
コード例 #5
0
        /**
         * Returns an enumeration for the collection of permissions.
         *
         * @return a permission enumeration for this permission collection.
         * @see java.security.PermissionCollection#elements()
         */

        public override java.util.Enumeration <java.security.Permission> elements()
        {
            return(permissions.elements());
        }
コード例 #6
0
ファイル: DriverManager.cs プロジェクト: sailesh341/JavApi
 /**
  * Returns an {@code Enumeration} that contains all of the loaded JDBC
  * drivers that the current caller can access.
  *
  * @return An {@code Enumeration} containing all the currently loaded JDBC
  *         {@code Drivers}.
  */
 public static java.util.Enumeration<Driver> getDrivers()
 {
     java.lang.ClassLoader callerClassLoader = java.lang.Runtime.getRuntime().getClass().getClassLoader();// Basties note: sometime do the same as VM.callerClassLoader();
     /*
      * Synchronize to avoid clashes with additions and removals of drivers
      * in the DriverSet
      */
     lock (theDrivers)
     {
         /*
          * Create the Enumeration by building a Vector from the elements of
          * the DriverSet
          */
         java.util.Vector<Driver> theVector = new java.util.Vector<Driver>();
         java.util.Iterator<Driver> theIterator = theDrivers.iterator();
         while (theIterator.hasNext())
         {
             Driver theDriver = theIterator.next();
             if (DriverManager.isClassFromClassLoader(theDriver,
                     callerClassLoader))
             {
                 theVector.add(theDriver);
             }
         }
         return theVector.elements();
     }
 }
コード例 #7
0
ファイル: NamespaceSupport.cs プロジェクト: sailesh341/JavApi
 /**
  * Return anjava.util.Enumeration&lt;Object&gt; of all prefixes for a given URI whose
  * declarations are active in the current context.
  * This includes declarations from parent contexts that have
  * not been overridden.
  *
  * <p/>This method returns prefixes mapped to a specific Namespace
  * URI.  The xml: prefix will be included.  If you want only one
  * prefix that's mapped to the Namespace URI, and you don't care
  * which one you get, use the {@link #getPrefix getPrefix}
  *  method instead.
  *
  * <p/><strong>Note:</strong> the empty (default) prefix is <em>never</em> included
  * in thisjava.util.Enumeration&lt;Object&gt;; to check for the presence of a default
  * Namespace, use the {@link #getURI getURI} method with an
  * argument of "".
  *
  * @param uri The Namespace URI.
  * @return Anjava.util.Enumeration&lt;Object&gt; of prefixes (never empty).
  * @see #getPrefix
  * @see #getDeclaredPrefixes
  * @see #getURI
  */
 public java.util.Enumeration<Object> getPrefixes(String uri)
 {
     java.util.Vector<Object> prefixes = new java.util.Vector<Object>();
     java.util.Enumeration<Object> allPrefixes = getPrefixes();
     while (allPrefixes.hasMoreElements()) {
     String prefix = (String)allPrefixes.nextElement();
     if (uri.equals(getURI(prefix))) {
     prefixes.addElement(prefix);
     }
     }
     return prefixes.elements();
 }