예제 #1
0
        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);
        }
예제 #2
0
파일: Access.cs 프로젝트: lulzzz/OmniDB
        /// <summary>
        /// Get a datatable with all tables.
        /// </summary>
        public override System.Data.DataTable QueryTables(bool p_all_schemas)
        {
            System.Data.DataTable v_table;
            System.Data.DataRow   v_row;

            v_table = new System.Data.DataTable("Tables");
            v_table.Columns.Add("table_name");

            com.healthmarketscience.jackcess.Database v_database = com.healthmarketscience.jackcess.DatabaseBuilder.open(new java.io.File(this.v_connection.v_service));
            java.util.Set v_set = v_database.getTableNames();
            object[]      v_obj = v_set.toArray();
            foreach (object o in v_obj)
            {
                v_row = v_table.NewRow();
                if (((string)o).Contains(" "))
                {
                    v_row["table_name"] = "[" + (string)o + "]";
                }
                else
                {
                    v_row["table_name"] = (string)o;
                }
                v_table.Rows.Add(v_row);
            }

            return(v_table);
        }
예제 #3
0
 public virtual string buildUnionSubQuery(string typeDiscriminatorColumn, string[]
                                          unionColumns, java.util.Set <string> columnsPresentInTable, int computedColumnsOffset
                                          , string typeDiscriminatorValue, string selection, string[] selectionArgs, string
                                          groupBy, string having)
 {
     throw new System.NotImplementedException();
 }
예제 #4
0
파일: Provider.cs 프로젝트: minam365/JavApi
        /*
         * Returns an unmodifiable {@code Set} of all services registered by this
         * provider.
         *
         * @return an unmodifiable {@code Set} of all services registered by this
         *         provider
         */
        public java.util.Set <Provider.Service> getServices()
        {
            lock (this)
            {
                updatePropertyServiceTable();
                if (lastServicesSet != null)
                {
                    return(lastServicesSet);
                }
                if (serviceTable != null)
                {
                    lastServicesSet = new java.util.HashSet <Service>(serviceTable.values());
                }
                else
                {
                    lastServicesSet = new java.util.HashSet <Service>();
                }
                if (propertyServiceTable != null)
                {
                    lastServicesSet.addAll(propertyServiceTable.values());
                }
                lastServicesSet = java.util.Collections <Object> .unmodifiableSet(lastServicesSet);

                return(lastServicesSet);
            }
        }
        // Map views
        //-----------------------------------------------------------------------

        /**
         * Gets a keySet view of the map.
         * Changes made on the view are reflected in the map.
         * The set supports remove and clear but not add.
         *
         * @return the keySet view
         */
        public virtual java.util.Set <Object> keySet()
        {
            if (keySetJ == null)
            {
                keySetJ = new KeySet(this);
            }
            return(keySetJ);
        }
 /**
  * Gets an entrySet view of the map.
  * Changes made on the set are reflected in the map.
  * The set supports remove and clear but not add.
  * <p>
  * The Map Entry setValue() method only allow a new value to be set.
  * If the value being set is already in the map, an IllegalArgumentException
  * is thrown (as setValue cannot change the size of the map).
  *
  * @return the entrySet view
  */
 public virtual java.util.Set <java.util.MapNS.Entry <Object, Object> > entrySet()
 {
     if (entrySetJ == null)
     {
         entrySetJ = new EntrySet(this);
     }
     return((java.util.Set <java.util.MapNS.Entry <Object, Object> >)entrySetJ);
 }
예제 #7
0
 /**
  * Factory method to create an unmodifiable set.
  *
  * @param set  the set to decorate, must not be null
  * @throws IllegalArgumentException if set is null
  */
 public static java.util.Set <Object> decorate(java.util.Set <Object> set)
 {
     if (set is Unmodifiable)
     {
         return(set);
     }
     return(new UnmodifiableSet(set));
 }
예제 #8
0
 /**
  * Returns a collection view of the mappings
  */
 public override java.util.Set <java.util.MapNS.Entry <String, V> > entrySet()
 {
     if (entrySetJ == null)
     {
         entrySetJ = new EntrySetImpl(this);
     }
     return(entrySetJ);
 }
 /**
  * Returns an unmodifiable view of the underlying map's key set.
  *
  * @return the set of unique elements in this bag
  */
 public virtual java.util.Set <Object> uniqueSet()
 {
     if (uniqueSetJ == null)
     {
         uniqueSetJ = UnmodifiableSet.decorate(map.keySet());
     }
     return(uniqueSetJ);
 }
 private java.util.Set <Object> getEntrySet()
 {
     if (entrySet == null)
     {
         entrySet = parent.getMap().entrySet();
     }
     return((java.util.Set <Object>)entrySet);
 }
예제 #11
0
 public java.util.Set <Object> uniqueSet()
 {
     lock (lockJ)
     {
         java.util.Set <Object> set = getBag().uniqueSet();
         return(new SynchronizedBagSet(set, lockJ));
     }
 }
예제 #12
0
        //-----------------------------------------------------------------------

        /**
         * Constructor that wraps (not copies) the List and specifies the set to use.
         * <p>
         * The set and list must both be correctly initialised to the same elements.
         *
         * @param set  the set to decorate, must not be null
         * @param list  the list to decorate, must not be null
         * @throws IllegalArgumentException if set or list is null
         */
        protected internal SetUniqueList(java.util.List <Object> list, java.util.Set <Object> set)
            : base(list)
        {
            if (set == null)
            {
                throw new java.lang.IllegalArgumentException("Set must not be null");
            }
            this.setJ = set;
        }
예제 #13
0
 /**
  * Constructor that wraps (not copies) the Set and specifies the list to use.
  * <p>
  * The set and list must both be correctly initialised to the same elements.
  *
  * @param set  the set to decorate, must not be null
  * @param list  the list to decorate, must not be null
  * @throws IllegalArgumentException if set or list is null
  */
 protected ListOrderedSet(java.util.Set <Object> set, java.util.List <Object> list)
     : base(set)
 {
     if (list == null)
     {
         throw new java.lang.IllegalArgumentException("List must not be null");
     }
     setOrder = list;
 }
예제 #14
0
        public java.util.Set GetConceptChild(OWLOntology ontology)
        {
            if (this.conceptChild == null)
            {
                this.conceptChild = GetConcept(ontology).getSubClasses(ontology);
            }

            return(this.conceptChild);
        }
 //-----------------------------------------------------------------------
 /**
  * Constructor that wraps (not copies) the List and specifies the set to use.
  * <p>
  * The set and list must both be correctly initialised to the same elements.
  *
  * @param set  the set to decorate, must not be null
  * @param list  the list to decorate, must not be null
  * @throws IllegalArgumentException if set or list is null
  */
 protected internal SetUniqueList(java.util.List<Object> list, java.util.Set<Object> set)
     : base(list)
 {
     if (set == null)
     {
         throw new java.lang.IllegalArgumentException("Set must not be null");
     }
     this.setJ = set;
 }
예제 #16
0
 /*
  * Prints Services content
  */
 // FIXME remove debug function
 public static void printServices()
 {
     refresh();
     java.util.Set <String> s = services.keySet();
     for (java.util.Iterator <String> i = s.iterator(); i.hasNext();)
     {
         String key = i.next();
         java.lang.SystemJ.outJ.println(key + "=" + services.get(key)); //$NON-NLS-1$
     }
 }
예제 #17
0
 public OntologyConcept(string _ConceptKey, string _ConceptName, int _Weigth, OWLClass _Concept, java.util.Set _ConceptParent, java.util.Set _ConceptChild)
     : this()
 {
     this.conceptKey    = _ConceptKey;
     this.conceptValue  = _ConceptName;
     this.weigth        = _Weigth;
     this.concept       = _Concept;
     this.conceptParent = _ConceptParent;
     this.conceptChild  = _ConceptChild;
 }
        /**
         * Returns a set view of the mappings contained in this map.  Each element
         * in the returned set is a <code>Map.Entry</code>.  The set is backed by the
         * map, so changes to the map are reflected in the set, and vice-versa.
         * If the map is modified while an iteration over the set is in progress,
         * the results of the iteration are undefined.  The set supports element
         * removal, which removes the corresponding mapping from the map, via the
         * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>,
         * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support
         * the <tt>add</tt> or <tt>addAll</tt> operations.
         * <p>
         * This implementation returns a <code>CompositeSet</code> which
         * composites the entry sets from all of the composited maps.
         *
         * @see CompositeSet
         * @return a set view of the mappings contained in this map.
         */
        public java.util.Set <java.util.MapNS.Entry <Object, Object> > entrySet()
        {
            CompositeSet entries = new CompositeSet();

            for (int i = this.composite.Length - 1; i >= 0; --i)
            {
                java.util.Set <java.util.MapNS.Entry <Object, Object> > e = this.composite[i].entrySet();
                entries.addComposited((java.util.Set <Object>)e);
            }
            return((java.util.Set <java.util.MapNS.Entry <Object, Object> >)entries); //! ??? no error at call ???
        }
예제 #19
0
 int java.text.AttributedCharacterIterator.getRunStart(java.util.Set arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallIntMethod(this.JvmHandle, global::java.text.AttributedCharacterIterator_._getRunStart15040, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::java.text.AttributedCharacterIterator_.staticClass, global::java.text.AttributedCharacterIterator_._getRunStart15040, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
        /* Set operations */

        /**
         * If a <code>CollectionMutator</code> is defined for this CompositeSet then this
         * method will be called anyway.
         *
         * @param obj Object to be removed
         * @return true if the object is removed, false otherwise
         */
        public override bool remove(Object obj)
        {
            for (java.util.Iterator <Object> i = this.getCollections().iterator(); i.hasNext();)
            {
                java.util.Set <Object> set = (java.util.Set <Object>)i.next();
                if (set.contains(obj))
                {
                    return(set.remove(obj));
                }
            }
            return(false);
        }
예제 #21
0
        internal static void CloseSelector(java.nio.channels.Selector selector)
        {
            java.util.Set      keys = selector.keys();
            java.util.Iterator it   = keys.iterator();

            try
            {
                selector.close();
            }
            catch (Exception e)
            {
#if DEBUG
                Console.WriteLine("Caught exception during CloseSelector selector.close - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);
#endif
            }

            while (it.hasNext())
            {
                java.nio.channels.SelectionKey key = (java.nio.channels.SelectionKey)it.next();
                Socket source = (Socket)key.attachment();
                key.cancel();
                try
                {
                    if (source.Blocking)
                    {
                        /*
                         *      A channel must be placed into non-blocking mode before being registered
                         *      with a selector, and may not be returned to blocking mode until it has been
                         *      deregistered. So, I need set the channel back to the blocking mode, if it was
                         *      in blocking mode before select operation
                         */
                        source.Blocking = true;
                    }
                }
                catch (Exception be)
                {
#if DEBUG
                    Console.WriteLine("Caught exception during CloseSelector source.Blocking - {0}: {1}\n{2}", be.GetType(), be.Message, be.StackTrace);
#endif
                }
            }

            try
            {
                selector.close();
            }
            catch (Exception e)
            {
#if DEBUG
                Console.WriteLine("Caught exception during CloseSelector selector.close - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);
#endif
            }
        }
 /**
  * @see Set#equals
  */
 public override bool Equals(Object obj)
 {
     if (obj is java.util.Set <Object> )
     {
         java.util.Set <Object> set = (java.util.Set <Object>)obj;
         if (set.containsAll(this) && set.size() == this.size())
         {
             return(true);
         }
     }
     return(false);
 }
예제 #23
0
 /**
  * Construct a token stream filtering the given input using a Set of common
  * words to create bigrams, case-sensitive if ignoreCase is false (unless Set
  * is CharArraySet). If <code>commonWords</code> is an instance of
  * {@link CharArraySet} (true if <code>makeCommonSet()</code> was used to
  * construct the set) it will be directly used and <code>ignoreCase</code>
  * will be ignored since <code>CharArraySet</code> directly controls case
  * sensitivity.
  * <p/>
  * If <code>commonWords</code> is not an instance of {@link CharArraySet}, a
  * new CharArraySet will be constructed and <code>ignoreCase</code> will be
  * used to specify the case sensitivity of that set.
  *
  * @param input TokenStream input in filter chain.
  * @param commonWords The set of common words.
  * @param ignoreCase -Ignore case when constructing bigrams for common words.
  */
 public CommonGramsFilter(TokenStream input, Set commonWords, bool ignoreCase) : base(input)
 {
     if (commonWords is CharArraySet)
     {
         this.commonWords = (CharArraySet)commonWords;
     }
     else
     {
         this.commonWords = new CharArraySet(commonWords.size(), ignoreCase);
         this.commonWords.addAll(commonWords);
     }
     init();
 }
예제 #24
0
 private void getAllUsedPermissions(int sharedUid, java.util.Set <android.content.pm.PermissionInfo
                                                                  > permSet)
 {
     string[] sharedPkgList = mPm.getPackagesForUid(sharedUid);
     if (sharedPkgList == null || (sharedPkgList.Length == 0))
     {
         return;
     }
     foreach (string sharedPkg in sharedPkgList)
     {
         getPermissionsForPackage(sharedPkg, permSet);
     }
 }
 /**
  * Clear the map.
  * <p>
  * This clears each collection in the map, and so may be slow.
  */
 public override void clear()
 {
     // For gc, clear each list in the map
     java.util.Set <java.util.MapNS.Entry <Object, Object> >      pairs         = base.entrySet();
     java.util.Iterator <java.util.MapNS.Entry <Object, Object> > pairsIterator = pairs.iterator();
     while (pairsIterator.hasNext())
     {
         java.util.MapNS.Entry <Object, Object> keyValuePair = pairsIterator.next();
         java.util.Collection <Object>          coll         = (java.util.Collection <Object>)keyValuePair.getValue();
         coll.clear();
     }
     base.clear();
 }
예제 #26
0
        /*public void write(string resourceName, Assembly compiledAssembly)
         * {
         *
         *  this.assem = compiledAssembly;
         *  wire(resourceName);
         * }*/

        public override void loadAssemblies()
        {
            java.util.Set set  = this.assemblySerializationInfoStore.keySet();
            object[]      objs = set.toArray();

            BinaryFormatter formatter = new BinaryFormatter();

            foreach (object obj in objs)
            {
                Assembly assem = (Assembly)formatter.Deserialize(new MemoryStream((byte[])
                                                                                  (this.assemblySerializationInfoStore.get(obj))));
                this.store.put(obj, assem);
            }
        }
예제 #27
0
        public int getRunStart(java.util.Set <AttributedCharacterIteratorNS.Attribute> attributes)
        {
            int start = begin;

            java.util.Iterator <AttributedCharacterIteratorNS.Attribute> it = attributes.iterator();
            while (it.hasNext())
            {
                AttributedCharacterIteratorNS.Attribute attribute = it.next();
                int newStart = getRunStart(attribute);
                if (newStart > start)
                {
                    start = newStart;
                }
            }
            return(start);
        }
예제 #28
0
        public int getRunLimit(java.util.Set <AttributedCharacterIteratorNS.Attribute> attributes)
        {
            int limit = end;

            java.util.Iterator <AttributedCharacterIteratorNS.Attribute> it = attributes.iterator();
            while (it.hasNext())
            {
                AttributedCharacterIteratorNS.Attribute attribute = it.next();
                int newLimit = getRunLimit(attribute);
                if (newLimit < limit)
                {
                    limit = newLimit;
                }
            }
            return(limit);
        }
예제 #29
0
 public java.util.Set GetConceptParents(OWLOntology ontology)
 {
     if (this.conceptParent == null)
     {
         if (GetConcept(ontology) != null) //Si no es una instancia, obtener la clase
         {
             this.conceptParent = GetConcept(ontology).getSuperClasses(ontology);
         }
         else
         {
             //Es una instancia entonces no tiene padres
             this.conceptParent = null;
         }
     }
     return(this.conceptParent);
 }
예제 #30
0
 /**
  * Factory method to create an ordered set specifying the list and set to use.
  * <p>
  * The list and set must both be empty.
  *
  * @param set  the set to decorate, must be empty and not null
  * @param list  the list to decorate, must be empty and not null
  * @throws IllegalArgumentException if set or list is null
  * @throws IllegalArgumentException if either the set or list is not empty
  * @since Commons Collections 3.1
  */
 public static ListOrderedSet decorate(java.util.Set <Object> set, java.util.List <Object> list)
 {
     if (set == null)
     {
         throw new java.lang.IllegalArgumentException("Set must not be null");
     }
     if (list == null)
     {
         throw new java.lang.IllegalArgumentException("List must not be null");
     }
     if (set.size() > 0 || list.size() > 0)
     {
         throw new java.lang.IllegalArgumentException("Set and List must be empty");
     }
     return(new ListOrderedSet(set, list));
 }
예제 #31
0
        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);
                }
            }
        }
예제 #32
0
 /**
  * Returns an unmodifiable {@code Set} of all services registered by this
  * provider.
  *
  * @return an unmodifiable {@code Set} of all services registered by this
  *         provider
  */
 public java.util.Set<Provider.Service> getServices()
 {
     lock (this)
     {
         updatePropertyServiceTable();
         if (lastServicesSet != null)
         {
             return lastServicesSet;
         }
         if (serviceTable != null)
         {
             lastServicesSet = new java.util.HashSet<Service>(serviceTable.values());
         }
         else
         {
             lastServicesSet = new java.util.HashSet<Service>();
         }
         if (propertyServiceTable != null)
         {
             lastServicesSet.addAll(propertyServiceTable.values());
         }
         lastServicesSet = java.util.Collections<Object>.unmodifiableSet(lastServicesSet);
         return lastServicesSet;
     }
 }
예제 #33
0
 private void servicesChanged()
 {
     lastServicesByType = null;
     lastServiceName = null;
     lastServicesSet = null;
 }
 protected internal SetListListIterator(java.util.ListIterator<Object> it, java.util.Set<Object> set)
     : base(it)
 {
     this.setJ = set;
 }
예제 #35
0
 protected internal virtual void getCorrespondingTerminalNodes(ViewGraphNode root, Set target)
 {
     BaseNode n = root.ReteNode;
     if (n is TerminalNode)
         target.add(n);
     Iterator it = root.childs.iterator();
     while (it.hasNext())
     {
         ViewGraphNode succ = (ViewGraphNode) it.next();
         getCorrespondingTerminalNodes(succ, target);
     }
 }
        /// <summary>
        /// Adds the given assembly to the included set, if and only
        /// if it is not contained by the encountered set and it
        /// is not a system assembly; a core HSQLDB assembly; an
        /// IKVM assembly; an NUnit assembly or a TestDriven.NET
        /// assembly.
        /// </summary>
        /// <remarks>
        /// The exclusion list could be made much larger to produce
        /// a higher quality included set, but at what price?
        /// </remarks>
        /// <param name="encountered">The assemblies encountered so far.</param>
        /// <param name="included">The assemblies included so far.</param>
        /// <param name="entry">The assembly to add.</param>
        internal static void AddAssembly(
            Set encountered,
            Set included,
            Assembly entry)
        {
            if (entry == null || encountered.contains(entry))
            {
                return;
            }
            else
            {
                encountered.add(entry);
            }

            string simpleName = entry.GetName().Name;

            // ignored (performance optimization)
            if (simpleName == "System"
                || simpleName == "mscorlib"
                || simpleName == "Org.Hsqldb"
                || simpleName.StartsWith("System.")
                || simpleName.StartsWith("IKVM.")
                || simpleName.StartsWith("nunit.")
                || simpleName.StartsWith("TestDriven."))
            {
                return;
            }
            else
            {
                included.add(entry);
            }

            try
            {
                Assembly satellite =
                    entry.GetSatelliteAssembly(CultureInfo.CurrentCulture);

                IkvmResourceLoaderFactory.AddAssembly(
                    encountered,
                    included,
                    satellite);
            }
            catch (Exception ex)
            {
            #if DEBUG
                Debug.WriteLine(ex);
            #endif
            }

            AssemblyName[] referencedAssemblies
                = entry.GetReferencedAssemblies();

            for (int i = 0; i < referencedAssemblies.Length; i++)
            {
                AssemblyName assemblyName = referencedAssemblies[i];

                try
                {
                    Assembly referencedAssembly
                        = Assembly.Load(assemblyName);

                    IkvmResourceLoaderFactory.AddAssembly(
                        encountered,
                        included,
                        referencedAssembly);
                }
                catch (System.Exception ex)
                {
            #if DEBUG
                    Debug.WriteLine(ex);
            #endif
                }
            }
        }