当前位置: 首页>>代码示例>>C#>>正文


C# BitSet.Set方法代码示例

本文整理汇总了C#中System.Xml.Schema.BitSet.Set方法的典型用法代码示例。如果您正苦于以下问题:C# BitSet.Set方法的具体用法?C# BitSet.Set怎么用?C# BitSet.Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Schema.BitSet的用法示例。


在下文中一共展示了BitSet.Set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsSequenceFromAll

 private bool IsSequenceFromAll(XmlSchemaSequence derivedSequence, XmlSchemaAll baseAll)
 {
     if (!this.IsValidOccurrenceRangeRestriction(derivedSequence, baseAll) || (derivedSequence.Items.Count > baseAll.Items.Count))
     {
         return false;
     }
     BitSet set = new BitSet(baseAll.Items.Count);
     for (int i = 0; i < derivedSequence.Items.Count; i++)
     {
         int mappingParticle = this.GetMappingParticle((XmlSchemaParticle) derivedSequence.Items[i], baseAll.Items);
         if (mappingParticle < 0)
         {
             return false;
         }
         if (set[mappingParticle])
         {
             return false;
         }
         set.Set(mappingParticle);
     }
     for (int j = 0; j < baseAll.Items.Count; j++)
     {
         if (!set[j] && !this.IsParticleEmptiable((XmlSchemaParticle) baseAll.Items[j]))
         {
             return false;
         }
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:SchemaCollectionCompiler.cs

示例2: IsSequenceFromAll

 private bool IsSequenceFromAll(XmlSchemaSequence derivedSequence, XmlSchemaAll baseAll) {
     if (!IsValidOccurrenceRangeRestriction(derivedSequence, baseAll) || derivedSequence.Items.Count > baseAll.Items.Count) {
         return false;
     }
     BitSet map = new BitSet(baseAll.Items.Count);
     for (int j = 0; j < derivedSequence.Items.Count; ++j) {
         int i = GetMappingParticle((XmlSchemaParticle)derivedSequence.Items[j], baseAll.Items);
         if (i >= 0) {
             if (map[i]) {
                 return false;
             }
             else {
                 map.Set(i);
             }
         }
         else {
             return false;
         }
     }
     for (int i = 0; i < baseAll.Items.Count; i++) {
         if (!map[i] && !IsParticleEmptiable((XmlSchemaParticle)baseAll.Items[i])) {
             return false;
         }
     }
     return true;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:SchemaSetCompiler.cs

示例3: CalculateTotalFollowposForRangeNodes

        private BitSet[] CalculateTotalFollowposForRangeNodes(BitSet firstpos, BitSet[] followpos, out BitSet posWithRangeTerminals) {
            int positionsCount = positions.Count; //terminals
            posWithRangeTerminals = new BitSet(positionsCount);
            
            //Compute followpos for each range node
            //For any range node that is surrounded by an outer range node, its follow positions will include those of the outer range node
            BitSet[] minmaxFollowPos = new BitSet[minMaxNodesCount];
            int localMinMaxNodesCount = 0;
            
            for (int i = positionsCount - 1;  i >= 0; i--) { 
                Position p = positions[i];
                if (p.symbol == -2) { //P is a LeafRangeNode
                    LeafRangeNode lrNode = p.particle as LeafRangeNode;
                    Debug.Assert(lrNode != null);
                    BitSet tempFollowPos = new BitSet(positionsCount);
                    tempFollowPos.Clear();
                    tempFollowPos.Or(followpos[i]); //Add the followpos of the range node
                    if (lrNode.Min != lrNode.Max) { //If they are the same, then followpos cannot include the firstpos
                        tempFollowPos.Or(lrNode.NextIteration); //Add the nextIteration of the range node (this is the firstpos of its parent's leftChild)
                    }

                    //For each position in the bitset, if it is a outer range node (pos > i), then add its followpos as well to the current node's followpos
                    for (int pos = tempFollowPos.NextSet(-1); pos != -1; pos = tempFollowPos.NextSet(pos)) {
                        if (pos > i) {
                            Position p1 = positions[pos];
                            if (p1.symbol == -2) {
                                LeafRangeNode lrNode1 = p1.particle as LeafRangeNode;
                                Debug.Assert(lrNode1 != null);
                                tempFollowPos.Or(minmaxFollowPos[lrNode1.Pos]);
                            }
                        }
                    }
                    //set the followpos built to the index in the BitSet[]
                    minmaxFollowPos[localMinMaxNodesCount] = tempFollowPos; 
                    lrNode.Pos = localMinMaxNodesCount++; 
                    posWithRangeTerminals.Set(i);
                }
            }
            return minmaxFollowPos;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:40,代码来源:ContentValidator.cs

示例4: ConstructPos

 public override void ConstructPos(BitSet firstpos, BitSet lastpos, BitSet[] followpos) {
     firstpos.Set(pos);
     lastpos.Set(pos);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:ContentValidator.cs

示例5: CalculateTotalFollowposForRangeNodes

 private BitSet[] CalculateTotalFollowposForRangeNodes(BitSet firstpos, BitSet[] followpos, out BitSet posWithRangeTerminals)
 {
     int count = this.positions.Count;
     posWithRangeTerminals = new BitSet(count);
     BitSet[] setArray = new BitSet[this.minMaxNodesCount];
     int index = 0;
     for (int i = count - 1; i >= 0; i--)
     {
         Position position = this.positions[i];
         if (position.symbol == -2)
         {
             LeafRangeNode particle = position.particle as LeafRangeNode;
             BitSet set = new BitSet(count);
             set.Clear();
             set.Or(followpos[i]);
             if (particle.Min != particle.Max)
             {
                 set.Or(particle.NextIteration);
             }
             for (int j = set.NextSet(-1); j != -1; j = set.NextSet(j))
             {
                 if (j > i)
                 {
                     Position position2 = this.positions[j];
                     if (position2.symbol == -2)
                     {
                         LeafRangeNode node2 = position2.particle as LeafRangeNode;
                         set.Or(setArray[node2.Pos]);
                     }
                 }
             }
             setArray[index] = set;
             particle.Pos = index++;
             posWithRangeTerminals.Set(i);
         }
     }
     return setArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:38,代码来源:ParticleContentValidator.cs


注:本文中的System.Xml.Schema.BitSet.Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。