0001 public struct RandomAccessHopCollection< 0002 Base
Hopping.swift:14 public typealias SubSequence = RandomAccessHopCollection<Base>Hopping.swift:20 public func generate() -> IndexingGenerator<RandomAccessHopCollection<Base>> {Hopping.swift:42 return RandomAccessHopCollection(base, by, from: r.startIndex, to: r.endIndex)Hopping.swift:48 return RandomAccessHopCollection(self, by)Hopping.swift:52 extension RandomAccessHopCollection: CustomStringConvertible, CustomDebugStringConvertible {: CollectionType where 0003 Base.Index : RandomAccessIndexType, 0004 Base.Index.Distance : ForwardIndexType 0005 >: CollectionType { 0006 0007 private let base
Hopping.swift:7 private let base: BaseHopping.swift:8 private let by : Base.Index.StrideHopping.swift:9 private let fac : Base.Index.DistanceHopping.swift:11 public let startIndex: Base.Index.DistanceHopping.swift:12 public let endIndex: Base.Index.DistanceHopping.swift:14 public typealias SubSequence = RandomAccessHopCollection<Base>Hopping.swift:20 public func generate() -> IndexingGenerator<RandomAccessHopCollection<Base>> {Hopping.swift:24 private init(_ b: Base, _ by: Base.Index.Stride) {Hopping.swift:24 private init(_ b: Base, _ by: Base.Index.Stride) {Hopping.swift:33 private init(_ b: Base, _ by: Base.Index.Stride, from: Base.Index.Distance, to: Base.Index.Distance) {Hopping.swift:33 private init(_ b: Base, _ by: Base.Index.Stride, from: Base.Index.Distance, to: Base.Index.Distance) {Hopping.swift:33 private init(_ b: Base, _ by: Base.Index.Stride, from: Base.Index.Distance, to: Base.Index.Distance) {Hopping.swift:33 private init(_ b: Base, _ by: Base.Index.Stride, from: Base.Index.Distance, to: Base.Index.Distance) {: Base 0008 private let by
Hopping.swift:17 return base[base.startIndex.advancedBy(fac * i)]Hopping.swift:17 return base[base.startIndex.advancedBy(fac * i)]Hopping.swift:25 base = bHopping.swift:27 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by))Hopping.swift:27 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by))Hopping.swift:28 if base.isEmpty { endIndex = 0 }Hopping.swift:29 else { endIndex = (base.startIndex.distanceTo(base.endIndex.predecessor()) / fac).successor() }Hopping.swift:29 else { endIndex = (base.startIndex.distanceTo(base.endIndex.predecessor()) / fac).successor() }Hopping.swift:34 base = bHopping.swift:36 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by))Hopping.swift:36 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by))Hopping.swift:42 return RandomAccessHopCollection(base, by, from: r.startIndex, to: r.endIndex): Base.Index.Stride 0009 private let fac
Hopping.swift:26 self.by = byHopping.swift:35 self.by = byHopping.swift:42 return RandomAccessHopCollection(base, by, from: r.startIndex, to: r.endIndex): Base.Index.Distance 0010 0011 public let startIndex
Hopping.swift:17 return base[base.startIndex.advancedBy(fac * i)]Hopping.swift:27 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by))Hopping.swift:29 else { endIndex = (base.startIndex.distanceTo(base.endIndex.predecessor()) / fac).successor() }Hopping.swift:36 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by)): Base.Index.Distance 0012 public let endIndex
Hopping.swift:30 startIndex = 0Hopping.swift:37 startIndex = from: Base.Index.Distance 0013 0014 public typealias SubSequence = RandomAccessHopCollection<Base> 0015 0016 public subscript(i: Base.Index.Distance) -> Base.Generator.Element { 0017 return base[base.startIndex.advancedBy(fac * i)] 0018 } 0019 0020 public func generate() -> IndexingGenerator<RandomAccessHopCollection<Base>> { 0021 return IndexingGenerator(self) 0022 } 0023 0024 private init
Hopping.swift:28 if base.isEmpty { endIndex = 0 }Hopping.swift:29 else { endIndex = (base.startIndex.distanceTo(base.endIndex.predecessor()) / fac).successor() }Hopping.swift:38 endIndex = to(_ b: Base, _ by: Base.Index.Stride) { 0025 base = b 0026 self.by = by 0027 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by)) 0028 if base.isEmpty { endIndex = 0 } 0029 else { endIndex = (base.startIndex.distanceTo(base.endIndex.predecessor()) / fac).successor() } 0030 startIndex = 0 0031 } 0032 0033 private init
Hopping.swift:48 return RandomAccessHopCollection(self, by)(_ b: Base, _ by: Base.Index.Stride, from: Base.Index.Distance, to: Base.Index.Distance) { 0034 base = b 0035 self.by = by 0036 fac = base.startIndex.distanceTo(base.startIndex.advancedBy(by)) 0037 startIndex = from 0038 endIndex = to 0039 } 0040 0041 public subscript(r: Range<Base.Index.Distance>) -> RandomAccessHopCollection<Base> { 0042 return RandomAccessHopCollection(base, by, from: r.startIndex, to: r.endIndex) 0043 } 0044 } 0045 0046 extension CollectionType where Index: RandomAccessIndexType, Index.Distance: ForwardIndexType { 0047 public subscript
Hopping.swift:42 return RandomAccessHopCollection(base, by, from: r.startIndex, to: r.endIndex)(by by: Index.Stride) -> RandomAccessHopCollection<Self> { 0048 return RandomAccessHopCollection(self, by) 0049 } 0050 } 0051 0052 extension RandomAccessHopCollection: CustomStringConvertible, CustomDebugStringConvertible { 0053 public var debugDescription: String { 0054 return Array(self).debugDescription 0055 } 0056 public var description: String { 0057 return String(Array(self)) 0058 } 0059 } 0060 0061 public extension CollectionType where 0062 SubSequence: CollectionType, 0063 Index == SubSequence.Index, 0064 SubSequence.Index: RandomAccessIndexType, 0065 SubSequence.Index.Distance: ForwardIndexType { 0066 subscript(r: Range<Index>, by by: Index.Stride) -> RandomAccessHopCollection<SubSequence> { 0067 return self[r][by: by] 0068 } 0069 subscript(r: OpenEndedRange<Index>, by by: Index.Stride) -> RandomAccessHopCollection<SubSequence> { 0070 return suffixFrom(r.val)[by: by] 0071 } 0072 subscript(r: OpenStartedRangeTo<Index>, by by: Index.Stride) -> RandomAccessHopCollection<SubSequence> { 0073 return prefixUpTo(r.val)[by: by] 0074 } 0075 subscript(r: OpenStartedRangeThrough<Index>, by by: Index.Stride) -> RandomAccessHopCollection<SubSequence> { 0076 return prefixThrough(r.val)[by: by] 0077 } 0078 }
Hopping.swift:67 return self[r][by: by]Hopping.swift:70 return suffixFrom(r.val)[by: by]Hopping.swift:73 return prefixUpTo(r.val)[by: by]Hopping.swift:76 return prefixThrough(r.val)[by: by]