DataSet

open class DataSet : EventAware

Data set base impl.
오직 UI를 위한 데이터셋이다.
멀티쓰레딩에 사용할 수 없다. main ui thread에서만 호출되어야 한다.

  • 이 데이터셋에 설정된 DataField들 중 index번 째 필드 객체를 리턴한다.

    Declaration

    Swift

    public func getField(at index: Int) -> DataField?

    Parameters

    index

    Return Value

    데이터필드 객체.

    See also

    getFieldIndex(fieldName:ignoreCase:), fieldByName(fieldName:ignoreCase:)

  • 매개변수 fieldName과 같은 이름을 갖는 DataField index를 리턴한다.

    Declaration

    Swift

    public func getFieldIndex(fieldName: String, ignoreCase: Bool = false) -> Int?

    Parameters

    fieldName

    검색할 field 이름

    ignoreCase

    true면 fieldName의 대소문자를 구분한다.

    Return Value

    DataField의 index(DataField.index)

  • @abstract

    Declaration

    Swift

    public func addDataTag(tag: AnyObject)
  • @abstract

    Declaration

    Swift

    public func removeDataTag(tag: AnyObject)
  • @abstract

    Declaration

    Swift

    open func getValue(row: Int, field: Int) throws -> Any?
  • @abstract

    Declaration

    Swift

    open func getValue(row: Int, field: Int, _ defaultValue: Any?) throws -> Any?
  • @abstract

    Declaration

    Swift

    open func getValue(row: Int, fieldName: String) throws -> Any?
  • @abstract

    Declaration

    Swift

    open func getValue(row: Int, fieldName: String, _ defaultValue: Any?) throws -> Any?
  • @abstract

    Declaration

    Swift

    open func getCheckedValue(row: Int, field: Int) -> Any?
  • @abstract

    Declaration

    Swift

    open func getCheckedValue(row: Int, field: Int, _ defaultValue: Any?) -> Any?
  • @abstract

    Declaration

    Swift

    open func getCheckedValue(row: Int, fieldName: String) -> Any?
  • @abstract

    Declaration

    Swift

    open func getCheckedValue(row: Int, fieldName: String, _ defaultValue: Any?) -> Any?
  • @abstract

    Declaration

    Swift

    public func setValue(row: Int, field: Int, value: Any?, checkDiff: Bool, noEvent: Bool) throws -> Bool
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func updateRow(row: Int, values: [Any?], checkDiff: Bool) throws -> Bool
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func updateRow(row: Int, values: [String : Any], fieldMap: [String : String]?, checkDiff: Bool) throws -> Bool
  • @abstract

    Declaration

    Swift

    public func getRowTag(row: Int) throws -> String?
  • @abstract

    Declaration

    Swift

    public func getCheckedRowTag(row: Int) -> String?
  • @abstract

    Declaration

    Swift

    public func getRowsByTag(_ tag: String) -> [Int]?
  • @abstract

    Declaration

    Swift

    public func getRowsByTags(_ tags: [String]) -> [Int]?
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func setRowTag(row: Int, tag: String?) throws -> Bool
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func setRowTags(rows: [Int], tag: String?) throws -> Int
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func clearRowTags(rows: [Int]? = nil, tags: [String]? = nil) throws -> Int
  • @abstract

    Declaration

    Swift

    public func getRowState(row: Int) throws -> DataRowState
  • @abstract

    Declaration

    Swift

    public func getCheckedRowState(row: Int) -> DataRowState
  • @abstract

    Declaration

    Swift

    public func getRowStates(rows: [Int]) throws -> [DataRowState]
  • @abstract

    Declaration

    Swift

    public func getCheckedRowStates(rows: [Int]) -> [DataRowState]
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func setRowState(row: Int, state: DataRowState) throws -> Bool
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func clearRowStates(rows: [Int]? = nil, states: [DataRowState]? = nil) throws -> Int
  • @abstract

    Declaration

    Swift

    public func getStateRows(state: DataRowState) -> [Int]?
  • @abstract

    Declaration

    Swift

    public func getAllStateRows() -> [DataRowState : [Int]]?
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func setRowStates(rows: [Int], state: DataRowState) throws -> Int
  • @abstract

    Declaration

    Swift

    public func getRowStateCount(states: [DataRowState]?) -> Int
  • @abstract

    Declaration

    Swift

    public func restoreUpdatedRows(rows: [Int]?) throws -> Int
  • @abstract

    Declaration

    Swift

    public func restoreUpdatedStates(rows: [Int]?) throws -> Int
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func aggregate(fs: FieldSummary, calcVars: Bool) -> Bool
  • @abstract

    Declaration

    Swift

    @discardableResult
    public func aggregateRange(fs: FieldSummary, rows: [Int], calcVars: Bool) -> Bool
  • @abstract

    Declaration

    Swift

    public func select(row: Int, filters: [RowFilter]) -> Bool
  • getDistinctValues(field:maxCount:ascending:)와 동일하다.

    Throws

    DataSetError field가 지정된 범위를 벗어나면 발생.

    Declaration

    Swift

    public func getDistinctValues(field: Int, ascending: Bool = true) throws -> [Any?]?

    Parameters

    field

    데이터필드 인덱스.

    ascending

    가져올 값의 최대 개수.

    Return Value

    필드 값 목록. 데이터행이 하나도 없는 경우 빈 배열.

  • field로 지정한 데이터필드의 값들을 중복되지 않게 최대 maxCount 개수 만큼 리턴한다.
    ascending으로 반환되는 값들의 정렬 상태를 지정할 수 있다.
    null값이 포함될 수 있다.

    Throws

    DataSetError field가 지정된 범위를 벗어나면 발생.

    Declaration

    Swift

    public func getDistinctValues(field: Int, maxCount: Int, ascending: Bool = true) throws -> [Any?]?

    Parameters

    field

    field 데이터필드 인덱스.

    maxCount

    가져올 값의 최대 개수. 0보다 작은 값을 지정하면 모든 값들이 포함된다.

    ascending

    true면 올림차순, false면 내림차순으로 정렬한다.

    Return Value

    필득 값 목록. 데이터행이 하나도 없는 경우 빈 배열.