annotate Limits/UnlimitedLimit.cs @ 57:44bc5bd5c2f3

Re #24: Add limit objects * Create base interface * Create marker interface for percentage and numeric limits * Make classes implement appropriate interfaces
author IBBoard <dev@ibboard.co.uk>
date Sat, 24 Oct 2009 15:42:05 +0000
parents b52c2511a1e3
children 8290adbbc7c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (UnlimitedLimit.cs) is a part of the IBBoard project and is copyright 2009 IBBoard
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license.
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 namespace IBBoard.Limits
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 {
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 /// <summary>
55
b52c2511a1e3 Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 53
diff changeset
10 /// A special case "infinite" limit that always returns the integer number closest to infinity.
53
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 /// </summary>
57
44bc5bd5c2f3 Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
12 public class UnlimitedLimit : AbstractLimit, INumericLimit
53
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 public UnlimitedLimit () : base(double.PositiveInfinity)
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 {
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 }
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 public override int GetLimit (int size)
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 {
55
b52c2511a1e3 Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 53
diff changeset
20 return int.MaxValue;
53
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 }
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 }
12117b04ebc1 Re #24: Add "limit" objects
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 }