サンプリング
bookmark_borderbookmark
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
public struct Sampling<Base: Collection, Selection: Collection>
where Selection.Element == Base.Index
extension Sampling: SamplingProtocol
extension Sampling: Collection
extension Sampling: BidirectionalCollection
where Selection: BidirectionalCollection
extension Sampling: RandomAccessCollection
where Selection: RandomAccessCollection
何らかの基本コレクションから、指定された順序で要素を遅延選択します。
base
とselection
からインスタンスを作成します。
宣言
public init(base: Base, selection: Selection)
宣言
public typealias Element = Base.Element
宣言
public typealias Index = Selection.Index
宣言
public var startIndex: Index { get }
宣言
public var endIndex: Index { get }
start
をend
に変換するために必要な前進ステップ数を返します。
負の結果はend < start
であることを示します。
宣言
public func distance(from start: Index, to end: Index) -> Int
宣言
public func index(_ i: Index, offsetBy n: Int) -> Index
limit
を渡す必要がない限り、 distance
によってオフセットされたi
返します。その場合、 nil
が返されます。
宣言
public func index(
_ i: Index, offsetBy distance: Int, limitedBy limit: Index
) -> Index?
`Selection`: `BidirectionalCollection` で利用可能
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-01-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-01-04 UTC。"],[],[]]