コード例 #1
0
 /*
  * Creates an SQLClientInfoException object. The Reason string is set to
  * reason, the SQLState string is set to the sqlState, the Error Code is set
  * to the vendorCode the cause Throwable object is set to the given cause
  * Throwable object, and the Map<String,ClientInfoStatus> object is set to
  * the failed properties.
  *
  * @param reason
  *            the string to use as the Reason string
  * @param sqlState
  *            the string to use as the SQLState string
  * @param vendorCode
  *            the integer value for the error code
  * @param failedProperties
  *            the Map<String,ClientInfoStatus> object to use as the
  *            property values
  * @param cause
  *            the Throwable object for the underlying reason this
  *            SQLException
  */
 public SQLClientInfoException(String reason, String sqlState,
                               int vendorCode, java.util.Map <String, ClientInfoStatus> failedProperties,
                               java.lang.Throwable cause) :
     base(reason, sqlState, vendorCode, cause)
 {
     this.failedProperties = failedProperties;
 }
コード例 #2
0
 public abstract void bindApplication(string arg1, android.content.pm.ApplicationInfo
                                      arg2, java.util.List <android.content.pm.ProviderInfo> arg3, android.content.ComponentName
                                      arg4, string arg5, android.os.ParcelFileDescriptor arg6, bool arg7, android.os.Bundle
                                      arg8, android.app.IInstrumentationWatcher arg9, int arg10, bool arg11, bool arg12
                                      , android.content.res.Configuration arg13, android.content.res.CompatibilityInfo
                                      arg14, java.util.Map <string, android.os.IBinder> arg15, android.os.Bundle arg16
                                      );
コード例 #3
0
ファイル: AttributedString.cs プロジェクト: sailesh341/JavApi
        /**
         * Constructs an {@code AttributedString} from an {@code
         * AttributedCharacterIterator}, which represents attributed text.
         *
         * @param iterator
         *            the {@code AttributedCharacterIterator} that contains the text
         *            for this attributed string.
         */
        public AttributedString(AttributedCharacterIterator iterator)
        {
            if (iterator.getBeginIndex() > iterator.getEndIndex()) {
                // text.0A=Invalid substring range
                throw new java.lang.IllegalArgumentException("Invalid substring range"); //$NON-NLS-1$
            }
            StringBuilder buffer = new StringBuilder();
            for (int i = iterator.getBeginIndex(); i < iterator.getEndIndex(); i++) {
                buffer.Append(iterator.current());
                iterator.next();
            }
            text = buffer.ToString();
            java.util.Set<AttributedCharacterIteratorNS.Attribute> attributes = iterator
                    .getAllAttributeKeys();
            if (attributes == null) {
                return;
            }
            attributeMap = new java.util.HashMap<AttributedCharacterIteratorNS.Attribute, java.util.List<IAC_Range>>();//(attributes.size() * 4 / 3) + 1);

            java.util.Iterator<AttributedCharacterIteratorNS.Attribute> it = attributes.iterator();
            while (it.hasNext()) {
                AttributedCharacterIteratorNS.Attribute attribute = it.next();
                iterator.setIndex(0);
                while (iterator.current() != CharacterIteratorConstants.DONE) {
                    int start = iterator.getRunStart(attribute);
                    int limit = iterator.getRunLimit(attribute);
                    System.Object value = iterator.getAttribute(attribute);
                    if (value != null) {
                        addAttribute(attribute, value, start, limit);
                    }
                    iterator.setIndex(limit);
                }
            }
        }
コード例 #4
0
ファイル: RenderingHints.cs プロジェクト: minam365/JavApi
 public RenderingHints(java.util.Map <Key, Object> map) : base()
 {
     if (map != null)
     {
         putAll((java.util.Map <Object, Object>)map);
     }
 }
 /**
  * Constructs a map that decorates the specified maps,
  * used by the subclass <code>createBidiMap</code> implementation.
  *
  * @param normalMap  the normal direction map
  * @param reverseMap  the reverse direction map
  * @param inverseBidiMap  the inverse BidiMap
  */
 protected AbstractDualBidiMap(java.util.Map <Object, Object> normalMap, java.util.Map <Object, Object> reverseMap, BidiMap inverseBidiMap)
     : base()
 {
     maps[0] = normalMap;
     maps[1] = reverseMap;
     this.inverseBidiMapJ = inverseBidiMap;
 }
 /**
  * Add an additional Map to the composite.
  *
  * @param map  the Map to be added to the composite
  * @throws IllegalArgumentException if there is a key collision and there is no
  *         MapMutator set to handle it.
  */
 public void addComposited(java.util.Map <Object, Object> map)
 {//throws IllegalArgumentException {
     lock (this)
     {
         for (int i = composite.Length - 1; i >= 0; --i)
         {
             java.util.Collection <Object> intersect = CollectionUtils.intersection(this.composite[i].keySet(), map.keySet());
             if (intersect.size() != 0)
             {
                 if (this.mutator == null)
                 {
                     throw new java.lang.IllegalArgumentException("Key collision adding Map to CompositeMap");
                 }
                 else
                 {
                     this.mutator.resolveCollision(this, this.composite[i], map, intersect);
                 }
             }
         }
         java.util.Map <Object, Object>[] temp = new java.util.Map <Object, Object> [this.composite.Length + 1];
         java.lang.SystemJ.arraycopy(this.composite, 0, temp, 0, this.composite.Length);
         temp[temp.Length - 1] = map;
         this.composite        = temp;
     }
 }
コード例 #7
0
 public CollectionViewIterator(CollectionView view)
 {
     this.root     = view.root;
     this.view     = view;
     this.expected = root.map;
     this.iterator = expected.entrySet().iterator();
 }
コード例 #8
0
ファイル: ZipFile.cs プロジェクト: bastie/NetVampire
        //throws IOException {

        /**
         * Opens the given file for reading, assuming the specified
         * encoding for file names.
         *
         * @param f the archive.
         * @param encoding the encoding to use for file names, use null
         * for the platform's default encoding
         * @param useUnicodeExtraFields whether to use InfoZIP Unicode
         * Extra Fields (if present) to set the file names.
         *
         * @throws IOException if an error occurs while reading the file.
         */
        public ZipFile(java.io.File f, String encoding, bool useUnicodeExtraFields)
        //throws IOException
        {
            this.OFFSET_COMPARATOR     = new IAC_OFFSET_COMPARATOR(this);
            this.encoding              = encoding;
            this.zipEncoding           = ZipEncodingHelper.getZipEncoding(encoding);
            this.useUnicodeExtraFields = useUnicodeExtraFields;
            archive = new java.io.RandomAccessFile(f, "r");
            bool success = false;

            try {
                java.util.Map <ZipArchiveEntry, IAC_NameAndComment> entriesWithoutUTF8Flag = populateFromCentralDirectory();
                resolveLocalFileHeaderData(entriesWithoutUTF8Flag);
                success = true;
            } finally {
                if (!success)
                {
                    try {
                        archive.close();
                    } catch (java.io.IOException) {
                        // swallow, throw the original exception instead
                    }
                }
            }
        }
        /**
         * Create a new Closure that calls one of the closures depending
         * on the predicates.
         * <p>
         * The Map consists of Predicate keys and Closure values. A closure
         * is called if its matching predicate returns true. Each predicate is evaluated
         * until one returns true. If no predicates evaluate to true, the default
         * closure is called. The default closure is set in the map with a
         * null key. The ordering is that of the iterator() method on the entryset
         * collection of the map.
         *
         * @param predicatesAndClosures  a map of predicates to closures
         * @return the <code>switch</code> closure
         * @throws IllegalArgumentException if the map is null
         * @throws IllegalArgumentException if any closure in the map is null
         * @throws ClassCastException  if the map elements are of the wrong type
         */
        public static Closure getInstance(java.util.Map <Object, Object> predicatesAndClosures)
        {
            Closure[]   closures = null;
            Predicate[] preds    = null;
            if (predicatesAndClosures == null)
            {
                throw new java.lang.IllegalArgumentException("The predicate and closure map must not be null");
            }
            if (predicatesAndClosures.size() == 0)
            {
                return(NOPClosure.INSTANCE);
            }
            // convert to array like this to guarantee iterator() ordering
            Closure defaultClosure = (Closure)predicatesAndClosures.remove(null);
            int     size           = predicatesAndClosures.size();

            if (size == 0)
            {
                return(defaultClosure == null ? NOPClosure.INSTANCE : defaultClosure);
            }
            closures = new Closure[size];
            preds    = new Predicate[size];
            int i = 0;

            for (java.util.Iterator <Object> it = (java.util.Iterator <Object>)predicatesAndClosures.entrySet().iterator(); it.hasNext();)
            {
                java.util.MapNS.Entry <Object, Object> entry = (java.util.MapNS.Entry <Object, Object>)it.next();
                preds[i]    = (Predicate)entry.getKey();
                closures[i] = (Closure)entry.getValue();
                i++;
            }
            return(new SwitchClosure(preds, closures, defaultClosure));
        }
コード例 #10
0
 public void remove()
 {
     if (lastReturned == null)
     {
         throw new java.lang.IllegalStateException();
     }
     if (root.fast)
     {
         lock (root)
         {
             if (expected != root.map)
             {
                 throw new java.util.ConcurrentModificationException();
             }
             root.remove(lastReturned.getKey());
             lastReturned = null;
             expected     = root.map;
         }
     }
     else
     {
         iterator.remove();
         lastReturned = null;
     }
 }
コード例 #11
0
ファイル: RenderingHints.cs プロジェクト: minam365/JavApi
        public override bool Equals(Object o)
        {
            if (!(o is java.util.Map <Object, Object>))
            {
                return(false);
            }

            java.util.Map <Object, Object> m    = (java.util.Map <Object, Object>)o;
            java.util.Set <Object>         keys = keySet();
            if (!keys.equals(m.keySet()))
            {
                return(false);
            }

            java.util.Iterator <Object> it = keys.iterator();
            while (it.hasNext())
            {
                Key    key = (Key)it.next();
                Object v1  = get(key);
                Object v2  = m.get(key);
                if (!(v1 == null?v2 == null:v1.equals(v2)))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #12
0
        /**
         * Create a new Transformer that calls one of the transformers depending
         * on the predicates.
         * <p>
         * The Map consists of Predicate keys and Transformer values. A transformer
         * is called if its matching predicate returns true. Each predicate is evaluated
         * until one returns true. If no predicates evaluate to true, the default
         * transformer is called. The default transformer is set in the map with a
         * null key. The ordering is that of the iterator() method on the entryset
         * collection of the map.
         *
         * @param predicatesAndTransformers  a map of predicates to transformers
         * @return the <code>switch</code> transformer
         * @throws IllegalArgumentException if the map is null
         * @throws IllegalArgumentException if any transformer in the map is null
         * @throws ClassCastException  if the map elements are of the wrong type
         */
        public static Transformer getInstance(java.util.Map <Object, Object> predicatesAndTransformers)
        {
            Transformer[] transformers = null;
            Predicate[]   preds        = null;
            if (predicatesAndTransformers == null)
            {
                throw new java.lang.IllegalArgumentException("The predicate and transformer map must not be null");
            }
            if (predicatesAndTransformers.size() == 0)
            {
                return(ConstantTransformer.NULL_INSTANCE);
            }
            // convert to array like this to guarantee iterator() ordering
            Transformer defaultTransformer = (Transformer)predicatesAndTransformers.remove(null);
            int         size = predicatesAndTransformers.size();

            if (size == 0)
            {
                return(defaultTransformer == null ? ConstantTransformer.NULL_INSTANCE : defaultTransformer);
            }
            transformers = new Transformer[size];
            preds        = new Predicate[size];
            int i = 0;

            for (java.util.Iterator <Object> it = (java.util.Iterator <Object>)predicatesAndTransformers.entrySet().iterator(); it.hasNext();)
            {
                java.util.MapNS.Entry <Object, Object> entry = (java.util.MapNS.Entry <Object, Object>)it.next();
                preds[i]        = (Predicate)entry.getKey();
                transformers[i] = (Transformer)entry.getValue();
                i++;
            }
            return(new SwitchTransformer(preds, transformers, defaultTransformer));
        }
コード例 #13
0
 /**
  * Utility method for implementations to set the map that backs
  * this bag. Not intended for interactive use outside of
  * subclasses.
  */
 protected virtual void setMap(java.util.Map <Object, Object> map)
 {
     if (map == null || map.isEmpty() == false)
     {
         throw new java.lang.IllegalArgumentException("The map must be non-null and empty");
     }
     _map = map;
 }
 public override void putAll(java.util.Map <Object, Object> map)
 {
     for (java.util.Iterator <java.util.MapNS.Entry <Object, Object> > it = map.entrySet().iterator(); it.hasNext();)
     {
         java.util.MapNS.Entry <Object, Object> entry = it.next();
         put(entry.getKey(), entry.getValue());
     }
 }
 /**
  * Constructor that wraps (not copies).
  *
  * @param map  the map to decorate, must not be null
  * @throws IllegalArgumentException if the collection is null
  */
 public AbstractMapDecorator(java.util.Map <Object, Object> map)
 {
     if (map == null)
     {
         throw new java.lang.IllegalArgumentException("Map must not be null");
     }
     this.map = map;
 }
コード例 #16
0
 /**
  * Factory method to create a typed map.
  * <p>
  * If there are any elements already in the map being decorated, they
  * are validated.
  *
  * @param map  the map to decorate, must not be null
  * @param keyType  the type to allow as keys, must not be null
  * @param valueType  the type to allow as values, must not be null
  * @throws IllegalArgumentException if list or type is null
  * @throws IllegalArgumentException if the list contains invalid elements
  */
 public static java.util.Map <Object, Object> decorate(java.util.Map <Object, Object> map, java.lang.Class keyType, java.lang.Class valueType)
 {
     return(new PredicatedMap(
                map,
                InstanceofPredicate.getInstance(keyType),
                InstanceofPredicate.getInstance(valueType)
                ));
 }
コード例 #17
0
ファイル: XPathType.cs プロジェクト: minam365/JavApi
  /*
  * Creates an <code>XPathType</code> instance with the specified XPath
  * expression, filter, and namespace map. The map is copied to protect
  * against subsequent modification.
  *
  * @param expression the XPath expression to be evaluated
  * @param filter the filter operation ({@link Filter#INTERSECT},
  *    {@link Filter#SUBTRACT}, or {@link Filter#UNION})
  * @param namespaceMap the map of namespace prefixes. Each key is a
  *    namespace prefix <code>String</code> that maps to a corresponding
  *    namespace URI <code>String</code>.
  * @throws NullPointerException if <code>expression</code>,
  *    <code>filter</code> or <code>namespaceMap</code> are
  *    <code>null</code>
  * @throws ClassCastException if any of the map's keys or entries are
  *    not of type <code>String</code>
  */
 public XPathType(String expression, Filter filter, java.util.Map<String,String> namespaceMap) :
     this(expression, filter){
     if (namespaceMap == null) {
         throw new java.lang.NullPointerException("namespaceMap cannot be null");
     }
     nsMap = unmodifiableCopyOfMap(namespaceMap);
     // generic using Map<String,String> also remove String checking
 }
        //-----------------------------------------------------------------------

        /**
         * Factory method to create a defaulting map.
         * <p>
         * The value specified is returned when a missing key is found.
         *
         * @param map  the map to decorate, must not be null
         * @param defaultValue  the default value to return when the key is not found
         * @throws IllegalArgumentException if map is null
         */
        public static java.util.Map <Object, Object> decorate(java.util.Map <Object, Object> map, Object defaultValue)
        {
            if (defaultValue is Transformer)
            {
                defaultValue = ConstantTransformer.getInstance(defaultValue);
            }
            return(new DefaultedMap(map, defaultValue));
        }
 private void readObject(java.io.ObjectInputStream inJ)
 {//throws IOException, ClassNotFoundException {
     inJ.defaultReadObject();
     maps[0] = new java.util.TreeMap <Object, Object>(comparatorJ);
     maps[1] = new java.util.TreeMap <Object, Object>(comparatorJ);
     java.util.Map <Object, Object> map = (java.util.Map <Object, Object>)inJ.readObject();
     putAll(map);
 }
 /**
  * Factory to create the transformer.
  * <p>
  * If the map is null, a transformer that always returns null is returned.
  *
  * @param map the map, not cloned
  * @return the transformer
  */
 public static Transformer getInstance(java.util.Map <Object, Object> map)
 {
     if (map == null)
     {
         return(ConstantTransformer.NULL_INSTANCE);
     }
     return(new MapTransformer(map));
 }
コード例 #21
0
 public void add(Token token, int docFreq)
 {
     if (tokenFrequency == null)
     {
         tokenFrequency = new LinkedHashMap/*<Token, Integer>*/ ();
     }
     tokenFrequency.put(token, docFreq);
 }
 /**
  * Factory method to create a set from a map.
  *
  * @param map  the map to decorate, must not be null
  * @param dummyValue  the dummy value to use
  * @throws IllegalArgumentException if map is null
  */
 public static java.util.Set <Object> decorate(java.util.Map <Object, Object> map, Object dummyValue)
 {
     if (map == null)
     {
         throw new java.lang.IllegalArgumentException("The map must not be null");
     }
     return(new MapBackedSet(map, dummyValue));
 }
 public virtual void putAll(java.util.Map <Object, Object> map)
 {
     for (java.util.Iterator <Object> it = (java.util.Iterator <Object>)map.entrySet().iterator(); it.hasNext();)
     {
         biz.ritter.javapi.util.MapNS.Entry <Object, Object> entry = (biz.ritter.javapi.util.MapNS.Entry <Object, Object>)it.next();
         put(entry.getKey(), entry.getValue());
     }
 }
 /**
  * Factory method to create a defaulting map.
  * <p>
  * The factory specified is called when a missing key is found.
  * The result will be returned as the result of the map get(key) method.
  *
  * @param map  the map to decorate, must not be null
  * @param factory  the factory to use, must not be null
  * @throws IllegalArgumentException if map or factory is null
  */
 public static java.util.Map <Object, Object> decorate(java.util.Map <Object, Object> map, Factory factory)
 {
     if (factory == null)
     {
         throw new java.lang.IllegalArgumentException("Factory must not be null");
     }
     return(new DefaultedMap(map, FactoryTransformer.getInstance(factory)));
 }
 /**
  * Copies all of the mappings from the specified map to this map
  * (optional operation).  The effect of this call is equivalent to that
  * of calling {@link #put(Object,Object) put(k, v)} on this map once
  * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the
  * specified map.  The behavior of this operation is unspecified if the
  * specified map is modified while the operation is in progress.
  *
  * @param map Mappings to be stored in this map.
  *
  * @throws UnsupportedOperationException if the <tt>putAll</tt> method is
  *           not supported by this map.
  *
  * @throws ClassCastException if the class of a key or value in the
  *               specified map prevents it from being stored in this map.
  *
  * @throws IllegalArgumentException some aspect of a key or value in the
  *              specified map prevents it from being stored in this map.
  * @throws NullPointerException the specified map is <tt>null</tt>, or if
  *         this map does not permit <tt>null</tt> keys or values, and the
  *         specified map contains <tt>null</tt> keys or values.
  */
 public void putAll(java.util.Map <Object, Object> map)
 {
     if (this.mutator == null)
     {
         throw new java.lang.UnsupportedOperationException("No mutator specified");
     }
     this.mutator.putAll(this, this.composite, map);
 }
コード例 #26
0
ファイル: ExtraFieldUtils.cs プロジェクト: bastie/NetVampire
 static ExtraFieldUtils()
 {
     implementations = new java.util.HashMap <Object, Object>();
     register(typeof(AsiExtraField));
     register(typeof(JarMarker));
     register(typeof(UnicodePathExtraField));
     register(typeof(UnicodeCommentExtraField));
 }
コード例 #27
0
 /**
  * Factory method to create an unmodifiable map.
  *
  * @param map  the map to decorate, must not be null
  * @throws IllegalArgumentException if map is null
  */
 public static java.util.Map <Object, Object> decorate(java.util.Map <Object, Object> map)
 {
     if (map is Unmodifiable)
     {
         return(map);
     }
     return(new UnmodifiableMap(map));
 }
コード例 #28
0
ファイル: SimpleAdapter.cs プロジェクト: zhouweiaccp/XobotOS
 internal override android.widget.Filter.FilterResults performFiltering(java.lang.CharSequence
                                                                        prefix)
 {
     android.widget.Filter.FilterResults results = new android.widget.Filter.FilterResults
                                                       ();
     if (this._enclosing.mUnfilteredData == null)
     {
         this._enclosing.mUnfilteredData = new java.util.ArrayList <java.util.Map <string, object
                                                                                   > >(this._enclosing.mData);
     }
     if (prefix == null || prefix.Length == 0)
     {
         java.util.ArrayList <java.util.Map <string, object> > list = this._enclosing.mUnfilteredData;
         results.values = list;
         results.count  = list.size();
     }
     else
     {
         string prefixString = prefix.ToString().ToLower();
         java.util.ArrayList <java.util.Map <string, object> > unfilteredValues = this._enclosing
                                                                                  .mUnfilteredData;
         int count = unfilteredValues.size();
         java.util.ArrayList <java.util.Map <string, object> > newValues = new java.util.ArrayList
                                                                           <java.util.Map <string, object> >(count);
         {
             for (int i = 0; i < count; i++)
             {
                 java.util.Map <string, object> h = unfilteredValues.get(i);
                 if (h != null)
                 {
                     int len = this._enclosing.mTo.Length;
                     {
                         for (int j = 0; j < len; j++)
                         {
                             string   str       = (string)h.get(this._enclosing.mFrom[j]);
                             string[] words     = XobotOS.Runtime.Util.SplitStringRegex(str, " ");
                             int      wordCount = words.Length;
                             {
                                 for (int k = 0; k < wordCount; k++)
                                 {
                                     string word = words[k];
                                     if (word.ToLower().StartsWith(prefixString))
                                     {
                                         newValues.add(h);
                                         break;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         results.values = newValues;
         results.count  = newValues.size();
     }
     return(results);
 }
コード例 #29
0
 /**
  * Constructor that wraps (not copies).
  *
  * @param map  the map to decorate, must not be null
  * @param factory  the factory to use, must not be null
  * @throws IllegalArgumentException if map or factory is null
  */
 protected LazyMap(java.util.Map <Object, Object> map, Transformer factory)
     : base(map)
 {
     if (factory == null)
     {
         throw new java.lang.IllegalArgumentException("Factory must not be null");
     }
     this.factory = factory;
 }
コード例 #30
0
ファイル: AttributedString.cs プロジェクト: bastie/NetVampire
 /**
  * Creates an {@code AttributedString} from the given text.
  *
  * @param value
  *            the text to take as base for this attributed string.
  */
 public AttributedString(System.String value)
 {
     if (value == null)
     {
         throw new java.lang.NullPointerException();
     }
     text         = value;
     attributeMap = new java.util.HashMap <AttributedCharacterIteratorNS.Attribute, java.util.List <IAC_Range> >();//11);
 }
コード例 #31
0
 /**
  * Creates an <code>XPathFilterParameterSpec</code> with the specified
  * XPath expression.
  *
  * @param xPath the XPath expression to be evaluated
  * @throws NullPointerException if <code>xPath</code> is <code>null</code>
  */
 public XPathFilterParameterSpec(String xPath)
 {
     if (xPath == null)
     {
         throw new java.lang.NullPointerException();
     }
     this.xPath = xPath;
     this.nsMap = new java.util.HashMap <String, String>();//Collections.EMPTY_MAP;
 }
コード例 #32
0
ファイル: ProcessBuilder.cs プロジェクト: sailesh341/JavApi
        /**
         * Constructs a new {@code ProcessBuilder} instance with the specified
         * operating system program and its arguments. Note that the list passed to
         * this constructor is not copied, so any subsequent updates to it are
         * reflected in this instance's state.
         *
         * @param command
         *            the requested operating system program and its arguments.
         * @throws NullPointerException
         *             if {@code command} is {@code null}.
         */
        public ProcessBuilder(java.util.List<String> commandJ)
            : base()
        {
            if (commandJ == null) {
            throw new NullPointerException();
            }
            this.commandJ = commandJ;

            java.lang.SystemJ.getProperties();
            this.environmentJ = // new org.apache.harmony.luni.platform.Environment.EnvironmentMap(
                java.lang.SystemJ.getenv();
        }
コード例 #33
0
ファイル: Provider.cs プロジェクト: sailesh341/JavApi
 /**
  * Constructs a new instance of {@code Service} with the given
  * attributes.
  *
  * @param provider
  *            the provider to which this service belongs.
  * @param type
  *            the type of this service (for example {@code
  *            KeyPairGenerator}).
  * @param algorithm
  *            the algorithm this service implements.
  * @param className
  *            the name of the class implementing this service.
  * @param aliases
  *            {@code List} of aliases for the algorithm name, or {@code
  *            null} if the implemented algorithm has no aliases.
  * @param attributes
  *            {@code Map} of additional attributes, or {@code null} if
  *            this {@code Service} has no attributed.
  * @throws NullPointerException
  *             if {@code provider, type, algorithm} or {@code className}
  *             is {@code null}.
  */
 public Service(Provider provider, String type, String algorithm,
         String className, java.util.List<String> aliases, java.util.Map<String, String> attributes)
 {
     if (provider == null || type == null || algorithm == null
             || className == null)
     {
         throw new java.lang.NullPointerException();
     }
     this.provider = provider;
     this.type = type;
     this.algorithm = algorithm;
     this.className = className;
     this.aliases = aliases;
     this.attributes = attributes;
 }
コード例 #34
0
ファイル: AttributedString.cs プロジェクト: sailesh341/JavApi
        private AttributedString(AttributedCharacterIterator iterator, int start,
                int end, java.util.Set<AttributedCharacterIteratorNS.Attribute> attributes)
        {
            if (start < iterator.getBeginIndex() || end > iterator.getEndIndex()
                    || start > end) {
                throw new java.lang.IllegalArgumentException();
            }

            if (attributes == null) {
                return;
            }

            StringBuilder buffer = new StringBuilder();
            iterator.setIndex(start);
            while (iterator.getIndex() < end) {
                buffer.Append(iterator.current());
                iterator.next();
            }
            text = buffer.ToString();
            attributeMap = new java.util.HashMap<AttributedCharacterIteratorNS.Attribute, java.util.List<IAC_Range>>();//(attributes.size() * 4 / 3) + 1);

            java.util.Iterator<AttributedCharacterIteratorNS.Attribute> it = attributes.iterator();
            while (it.hasNext()) {
                AttributedCharacterIteratorNS.Attribute attribute = it.next();
                iterator.setIndex(start);
                while (iterator.getIndex() < end) {
                    System.Object value = iterator.getAttribute(attribute);
                    int runStart = iterator.getRunStart(attribute);
                    int limit = iterator.getRunLimit(attribute);
                    if ((value is java.lang.annotation.Annotation && runStart >= start && limit <= end)
                            || (value != null && !(value is java.lang.annotation.Annotation))) {
                        addAttribute(attribute, value, (runStart < start ? start
                                : runStart)
                                - start, (limit > end ? end : limit) - start);
                    }
                    iterator.setIndex(limit);
                }
            }
        }
コード例 #35
0
ファイル: AttributedString.cs プロジェクト: sailesh341/JavApi
 /**
  * Creates an {@code AttributedString} from the given text and the
  * attributes. The whole text has the given attributes applied.
  *
  * @param value
  *            the text to take as base for this attributed string.
  * @param attributes
  *            the attributes that the text is associated with.
  * @throws IllegalArgumentException
  *             if the length of {@code value} is 0 but the size of {@code
  *             attributes} is greater than 0.
  * @throws NullPointerException
  *             if {@code value} is {@code null}.
  */
 public AttributedString(System.String value,
         java.util.Map<AttributedCharacterIteratorNS.Attribute, System.Object> attributes)
 {
     if (value == null) {
         throw new java.lang.NullPointerException();
     }
     if (value.Length == 0 && !attributes.isEmpty()) {
         // text.0B=Cannot add attributes to empty string
         throw new java.lang.IllegalArgumentException("Cannot add attributes to empty string"); //$NON-NLS-1$
     }
     text = value;
     attributeMap = new java.util.HashMap<AttributedCharacterIteratorNS.Attribute, java.util.List<IAC_Range>>();//(attributes.size() * 4 / 3) + 1);
     java.util.Iterator<java.util.MapNS.Entry<AttributedCharacterIteratorNS.Attribute,System.Object>> it = attributes.entrySet().iterator();
     while (it.hasNext()) {
         java.util.MapNS.Entry<AttributedCharacterIteratorNS.Attribute, System.Object> entry = it.next();
         java.util.ArrayList<IAC_Range> ranges = new java.util.ArrayList<IAC_Range>(1);
         ranges.add(new IAC_Range(0, text.Length, entry.getValue()));
         attributeMap.put((AttributedCharacterIteratorNS.Attribute) entry
                 .getKey(), ranges);
     }
 }
コード例 #36
0
			public EditorImpl(SharedPreferencesImpl _enclosing)
			{
				this._enclosing = _enclosing;
				mModified = null;
				mClear = false;
			}
コード例 #37
0
 /**
  * Creates an SQLClientInfoException object. The Reason string is set to
  * reason, and the Map&lt;String,ClientInfoStatus&gt; object is set to the failed
  * properties.
  *
  * @param reason
  *            the string to use as the Reason string
  * @param failedProperties
  *            the Map&lt;String,ClientInfoStatus&gt; object to use as the
  *            property values
  */
 public SQLClientInfoException(String reason,
     java.util.Map<String, ClientInfoStatus> failedProperties)
     : base(reason)
 {
     this.failedProperties = failedProperties;
 }
コード例 #38
0
 /**
  * Creates an SQLClientInfoException object. The Reason string is set to the
  * null if cause == null or cause.toString() if cause!=null, the cause
  * Throwable object is set to the given cause Throwable object, and the Map&lt;String,ClientInfoStatus&gt;
  * object is set to the failed properties.
  *
  * @param failedProperties
  *            the Map&lt;String,ClientInfoStatus&gt; object to use as the
  *            property values
  * @param cause
  *            the Throwable object for the underlying reason this
  *            SQLException
  */
 public SQLClientInfoException(
     java.util.Map<String, ClientInfoStatus> failedProperties, java.lang.Throwable cause)
     : base(cause)
 {
     this.failedProperties = failedProperties;
 }
コード例 #39
0
 /**
  * Creates an SQLClientInfoException object. The Reason string is set to
  * reason, the SQLState string is set to the sqlState, the Error Code is set
  * to the vendorCode, and the Map&lt;String,ClientInfoStatus&gt; object is set to
  * the failed properties.
  *
  * @param reason
  *            the string to use as the Reason string
  * @param sqlState
  *            the string to use as the SQLState string
  * @param failedProperties
  *            the Map&lt;String,ClientInfoStatus&gt; object to use as the
  *            property values
  * @param cause
  *            the Throwable object for the underlying reason this
  *            SQLException
  */
 public SQLClientInfoException(String reason, String sqlState,
     java.util.Map<String, ClientInfoStatus> failedProperties, java.lang.Throwable cause)
     : base(reason, sqlState, cause)
 {
     this.failedProperties = failedProperties;
 }
コード例 #40
0
 /**
  * Creates an SQLClientInfoException object. The Reason string is set to
  * reason, the SQLState string is set to the sqlState, the Error Code is set
  * to the vendorCode and the Map&lt;String,ClientInfoStatus&gt; object is set to
  * the failed properties.
  *
  * @param reason
  *            the string to use as the Reason string
  * @param sqlState
  *            the string to use as the SQLState string
  * @param vendorCode
  *            the integer value for the error code
  * @param failedProperties
  *            the Map&lt;String,ClientInfoStatus&gt; object to use as the
  *            property values
  *
  */
 public SQLClientInfoException(String reason, String sqlState,
     int vendorCode, java.util.Map<String, ClientInfoStatus> failedProperties)
     : base(reason, sqlState, vendorCode)
 {
     this.failedProperties = failedProperties;
 }
コード例 #41
0
ファイル: XPathType.cs プロジェクト: sailesh341/JavApi
 /**
  * Creates an <code>XPathType</code> instance with the specified XPath
  * expression and filter.
  *
  * @param expression the XPath expression to be evaluated
  * @param filter the filter operation ({@link Filter#INTERSECT},
  *    {@link Filter#SUBTRACT}, or {@link Filter#UNION})
  * @throws NullPointerException if <code>expression</code> or
  *    <code>filter</code> is <code>null</code>
  */
 public XPathType(String expression, Filter filter)
 {
     if (expression == null) {
     throw new java.lang.NullPointerException("expression cannot be null");
     }
     if (filter == null) {
     throw new java.lang.NullPointerException("filter cannot be null");
     }
     this.expression = expression;
     this.filter = filter;
     this.nsMap = new java.util.HashMap<String,String>();
     //this.nsMap = java.util.Collections<Object>.EMPTY_MAP;
 }
 /**
  * Constructor that performs no validation.
  * Use <code>getInstance</code> if you want that.
  *
  * @param map  the map to use for lookup, not cloned
  */
 private MapTransformer(java.util.Map<Object, Object> map)
     : base()
 {
     iMap = map;
 }
コード例 #43
0
ファイル: XPathType.cs プロジェクト: sailesh341/JavApi
 /**
  * Creates an <code>XPathType</code> instance with the specified XPath
  * expression, filter, and namespace map. The map is copied to protect
  * against subsequent modification.
  *
  * @param expression the XPath expression to be evaluated
  * @param filter the filter operation ({@link Filter#INTERSECT},
  *    {@link Filter#SUBTRACT}, or {@link Filter#UNION})
  * @param namespaceMap the map of namespace prefixes. Each key is a
  *    namespace prefix <code>String</code> that maps to a corresponding
  *    namespace URI <code>String</code>.
  * @throws NullPointerException if <code>expression</code>,
  *    <code>filter</code> or <code>namespaceMap</code> are
  *    <code>null</code>
  * @throws ClassCastException if any of the map's keys or entries are
  *    not of type <code>String</code>
  */
 public XPathType(String expression, Filter filter, java.util.Map<String,String> namespaceMap)
     : this(expression, filter)
 {
     if (namespaceMap == null) {
     throw new java.lang.NullPointerException("namespaceMap cannot be null");
     }
     nsMap = unmodifiableCopyOfMap(namespaceMap);
     // generic using Map<String,String> also remove String checking
 }
コード例 #44
0
ファイル: AttributedString.cs プロジェクト: sailesh341/JavApi
 /**
  * Creates an {@code AttributedString} from the given text.
  *
  * @param value
  *            the text to take as base for this attributed string.
  */
 public AttributedString(System.String value)
 {
     if (value == null) {
         throw new java.lang.NullPointerException();
     }
     text = value;
     attributeMap = new java.util.HashMap<AttributedCharacterIteratorNS.Attribute, java.util.List<IAC_Range>>();//11);
 }
 /**
  * Constructor.
  *
  * @param map  the map to iterate over
  */
 public EntrySetMapIterator(java.util.Map<Object, Object> map)
     : base()
 {
     this.map = map;
     this.iterator = (java.util.Iterator<Object>)map.entrySet().iterator();
 }