SFSObject Class Reference
| Inherits from | NSObject |
| Conforms to | ISFSObject |
| Declared in | SFSObject.h SFSObject.m |
Overview
SFSObject is used from both server and client sides to exchange data. It can be thought of a specialized Dictionary/Map object that can contain any type of data.
The advantage of using SFSObject is that you can fine tune the way your data will be transmitted over the network. For instance, a number like 100 can be transmitted as a normal integer (which takes 32 bits) but also a short (16 bit) or even a byte (8 bit)
SFSObject supports many primitive data types and related arrays of primitives. It also allows to serialize class instances and rebuild them on the Java side. This is explained in greater detail in a separate document.
See ISFSObject, SFSArray
Tasks
-
+ newInstanceAlternative static constructor
-
+ newFromBinaryData:Alternative static constructor that builds an SFSObject from a valid SFSObject binary representation
-
– isNull:Checks if a specific element in the SFSObject is null
-
– containsKey:Returns true if an element exists with the provided key
-
– removeElement:Removes an element
-
– getKeysReturn an array with all the keys in the SFSObject
-
– sizeReturn the number of elements in the SFSObject
-
– toBinaryReturn the binary form of the object
-
– getDump:Return a formatted dump of the object that can logged or traced in the console for debugging purposes.
-
– getHexDumpReturns a detailed hex-dump of the object that can logged or traced in the console for debugging purposes.
-
– getBool:Get the element for the provided key as a Boolean
-
– getByte:Get the element for the provided key as a signed byte (8 bit) (int in AS3)
-
– getUnsignedByte:Get the element for the provided key as a unsigned byte (8 bit) (int in AS3)
-
– getShort:Get the element for the provided key as a short int (16 bit) (int in AS3)
-
– getInt:Get the element for the provided key as an int (32 bit)
-
– getLong:Get the element for the provided key as a long int (64 bit) (Number in AS3)
-
– getFloat:Get the element for the provided key as a float (Number in AS3)
-
– getDouble:Get the element for the provided key as a double (Number in AS3)
-
– getUtfString:Get the element for the provided key as a UTF-8 String
-
– getBoolArray:Get the element for the provided key as an array of Booleans
-
– getByteArray:Get the element for the provided key as a an array of byte
-
– getUnsignedByteArray:Get the element for the provided key as a an array of integers representing each byte as unsigned values
-
– getShortArray:Get the element for the provided key as an array of short int
-
– getIntArray:Get the element for the provided key as an array of int
-
– getLongArray:Get the element for the provided key as an array of long int
-
– getFloatArray:Get the element for the provided key as an array of floats
-
– getDoubleArray:Get the element for the provided key as an array of doubles
-
– getUtfStringArray:Get the element for the provided key as an array of UTF-8 Strings
-
– getSFSArray:Get the element for the provided key as an SFSArray
-
– getSFSObject:Get the element for the provided key as an SFSObject
-
– putBool:value:puts a Boolean value with the provided key
-
– putByte:value:puts a byte value (8 bit) with the provided key
-
– putShort:value:puts a short int (16 bit) with the provided key
-
– putInt:value:puts an int (32 bit) with the provided key
-
– putLong:value:puts a long int (64 bit) with the provided key
-
– putFloat:value:puts a float (32 bit) with the provided key
-
– putDouble:value:puts a double (64 bit) with the provided key
-
– putUtfString:value:puts a UTF-8 String with the provided key
-
– putBoolArray:value:puts an array of Booleans with the provided key
-
– putByteArray:value:puts an array of bytes with the provided key
-
– putShortArray:value:puts an array of short ints with the provided key
-
– putIntArray:value:puts an array of ints with the provided key
-
– putLongArray:value:puts an array of long ints with the provided key
-
– putFloatArray:value:puts an array of floats with the provided key
-
– putDoubleArray:value:puts an array of doubles with the provided key
-
– putUtfStringArray:value:puts an array of Strings with the provided key
-
– putSFSArray:value:puts an SFSArray with the provided key
-
– putSFSObject:value:puts an SFSObject with the provided key
Class Methods
Instance Methods
containsKey:
Returns true if an element exists with the provided key
- (BOOL)containsKey:(NSString *)keyDiscussion
Returns true if an element exists with the provided key
Declared In
SFSObject.hgetBool:
Get the element for the provided key as a Boolean
- (BOOL)getBool:(NSString *)keyDiscussion
Get the element for the provided key as a Boolean
Declared In
SFSObject.hgetBoolArray:
Get the element for the provided key as an array of Booleans
- (NSArray *)getBoolArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of Booleans
Declared In
SFSObject.hgetByte:
Get the element for the provided key as a signed byte (8 bit) (int in AS3)
- (NSInteger)getByte:(NSString *)keyDiscussion
Get the element for the provided key as a signed byte (8 bit) (int in AS3)
Declared In
SFSObject.hgetByteArray:
Get the element for the provided key as a an array of byte
- (NSData *)getByteArray:(NSString *)keyDiscussion
Get the element for the provided key as a an array of byte
Declared In
SFSObject.hgetDouble:
Get the element for the provided key as a double (Number in AS3)
- (NSNumber *)getDouble:(NSString *)keyDiscussion
Get the element for the provided key as a double (Number in AS3)
Declared In
SFSObject.hgetDoubleArray:
Get the element for the provided key as an array of doubles
- (NSArray *)getDoubleArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of doubles
Declared In
SFSObject.hgetDump:
Return a formatted dump of the object that can logged or traced in the console for debugging purposes.
- (NSString *)getDump:(BOOL)formatParameters
- format
turns the “pretty print” on/off
Discussion
Return a formatted dump of the object that can logged or traced in the console for debugging purposes.
Declared In
SFSObject.hgetFloat:
Get the element for the provided key as a float (Number in AS3)
- (NSNumber *)getFloat:(NSString *)keyDiscussion
Get the element for the provided key as a float (Number in AS3)
Declared In
SFSObject.hgetFloatArray:
Get the element for the provided key as an array of floats
- (NSArray *)getFloatArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of floats
Declared In
SFSObject.hgetHexDump
Returns a detailed hex-dump of the object that can logged or traced in the console for debugging purposes.
- (NSString *)getHexDumpDiscussion
Returns a detailed hex-dump of the object that can logged or traced in the console for debugging purposes.
Declared In
SFSObject.hgetInt:
Get the element for the provided key as an int (32 bit)
- (NSInteger)getInt:(NSString *)keyDiscussion
Get the element for the provided key as an int (32 bit)
Declared In
SFSObject.hgetIntArray:
Get the element for the provided key as an array of int
- (NSArray *)getIntArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of int
Declared In
SFSObject.hgetKeys
Return an array with all the keys in the SFSObject
- (NSArray *)getKeysDiscussion
Return an array with all the keys in the SFSObject
Declared In
SFSObject.hgetLong:
Get the element for the provided key as a long int (64 bit) (Number in AS3)
- (NSNumber *)getLong:(NSString *)keyDiscussion
Get the element for the provided key as a long int (64 bit) (Number in AS3)
Declared In
SFSObject.hgetLongArray:
Get the element for the provided key as an array of long int
- (NSArray *)getLongArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of long int
Declared In
SFSObject.hgetSFSArray:
Get the element for the provided key as an SFSArray
- (id<ISFSArray>)getSFSArray:(NSString *)keyDiscussion
Get the element for the provided key as an SFSArray
Declared In
SFSObject.hgetSFSObject:
Get the element for the provided key as an SFSObject
- (id<ISFSObject>)getSFSObject:(NSString *)keyDiscussion
Get the element for the provided key as an SFSObject
Declared In
SFSObject.hgetShort:
Get the element for the provided key as a short int (16 bit) (int in AS3)
- (NSInteger)getShort:(NSString *)keyDiscussion
Get the element for the provided key as a short int (16 bit) (int in AS3)
Declared In
SFSObject.hgetShortArray:
Get the element for the provided key as an array of short int
- (NSArray *)getShortArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of short int
Declared In
SFSObject.hgetUnsignedByte:
Get the element for the provided key as a unsigned byte (8 bit) (int in AS3)
- (NSInteger)getUnsignedByte:(NSString *)keyDiscussion
Get the element for the provided key as a unsigned byte (8 bit) (int in AS3)
Declared In
SFSObject.hgetUnsignedByteArray:
Get the element for the provided key as a an array of integers representing each byte as unsigned values
- (NSArray *)getUnsignedByteArray:(NSString *)keyDiscussion
Get the element for the provided key as a an array of integers representing each byte as unsigned values
Declared In
SFSObject.hgetUtfString:
Get the element for the provided key as a UTF-8 String
- (NSString *)getUtfString:(NSString *)keyDiscussion
Get the element for the provided key as a UTF-8 String
Declared In
SFSObject.hgetUtfStringArray:
Get the element for the provided key as an array of UTF-8 Strings
- (NSArray *)getUtfStringArray:(NSString *)keyDiscussion
Get the element for the provided key as an array of UTF-8 Strings
Declared In
SFSObject.hisNull:
Checks if a specific element in the SFSObject is null
- (BOOL)isNull:(NSString *)keyDiscussion
Checks if a specific element in the SFSObject is null
Declared In
SFSObject.hputBool:value:
puts a Boolean value with the provided key
- (void)putBool:(NSString *)key value:(BOOL)valueDiscussion
puts a Boolean value with the provided key
Declared In
SFSObject.hputBoolArray:value:
puts an array of Booleans with the provided key
- (void)putBoolArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of Booleans with the provided key
Declared In
SFSObject.hputByte:value:
puts a byte value (8 bit) with the provided key
- (void)putByte:(NSString *)key value:(NSInteger)valueDiscussion
puts a byte value (8 bit) with the provided key
Declared In
SFSObject.hputByteArray:value:
puts an array of bytes with the provided key
- (void)putByteArray:(NSString *)key value:(NSData *)valueDiscussion
puts an array of bytes with the provided key
Declared In
SFSObject.hputDouble:value:
puts a double (64 bit) with the provided key
- (void)putDouble:(NSString *)key value:(NSNumber *)valueDiscussion
puts a double (64 bit) with the provided key
Declared In
SFSObject.hputDoubleArray:value:
puts an array of doubles with the provided key
- (void)putDoubleArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of doubles with the provided key
Declared In
SFSObject.hputFloat:value:
puts a float (32 bit) with the provided key
- (void)putFloat:(NSString *)key value:(NSNumber *)valueDiscussion
puts a float (32 bit) with the provided key
Declared In
SFSObject.hputFloatArray:value:
puts an array of floats with the provided key
- (void)putFloatArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of floats with the provided key
Declared In
SFSObject.hputInt:value:
puts an int (32 bit) with the provided key
- (void)putInt:(NSString *)key value:(NSInteger)valueDiscussion
puts an int (32 bit) with the provided key
Declared In
SFSObject.hputIntArray:value:
puts an array of ints with the provided key
- (void)putIntArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of ints with the provided key
Declared In
SFSObject.hputLong:value:
puts a long int (64 bit) with the provided key
- (void)putLong:(NSString *)key value:(NSNumber *)valueDiscussion
puts a long int (64 bit) with the provided key
Declared In
SFSObject.hputLongArray:value:
puts an array of long ints with the provided key
- (void)putLongArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of long ints with the provided key
Declared In
SFSObject.hputSFSArray:value:
puts an SFSArray with the provided key
- (void)putSFSArray:(NSString *)key value:(id<ISFSArray>)valueDiscussion
puts an SFSArray with the provided key
See Also
Declared In
SFSObject.hputSFSObject:value:
puts an SFSObject with the provided key
- (void)putSFSObject:(NSString *)key value:(id<ISFSObject>)valueDiscussion
puts an SFSObject with the provided key
Declared In
SFSObject.hputShort:value:
puts a short int (16 bit) with the provided key
- (void)putShort:(NSString *)key value:(NSInteger)valueDiscussion
puts a short int (16 bit) with the provided key
Declared In
SFSObject.hputShortArray:value:
puts an array of short ints with the provided key
- (void)putShortArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of short ints with the provided key
Declared In
SFSObject.hputUtfString:value:
puts a UTF-8 String with the provided key
- (void)putUtfString:(NSString *)key value:(NSString *)valueDiscussion
puts a UTF-8 String with the provided key
Declared In
SFSObject.hputUtfStringArray:value:
puts an array of Strings with the provided key
- (void)putUtfStringArray:(NSString *)key value:(NSArray *)valueDiscussion
puts an array of Strings with the provided key
Declared In
SFSObject.hremoveElement:
Removes an element
- (void)removeElement:(NSString *)keyDiscussion
Removes an element
Declared In
SFSObject.h