Esempio n. 1
0
 /*(non-Javadoc) <see cref="Lucene.Net.Search.Query.extractTerms(java.util.Set) */
 public override void ExtractTerms(System.Collections.Generic.ISet <Term> terms)
 {
     subQuery.ExtractTerms(terms);
     for (int i = 0; i < valSrcQueries.Length; i++)
     {
         valSrcQueries[i].ExtractTerms(terms);
     }
 }
Esempio n. 2
0
 public static E CollectionSetFirst <E>(System.Collections.Generic.ISet <E> set)
 {
     foreach (E e in set)
     {
         return(e);
     }
     return(default(E));
 }
Esempio n. 3
0
 public virtual Net.Vpc.Upa.UpdateQuery AddUpdatableFields(System.Collections.Generic.ICollection <string> names)
 {
     if (partialUpdateFields == null)
     {
         partialUpdateFields = new System.Collections.Generic.HashSet <string>();
     }
     Net.Vpc.Upa.Impl.FwkConvertUtils.CollectionAddRange(partialUpdateFields, names);
     return(this);
 }
Esempio n. 4
0
 public virtual System.Collections.Generic.ISet <string> GetPropertyNames()
 {
     if (propertyNames == null)
     {
         LoadProperties();
         propertyNames = new System.Collections.Generic.HashSet <string>(new System.Collections.Generic.HashSet <string>(properties.Keys));
     }
     return(propertyNames);
 }
Esempio n. 5
0
 public virtual Net.Vpc.Upa.UpdateQuery AddUpdatableField(string name)
 {
     if (partialUpdateFields == null)
     {
         partialUpdateFields = new System.Collections.Generic.HashSet <string>();
     }
     partialUpdateFields.Add(name);
     return(this);
 }
Esempio n. 6
0
 private void VisitInternalWithStackWrapping(
     Type type,
     System.Collections.Generic.Stack <TypeVisit> stack,
     System.Collections.Generic.ISet <Type> visitedSet,
     TypeVisit typeVisit)
 {
     stack.Push(typeVisit);
     VisitInternal(stack, visitedSet);
     stack.Pop();
 }
Esempio n. 7
0
        public void TestGetSet()
        {
            IMultiMap <int, int> map = HashMultiMap <int, int> .Create();

            map.Add(2, 3);
            map.Add(2, 4);
            map.Add(2, 5);
            System.Collections.Generic.ISet <int> set = map.GetSet(2);
            Assert.IsTrue(set.Contains(3));
            Assert.IsTrue(set.Contains(4));
            Assert.IsTrue(set.Contains(5));
        }
Esempio n. 8
0
        /**
         * {@inheritDoc}
         */

        public virtual bool RetainAll(System.Collections.Generic.ISet <string> keys)
        {
            bool modified = false;

            System.Collections.Generic.HashSet <string> k = new System.Collections.Generic.HashSet <string>(KeySet());
            Net.Vpc.Upa.Impl.FwkConvertUtils.SetRemoveRange(k, keys);
            foreach (string s in k)
            {
                modified = true;
                Remove(s);
            }
            return(modified);
        }
Esempio n. 9
0
 public virtual Net.Vpc.Upa.UpdateQuery Update(System.Collections.Generic.ICollection <string> partialUpdateFields)
 {
     if (partialUpdateFields != null)
     {
         System.Collections.Generic.HashSet <string> s = new System.Collections.Generic.HashSet <string>(partialUpdateFields);
         if (this.partialUpdateFields != null)
         {
             Net.Vpc.Upa.Impl.FwkConvertUtils.CollectionAddRange(s, this.partialUpdateFields);
         }
         this.partialUpdateFields = s;
     }
     return(this);
 }
Esempio n. 10
0
 public virtual System.Collections.Generic.ISet <string> GetPropertyNames()
 {
     if (propertyNames == null)
     {
         System.Collections.Generic.HashSet <string> t = new System.Collections.Generic.HashSet <string>();
         foreach (Net.Vpc.Upa.Field f in entity.GetFields())
         {
             t.Add(f.GetName());
         }
         propertyNames = t;
     }
     return(new System.Collections.Generic.HashSet <string>(propertyNames));
 }
Esempio n. 11
0
        public override void SetValue(object[] @value)
        {
            object o = userObject;

            System.Collections.Generic.ISet <string> names = nfo.GetPropertyNames();
            int i = 0;

            foreach (string name in names)
            {
                nfo.SetProperty(o, name, @value[i]);
                i++;
            }
        }
Esempio n. 12
0
 protected internal virtual int ValidateCustomUpdaterFormula(System.Collections.Generic.ISet <Net.Vpc.Upa.Field> fields) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     System.Collections.Generic.HashSet <Net.Vpc.Upa.CustomUpdaterFormula> unique = new System.Collections.Generic.HashSet <Net.Vpc.Upa.CustomUpdaterFormula>();
     foreach (Net.Vpc.Upa.Field field in fields)
     {
         Net.Vpc.Upa.CustomUpdaterFormula c = (Net.Vpc.Upa.CustomUpdaterFormula)(onPersist ? field.GetPersistFormula() : field.GetUpdateFormula());
         unique.Add(c);
     }
     foreach (Net.Vpc.Upa.CustomUpdaterFormula f in unique)
     {
         f.UpdateFormula(fields, expr, context);
     }
     return((int)entity.GetEntityCount(expr));
 }
Esempio n. 13
0
        public override bool RetainAll(System.Collections.Generic.ISet <string> keys)
        {
            bool modified = false;

            foreach (string s in new System.Collections.Generic.HashSet <string>(new System.Collections.Generic.HashSet <string>(@base.Keys)))
            {
                if (!keys.Contains(s))
                {
                    @base.Remove(s);
                    modified = true;
                }
            }
            return(modified);
        }
Esempio n. 14
0
        public override System.Collections.Generic.ISet <string> KeySet()
        {
            bool?includeDefaults = null;

            if (ignoreUnspecified)
            {
                includeDefaults = false;
            }
            System.Collections.Generic.ISet <string> keySet = nfo.GetPropertyNames(userObject, includeDefaults);
            if (extra != null && (extra).Count > 0)
            {
                Net.Vpc.Upa.Impl.FwkConvertUtils.CollectionAddRange(keySet, new System.Collections.Generic.HashSet <string>(extra.Keys));
            }
            return(keySet);
        }
Esempio n. 15
0
        public override object[] GetValue()
        {
            object o = userObject;

            System.Collections.Generic.ISet <string> names = nfo.GetPropertyNames();
            object[] v = new object[(names).Count];
            int      i = 0;

            foreach (string name in names)
            {
                v[i] = nfo.GetProperty(o, name);
                i++;
            }
            return(v);
        }
Esempio n. 16
0
 public override string[] ListAll()
 {
     lock (this)
     {
         EnsureOpen();
         // TODO: may have better performance if our HashMap implmented KeySet() instead of generating one via HashSet
         System.Collections.Generic.ISet <string> fileNames = Support.Compatibility.SetFactory.GetSet(fileMap.Keys);
         string[] result = new string[fileNames.Count];
         int      i      = 0;
         foreach (string filename in fileNames)
         {
             result[i++] = filename;
         }
         return(result);
     }
 }
 public virtual int Compare(Net.Vpc.Upa.Entity o1, Net.Vpc.Upa.Entity o2)
 {
     System.Collections.Generic.ISet <string> s1 = FindEntityDependencies(o1);
     System.Collections.Generic.ISet <string> s2 = FindEntityDependencies(o2);
     if (s1.Contains(o2.GetName()) && s2.Contains(o1.GetName()))
     {
         return(o1.GetName().CompareTo(o2.GetName()));
     }
     else if (s1.Contains(o2.GetName()))
     {
         return(-1);
     }
     else if (s2.Contains(o1.GetName()))
     {
         return(1);
     }
     else
     {
         return(o1.GetName().CompareTo(o2.GetName()));
     }
 }
Esempio n. 18
0
 private bool Build()
 {
     if (this.fieldNames == null)
     {
         idEntity = entity.GetPersistenceUnit().FindEntity(idType);
         if (idEntity != null)
         {
             isEntityKey = true;
             System.Collections.Generic.IList <string> fn = new System.Collections.Generic.List <string>();
             //                for (Field primaryField : entity.getPrimaryFields()) {
             //                    fn.add(primaryField.getName());
             //                }
             this.fieldNames = fn.ToArray();
         }
         else
         {
             bnfo = Net.Vpc.Upa.Impl.Util.PlatformBeanTypeRepository.GetInstance().GetBeanType(idType);
             System.Collections.Generic.ISet <string> fn = bnfo.GetPropertyNames();
             this.fieldNames = fn.ToArray();
         }
     }
     return(isEntityKey);
 }
Esempio n. 19
0
 public virtual Net.Vpc.Upa.Config.Decoration[] GetDeclaredDecorations(string decorationName)
 {
     System.Collections.Generic.IList <Net.Vpc.Upa.Config.Decoration> all = new System.Collections.Generic.List <Net.Vpc.Upa.Config.Decoration>();
     System.Collections.Generic.ISet <string> found = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, System.Collections.Generic.ISet <string> >(typesByDecoration, decorationName);
     if (found != null)
     {
         foreach (string t in found)
         {
             Net.Vpc.Upa.Impl.Config.Decorations.DefaultDecorationRepositoryTypeInfo dd = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.Impl.Config.Decorations.DefaultDecorationRepositoryTypeInfo>(decorationsByType, t);
             if (dd != null)
             {
                 foreach (Net.Vpc.Upa.Config.Decoration d in dd.decorations)
                 {
                     if (d.GetName().Equals(decorationName))
                     {
                         all.Add(d);
                     }
                 }
             }
         }
     }
     Net.Vpc.Upa.Impl.FwkConvertUtils.ListSort(all, null);
     return(all.ToArray());
 }
Esempio n. 20
0
        protected internal virtual int ValidateCustomFormula(System.Collections.Generic.ISet <Net.Vpc.Upa.Field> fields) /* throws Net.Vpc.Upa.Exceptions.UPAException */
        {
            //                        if (monitor != null) {
            //                            if (monitor.isStopped()) {
            //                                return;
            //                            }
            //                            monitor.stepIn(keysToUpdate.size());
            //                        }
            int x = 0;

            foreach (object aKeysToUpdate in GetKeysToUpdate())
            {
                //                            if (monitor != null) {
                //                                if (monitor.isStopped()) {
                //                                    return;
                //                                }
                //                                monitor.progress(String.valueOf(validationPass.pass), "Passe "
                //                                        + (validationPass.pass + 1), null);
                //                            }
                // System.out.println("ITERATIVE_VALIDATION = " +
                // validationPass.pass+" : "+validationPass.fields+" :
                // "+keysToUpdate[r]);
                Net.Vpc.Upa.Record u = entity.GetBuilder().CreateRecord();
                foreach (Net.Vpc.Upa.Field field in fields)
                {
                    Net.Vpc.Upa.CustomFormula cf = (Net.Vpc.Upa.CustomFormula)(onPersist ? field.GetPersistFormula() : field.GetUpdateFormula());
                    object v = cf.GetValue(field, aKeysToUpdate, context);
                    u.SetObject(field.GetName(), new Net.Vpc.Upa.Expressions.Cast(new Net.Vpc.Upa.Expressions.Param(null, v), field.GetDataType()));
                }
                x += entity.UpdateCore(u, entity.GetBuilder().IdToExpression(aKeysToUpdate, entity.GetName()), context);
            }
            //                        if (monitor != null) {
            //                            monitor.stepOut();
            //                        }
            return(x);
        }
Esempio n. 21
0
 public override void  ExtractTerms(System.Collections.Generic.ISet <Term> terms)
 {
     terms.Add(Term);
 }
Esempio n. 22
0
 /// <summary> Expert: adds all terms occuring in this query to the terms set. Only
 /// works if this query is in its <see cref="Rewrite">rewritten</see> form.
 ///
 /// </summary>
 /// <throws>  UnsupportedOperationException if this query is not yet rewritten </throws>
 public virtual void ExtractTerms(System.Collections.Generic.ISet <Term> terms)
 {
     // needs to be implemented by query subclasses
     throw new System.NotSupportedException();
 }
Esempio n. 23
0
        protected override void DeleteEntity(IEventSource session, object entity, EntityEntry entityEntry, bool isCascadeDeleteEnabled, IEntityPersister persister, System.Collections.Generic.ISet <object> transientEntities)
        {
            var record = entity as IPermanentRecord;

            if (record != null)
            {
                record.Deleted = true;
            }
            else
            {
                base.DeleteEntity(session, entity, entityEntry, isCascadeDeleteEnabled, persister, transientEntities);
            }
        }
Esempio n. 24
0
 public virtual Net.Vpc.Upa.Bulk.DataColumn UpdateExtraNames(System.Collections.Generic.ISet <string> extraNames)
 {
     SetExtraNames(extraNames);
     return(this);
 }
 /*(non-Javadoc) <see cref="Lucene.Net.Search.Query.extractTerms(java.util.Set) */
 public override void  ExtractTerms(System.Collections.Generic.ISet <Term> terms)
 {
     // no terms involved here
 }
Esempio n. 26
0
 // inherit javadoc
 public override void  ExtractTerms(System.Collections.Generic.ISet <Term> terms)
 {
     Query.ExtractTerms(terms);
 }
Esempio n. 27
0
        protected override ICascadedInterceptor HandleServiceIntern(Ioc.Factory.IBeanContextFactory beanContextFactory, Ioc.IServiceContext beanContext, Ioc.Config.IBeanConfiguration beanConfiguration, System.Type type, System.Collections.Generic.ISet <System.Type> requestedTypes)
        {
            MergeContext mergeContext = mergeContextCache.GetAnnotation(type);

            if (mergeContext == null)
            {
                return(null);
            }
            IMethodLevelBehavior <Attribute> behavior = CreateInterceptorModeBehavior(type);

            MergeInterceptor mergeInterceptor = new MergeInterceptor();

            if (beanContext.IsRunning)
            {
                return(beanContext.RegisterWithLifecycle(mergeInterceptor) //
                       .PropertyValue("Behavior", behavior)                //
                       .IgnoreProperties("ServiceName")                    //
                       .Finish());
            }
            beanContextFactory.RegisterWithLifecycle(mergeInterceptor) //
            .PropertyValue("Behavior", behavior)                       //
            .IgnoreProperties("ServiceName");
            return(mergeInterceptor);
        }
Esempio n. 28
0
 public FieldCollectorCompiledExpressionVisitor(System.Collections.Generic.ISet <Net.Vpc.Upa.Field> usedFields)
 {
     this.usedFields = usedFields;
 }
Esempio n. 29
0
 /// <seealso cref="Lucene.Net.Search.Query.ExtractTerms(System.Collections.Generic.ISet{Term})">
 /// </seealso>
 public override void ExtractTerms(System.Collections.Generic.ISet <Term> queryTerms)
 {
     queryTerms.UnionWith(terms);
 }
Esempio n. 30
0
 public FieldAccessLevelFilter(bool checkPersist, bool checkUpdate, bool checkSelect, System.Collections.Generic.ISet <Net.Vpc.Upa.AccessLevel> accepted, bool dynamic)
 {
     this.checkPersist = checkPersist;
     this.checkUpdate  = checkUpdate;
     this.checkSelect  = checkSelect;
     this.dynamic      = dynamic;
     this.accepted     = new System.Collections.Generic.HashSet <Net.Vpc.Upa.AccessLevel>();
     if (accepted != null)
     {
         Net.Vpc.Upa.FwkConvertUtils.CollectionAddRange(this.accepted, accepted);
     }
 }