<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FCollections_Data_Structure%2FBitArray</id>
		<title>Csharp/C Sharp/Collections Data Structure/BitArray - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FCollections_Data_Structure%2FBitArray"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Collections_Data_Structure/BitArray&amp;action=history"/>
		<updated>2026-04-29T23:13:31Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Collections_Data_Structure/BitArray&amp;diff=662&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Collections_Data_Structure/BitArray&amp;diff=662&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Collections_Data_Structure/BitArray&amp;diff=663&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Collections_Data_Structure/BitArray&amp;diff=663&amp;oldid=prev"/>
				<updated>2010-05-26T11:39:24Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Demonstrate BitArray==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
// Demonstrate BitArray. &lt;br /&gt;
 &lt;br /&gt;
using System; &lt;br /&gt;
using System.Collections; &lt;br /&gt;
 &lt;br /&gt;
public class BADemo { &lt;br /&gt;
  public static void showbits(string rem, &lt;br /&gt;
                         BitArray bits) { &lt;br /&gt;
    Console.WriteLine(rem); &lt;br /&gt;
    for(int i=0; i &amp;lt; bits.Count; i++) &lt;br /&gt;
      Console.Write(&amp;quot;{0, -6} &amp;quot;, bits[i]); &lt;br /&gt;
    Console.WriteLine(&amp;quot;\n&amp;quot;); &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    BitArray ba = new BitArray(8); &lt;br /&gt;
    byte[] b = { 67 }; &lt;br /&gt;
    BitArray ba2 = new BitArray(b); &lt;br /&gt;
     &lt;br /&gt;
    showbits(&amp;quot;Original contents of ba:&amp;quot;, ba); &lt;br /&gt;
       &lt;br /&gt;
    ba = ba.Not(); &lt;br /&gt;
 &lt;br /&gt;
    showbits(&amp;quot;Contents of ba after Not:&amp;quot;, ba); &lt;br /&gt;
 &lt;br /&gt;
    showbits(&amp;quot;Contents of ba2:&amp;quot;, ba2); &lt;br /&gt;
 &lt;br /&gt;
    BitArray ba3 = ba.Xor(ba2); &lt;br /&gt;
 &lt;br /&gt;
    showbits(&amp;quot;Result of ba XOR ba2:&amp;quot;, ba3); &lt;br /&gt;
  } &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==illustrates the use of a BitArray==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  illustrates the use of a BitArray&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
public class Example11_4&lt;br /&gt;
{&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    // create a BitArray object&lt;br /&gt;
    BitArray myBitArray = new BitArray(4);&lt;br /&gt;
    // display the Length property&lt;br /&gt;
    Console.WriteLine(&amp;quot;myBitArray.Length = &amp;quot; +&lt;br /&gt;
      myBitArray.Length);&lt;br /&gt;
    // set the four elements of the BitArray&lt;br /&gt;
    myBitArray[0] = false;&lt;br /&gt;
    myBitArray[1] = true;&lt;br /&gt;
    myBitArray[2] = true;&lt;br /&gt;
    myBitArray[3] = false;&lt;br /&gt;
    // display the elements of the BitArray&lt;br /&gt;
    for (int counter = 0; counter &amp;lt; myBitArray.Count; counter++)&lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(&amp;quot;myBitArray[&amp;quot; + counter + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myBitArray[counter]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==illustrates the use of BitArray methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Mastering Visual C# .NET&lt;br /&gt;
by Jason Price, Mike Gunderloy&lt;br /&gt;
Publisher: Sybex;&lt;br /&gt;
ISBN: 0782129110&lt;br /&gt;
*/&lt;br /&gt;
/*&lt;br /&gt;
  Example11_5.cs illustrates the use of BitArray methods&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
public class Example11_5&lt;br /&gt;
{&lt;br /&gt;
  // the DisplayBitArray() method displays the elements in the&lt;br /&gt;
  // supplied BitArray&lt;br /&gt;
  public static void DisplayBitArray(&lt;br /&gt;
    string arrayListName, BitArray myBitArray&lt;br /&gt;
  )&lt;br /&gt;
  {&lt;br /&gt;
    for (int counter = 0; counter &amp;lt; myBitArray.Count; counter++)&lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(arrayListName + &amp;quot;[&amp;quot; + counter + &amp;quot;] = &amp;quot; +&lt;br /&gt;
        myBitArray[counter]);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    // create a BitArray object&lt;br /&gt;
    BitArray myBitArray = new BitArray(4);&lt;br /&gt;
    myBitArray[0] = false;&lt;br /&gt;
    myBitArray[1] = true;&lt;br /&gt;
    myBitArray[2] = true;&lt;br /&gt;
    myBitArray[3] = false;&lt;br /&gt;
    DisplayBitArray(&amp;quot;myBitArray&amp;quot;, myBitArray);&lt;br /&gt;
    // create another BitArray object, passing myBitArray to&lt;br /&gt;
    // the constructor&lt;br /&gt;
    BitArray anotherBitArray = new BitArray(myBitArray);&lt;br /&gt;
    DisplayBitArray(&amp;quot;anotherBitArray&amp;quot;, myBitArray);&lt;br /&gt;
    // use the Not() method to reverse the elements in myBitArray&lt;br /&gt;
    Console.WriteLine(&amp;quot;Using the Not() method to reverse the element\n&amp;quot; +&lt;br /&gt;
      &amp;quot; values in myBitArray&amp;quot;);&lt;br /&gt;
    myBitArray.Not();&lt;br /&gt;
    DisplayBitArray(&amp;quot;myBitArray&amp;quot;, myBitArray);&lt;br /&gt;
    // use the Or() method to perform an OR operation on the elements&lt;br /&gt;
    // in myBitArray and anotherBitArray&lt;br /&gt;
    Console.WriteLine(&amp;quot;Using the Or() method to perform an OR operation on\n&amp;quot; +&lt;br /&gt;
      &amp;quot; the elements in myBitArray and anotherBitArray&amp;quot;);&lt;br /&gt;
    myBitArray.Or(anotherBitArray);&lt;br /&gt;
    DisplayBitArray(&amp;quot;myBitArray&amp;quot;, myBitArray);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use BitArray collection as Flag==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
public class Starter {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Hashtable employees = new Hashtable();&lt;br /&gt;
        employees.Add(&amp;quot;A100&amp;quot;, new Employee(&amp;quot;Ben&amp;quot;, true, false, true));&lt;br /&gt;
        employees.Add(&amp;quot;V100&amp;quot;, new Employee(&amp;quot;Valerie&amp;quot;, false, false, true));&lt;br /&gt;
        Participation((Employee)employees[&amp;quot;A100&amp;quot;]);&lt;br /&gt;
        Participation((Employee)employees[&amp;quot;V100&amp;quot;]);&lt;br /&gt;
    }&lt;br /&gt;
    public static void Participation(Employee person) {&lt;br /&gt;
        Console.WriteLine(person.Name + &amp;quot;:&amp;quot;);&lt;br /&gt;
        if (person.InProfitSharing) {&lt;br /&gt;
            Console.WriteLine(&amp;quot; Participating in Profit Sharing&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        if (person.InHealthPlan) {&lt;br /&gt;
            Console.WriteLine(&amp;quot; Participating in Health Plan&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        if (person.InCreditUnion) {&lt;br /&gt;
            Console.WriteLine(&amp;quot; Participating in Credit Union&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class Employee {&lt;br /&gt;
    public Employee(string emplName) {&lt;br /&gt;
        propName = emplName;&lt;br /&gt;
        eflags.SetAll(true);&lt;br /&gt;
    }&lt;br /&gt;
    public Employee(string emplName,&lt;br /&gt;
                    bool profitSharing,&lt;br /&gt;
                    bool healthPlan,&lt;br /&gt;
                    bool creditUnion) {&lt;br /&gt;
        propName = emplName;&lt;br /&gt;
        InProfitSharing = profitSharing;&lt;br /&gt;
        InHealthPlan = healthPlan;&lt;br /&gt;
        InCreditUnion = creditUnion;&lt;br /&gt;
    }&lt;br /&gt;
    private BitArray eflags = new BitArray(3);&lt;br /&gt;
    public bool InProfitSharing {&lt;br /&gt;
        set {&lt;br /&gt;
            eflags.Set(0, value);&lt;br /&gt;
        }&lt;br /&gt;
        get {&lt;br /&gt;
            return eflags.Get(0);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public bool InHealthPlan {&lt;br /&gt;
        set {&lt;br /&gt;
            eflags.Set(1, value);&lt;br /&gt;
        }&lt;br /&gt;
        get {&lt;br /&gt;
            return eflags.Get(1);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public bool InCreditUnion {&lt;br /&gt;
        set {&lt;br /&gt;
            eflags.Set(2, value);&lt;br /&gt;
        }&lt;br /&gt;
        get {&lt;br /&gt;
            return eflags.Get(2);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private string propName;&lt;br /&gt;
    public string Name {&lt;br /&gt;
        get {&lt;br /&gt;
            return propName;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>