FactualRow


Object that encapsulates one row worth of data.

Conforms to: NSCopying
Superclass: NSObject
Declared In: FactualRow.h

Discussion

This object cotains a collection of values, one for each field in the associated Factual table. Rows are returned as a result of initiating a FactualQuery.

Values can be accessed by their index position (using the FactualSchemaResult object for fieldName to index position resolution) or by their field name. In the latter case, the row will use an internal field name to index map for index resolution.

Values can objects of the types: NSNumber (for numeric values),NSString, NSArray (for scalar results), or NSDictionary (for JSON objects). There are also two convenience methods, stringValueForName and stringValueAtIndex that coerce the source object type into a string before returning.

You can update a row's value by using the setValue methods, although any modifications to the row are strictly local; there is no way to update a Factual Table directly via the manipulation of a FactualRow object. You have to use the submitRowData method in FactualAPI to accomplish this task. You may however use the valuesAsDictionary method to return a collection of key/value pairs contained in the FactualRow object. This, however, involves an expensive copy operation and should only be used in special circumstances.

Lastly, each row is identified in the Factual system by a special Row Identifier. This Row Id is an opaque string and can be retrieved via the rowId property of the row object. You can use this rowId to associate updates with a specific Factual Row.



Methods

-copyWithZone:

copyWithZone:


- (id)copyWithZone:(NSZone *)zone; 
Discussion

Rows can be cloned

Properties

rowId
valueCount
values
namesAndValues

rowId


@property (
    nonatomic,
    readonly) NSString* rowId; 
Discussion

The opaque row identifier associated with this particular row object


valueCount


@property (
    nonatomic,
    readonly) NSInteger valueCount; 
Discussion

The number of values in this row object


values


@property (
    nonatomic,
    readonly) NSArray* values; 
Discussion

The array of value objects. Each element in the array can be an NSNull,NSString,NSNumber,or NSArray.


namesAndValues


@property (
    nonatomic,
    readonly) NSDictionary* namesAndValues; 
Discussion

A dictionary of name value pairs. Each tuple consists of a column name and associated value object. NOTE: This is more heavyweight than using the above NSArray based values method.

Last Updated: Friday, January 28, 2011