Contract.Exists メソッド

定義

オーバーロード

Exists(Int32, Int32, Predicate<Int32>)

ある整数範囲内のすべての整数について指定したテストが true かどうかを判定します。

Exists<T>(IEnumerable<T>, Predicate<T>)

ある要素のコレクション内の要素が関数内に存在するかどうかを判断します。

Exists(Int32, Int32, Predicate<Int32>)

ソース:
Contracts.cs
ソース:
Contracts.cs
ソース:
Contracts.cs

ある整数範囲内のすべての整数について指定したテストが true かどうかを判定します。

public:
 static bool Exists(int fromInclusive, int toExclusive, Predicate<int> ^ predicate);
public static bool Exists (int fromInclusive, int toExclusive, Predicate<int> predicate);
static member Exists : int * int * Predicate<int> -> bool
Public Shared Function Exists (fromInclusive As Integer, toExclusive As Integer, predicate As Predicate(Of Integer)) As Boolean

パラメーター

fromInclusive
Int32

predicate に渡す最初の整数。

toExclusive
Int32

predicate に渡す最後の整数より 1 だけ大きい数。

predicate
Predicate<Int32>

指定した範囲内の任意の整数値を評価する関数。

戻り値

predicate から fromInclusive - 1 の範囲の任意の整数に対して、toExclusivetrue を返す場合は true

例外

predicatenullです。

toExclusivefromInclusive より小さい値です。

注釈

パラメーターは toExclusive 、0 から始まる整数の範囲の長さを使用しやすくするために、最後の整数より 1 つ多くなります。 たとえば、整数 0 から 4 の場合は 5 に設定されます。

適用対象

Exists<T>(IEnumerable<T>, Predicate<T>)

ソース:
Contracts.cs
ソース:
Contracts.cs
ソース:
Contracts.cs

ある要素のコレクション内の要素が関数内に存在するかどうかを判断します。

public:
generic <typename T>
 static bool Exists(System::Collections::Generic::IEnumerable<T> ^ collection, Predicate<T> ^ predicate);
public static bool Exists<T> (System.Collections.Generic.IEnumerable<T> collection, Predicate<T> predicate);
static member Exists : seq<'T> * Predicate<'T> -> bool
Public Shared Function Exists(Of T) (collection As IEnumerable(Of T), predicate As Predicate(Of T)) As Boolean

型パラメーター

T

collection に格納されている型。

パラメーター

collection
IEnumerable<T>

T の要素を に渡 predicateすために描画されるコレクション。

predicate
Predicate<T>

collection 内の要素を評価する関数。

戻り値

predicate 内の型 T の任意の要素に対して、collectiontrue を返す場合にのみ true

例外

collection または predicatenull です。

こちらもご覧ください

適用対象