Project

General

Profile

root / branches / compiler / cSharp / ooasCompiler / src / libs / c5 / C5 / Enums.cs @ 3

1
/*
2
 Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
3
 Permission is hereby granted, free of charge, to any person obtaining a copy
4
 of this software and associated documentation files (the "Software"), to deal
5
 in the Software without restriction, including without limitation the rights
6
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
 copies of the Software, and to permit persons to whom the Software is
8
 furnished to do so, subject to the following conditions:
9
 
10
 The above copyright notice and this permission notice shall be included in
11
 all copies or substantial portions of the Software.
12
 
13
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
 SOFTWARE.
20
*/
21

    
22
using System;
23
using System.Diagnostics;
24
using SCG = System.Collections.Generic;
25
namespace C5
26
{
27

    
28
  /// <summary>
29
  /// The symbolic characterization of the speed of lookups for a collection.
30
  /// The values may refer to worst-case, amortized and/or expected asymtotic 
31
  /// complexity wrt. the collection size.
32
  /// </summary>
33
  public enum Speed : short
34
  {
35
    /// <summary>
36
    /// Counting the collection with the <code>Count property</code> may not return
37
    /// (for a synthetic and potentially infinite collection).
38
    /// </summary>
39
    PotentiallyInfinite = 1,
40
    /// <summary>
41
    /// Lookup operations like <code>Contains(T item)</code> or the <code>Count</code>
42
    /// property may take time O(n),
43
    /// where n is the size of the collection.
44
    /// </summary>
45
    Linear = 2,
46
    /// <summary>
47
    /// Lookup operations like <code>Contains(T item)</code> or the <code>Count</code>
48
    /// property  takes time O(log n),
49
    /// where n is the size of the collection.
50
    /// </summary>
51
    Log = 3,
52
    /// <summary>
53
    /// Lookup operations like <code>Contains(T item)</code> or the <code>Count</code>
54
    /// property  takes time O(1),
55
    /// where n is the size of the collection.
56
    /// </summary>
57
    Constant = 4
58
  }
59
  /*
60
  /// <summary>
61
  /// 
62
  /// </summary>
63
  public enum ItemEqualityTypeEnum
64
  {
65
    /// <summary>
66
    /// Only an Equals(T,T)
67
    /// </summary>
68
    Equator, 
69
    /// <summary>
70
    /// Equals(T,T) and GetHashCode(T)
71
    /// </summary>
72
    HashingEqualityComparer, 
73
    /// <summary>
74
    /// Compare(T,T)
75
    /// </summary>
76
    Comparer, 
77
    /// <summary>
78
    /// Compatible Compare(T,T) and GetHashCode(T)
79
    /// </summary>
80
    Both
81
  }
82
*/
83

    
84
  /// <summary>
85
  /// Direction of enumeration order relative to original collection.
86
  /// </summary>
87
  public enum EnumerationDirection
88
  {
89
    /// <summary>
90
    /// Same direction
91
    /// </summary>
92
    Forwards,
93
    /// <summary>
94
    /// Opposite direction
95
    /// </summary>
96
    Backwards
97
  }
98
}