Documentation WIP

This commit is contained in:
Gwendal Roué committed 2015-07-11 11:01:51 +02:00
1 parent 515bd3112c
commit 58d90ea75b
1 file changed
+10 -1
+10 -1
View File
@@ -411,13 +411,22 @@ protocol RowImpl {
}
/// Used to access the (columnName, databaseValue) pairs in a Row.
/// Indexes to (columnName, databaseValue) pairs in a database row.
public struct RowIndex: ForwardIndexType, BidirectionalIndexType, RandomAccessIndexType {
let index: Int
init(_ index: Int) { self.index = index }
/// The index of the next (ColumnName, DatabaseValue) pair in a row.
public func successor() -> RowIndex { return RowIndex(index + 1) }
/// The index of the previous (ColumnName, DatabaseValue) pair in a row.
public func predecessor() -> RowIndex { return RowIndex(index - 1) }
/// The number of columns between two (ColumnName, DatabaseValue) pairs in
/// a row.
public func distanceTo(other: RowIndex) -> Int { return other.index - index }
/// Return `self` offset by `n` steps.
public func advancedBy(n: Int) -> RowIndex { return RowIndex(index + n) }
}