Struct LongSet
- Namespace
- ICSharpCode.Decompiler.Util
- Assembly
- ICSharpCode.Decompiler.dll
An immutable set of longs, that is implemented as a list of intervals.
public struct LongSet : IEquatable<LongSet>
- Implements
- Inherited Members
Constructors
LongSet(LongInterval)
Create a new LongSet that contains the values from the interval.
public LongSet(LongInterval interval)
Parameters
interval
LongInterval
LongSet(IEnumerable<LongInterval>)
Creates a new LongSet the contains the values from the specified intervals.
public LongSet(IEnumerable<LongInterval> intervals)
Parameters
intervals
IEnumerable<LongInterval>
LongSet(long)
Create a new LongSet that contains a single value.
public LongSet(long value)
Parameters
value
long
Fields
Empty
The empty LongSet.
public static readonly LongSet Empty
Field Value
Intervals
The intervals in this set of longs.
public readonly ImmutableArray<LongInterval> Intervals
Field Value
Remarks
Invariant: the intervals in this array are non-empty, non-overlapping, non-touching, and sorted.
This invariant ensures every LongSet is always in a normalized representation.
Universe
The LongSet that contains all possible long values.
public static readonly LongSet Universe
Field Value
Properties
IsEmpty
public bool IsEmpty { get; }
Property Value
Values
public IEnumerable<long> Values { get; }
Property Value
Methods
AddOffset(long)
Creates a new LongSet where val is added to each element of this LongSet.
public LongSet AddOffset(long val)
Parameters
val
long
Returns
Contains(long)
public bool Contains(long val)
Parameters
val
long
Returns
Count()
Gets the number of values in this LongSet.
Note: for LongSet.Universe
, the number of values does not fit into ulong
.
Instead, this property returns the off-by-one value ulong.MaxValue
to avoid overflow.
public ulong Count()
Returns
Equals(LongSet)
[Obsolete("Explicitly call SetEquals() instead.")]
public bool Equals(LongSet other)
Parameters
other
LongSet
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
ExceptWith(LongSet)
Creates a new set that contains all values that are in this
, but not in other
.
public LongSet ExceptWith(LongSet other)
Parameters
other
LongSet
Returns
GetHashCode()
public override int GetHashCode()
Returns
IntersectWith(LongSet)
public LongSet IntersectWith(LongSet other)
Parameters
other
LongSet
Returns
Invert()
Creates a new LongSet that contains all elements not contained in this LongSet.
public LongSet Invert()
Returns
IsProperSubsetOf(LongSet)
public bool IsProperSubsetOf(LongSet other)
Parameters
other
LongSet
Returns
IsProperSupersetOf(LongSet)
public bool IsProperSupersetOf(LongSet other)
Parameters
other
LongSet
Returns
IsSubsetOf(LongSet)
Gets whether this set is a subset of other, or equal.
public bool IsSubsetOf(LongSet other)
Parameters
other
LongSet
Returns
IsSupersetOf(LongSet)
Gets whether this set is a superset of other, or equal.
public bool IsSupersetOf(LongSet other)
Parameters
other
LongSet
Returns
Overlaps(LongSet)
public bool Overlaps(LongSet other)
Parameters
other
LongSet
Returns
SetEquals(LongSet)
public bool SetEquals(LongSet other)
Parameters
other
LongSet
Returns
ToString()
public override string ToString()
Returns
UnionWith(LongSet)
public LongSet UnionWith(LongSet other)
Parameters
other
LongSet