annotate Limits/UnlimitedLimit.cs @ 100:fa8378a30ed2

* Add some Stream handling utilities no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 06 Mar 2011 14:51:05 +0000
parents 8290adbbc7c4
children
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>
58
8290adbbc7c4 Re #24: Add limit objects
IBBoard <dev@ibboard.co.uk>
parents: 57
diff changeset
12 public class UnlimitedLimit : AbstractLimit
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 }