remove svn:executable from .cs files
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Addressing / AddressList.cs
1 //
2 // Microsoft.Web.Services.Addressing.AddressList.cs
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
7
8 using System;
9 using System.Collections;
10
11 namespace Microsoft.Web.Services.Addressing
12 {
13
14         public class AddressList : ICollection, IEnumerable
15         {
16
17                 private ArrayList _list;
18
19                 public AddressList ()
20                 {
21                         _list = new ArrayList ();
22                 }
23
24                 public int Add (Address address)
25                 {
26                         if(address == null) {
27                                 throw new ArgumentNullException ("address");
28                         }
29                         return _list.Add (address);
30                 }
31
32                 public bool Contains (Address address)
33                 {
34                         if(address == null) {
35                                 throw new ArgumentNullException ("address");
36                         }
37                         return _list.Contains (address);
38                 }
39
40                 public void CopyTo (Array array, int index)
41                 {
42                         if(array == null) {
43                                 throw new ArgumentNullException ("array");
44                         }
45                         if(index < 0 || index > _list.Count) {
46                                 throw new ArgumentOutOfRangeException ("index");
47                         }
48                         _list.CopyTo (array, index);
49                 }
50
51                 public IEnumerator GetEnumerator ()
52                 {
53                         return _list.GetEnumerator ();
54                 }
55
56                 public int IndexOf (Address address)
57                 {
58                         if(address == null) {
59                                 throw new ArgumentNullException ("address");
60                         }
61                         return _list.IndexOf (address);
62                 }
63
64                 public void Insert (int index, Address address)
65                 {
66                         if(index < 0 || index > _list.Count) {
67                                 throw new ArgumentOutOfRangeException ("index");
68                         }
69                         if(address == null) {
70                                 throw new ArgumentNullException ("address");
71                         }
72                         _list.Insert (index, address);
73                 }
74
75                 public void Remove (Address address)
76                 {
77                         _list.Remove (address);
78                 }
79
80                 public void RemoveAt (int index)
81                 {
82                         if (index < 0 || index > _list.Count) {
83                                 throw new ArgumentOutOfRangeException ("index");
84                         }
85                         _list.RemoveAt (index);
86                 }
87
88                 public int Count {
89                         get { return _list.Count; }
90                 }
91
92                 public bool IsFixedSize {
93                         get { return _list.IsFixedSize; }
94                 }
95
96                 public bool IsReadOnly {
97                         get { return _list.IsReadOnly; }
98                 }
99
100                 public bool IsSynchronized {
101                         get { return _list.IsSynchronized; }
102                 }
103
104                 public Address this[int index] {
105                         get {
106                                 if(index < 0 || index > _list.Count) {
107                                         throw new ArgumentOutOfRangeException ("index");
108                                 }
109                                 return (Address) _list[index];
110                         }
111                         set {
112                                 if(index < 0 || index > _list.Count) {
113                                         throw new ArgumentOutOfRangeException ("index");
114                                 }
115                                 _list[index] = value;
116                         }
117                 }
118
119                 public object SyncRoot {
120                         get { return _list.SyncRoot; }
121                 }
122         }
123 }