ETKeyValuePair class documentation

Authors

Quentin Mathe (quentin.mathe@gmail.com)
A key/value association.

Copyright: (C) 2010 Quentin Mathe


Contents -

  1. Software documentation for the ETKeyValuePair class
  2. Software documentation for the NSArray(ETKeyValuePairRepresentation) category
  3. Software documentation for the NSObject(ETKeyValuePair) category

Software documentation for the ETKeyValuePair class

ETKeyValuePair : NSObject

Declared in:
ETKeyValuePair.h
Conforms to:
ETViewpoint

@group Collection Additions

Key value pairs are used by EtoileUI to present and interact with keyed data structures.

If you put them in an array, the resulting data structure is roughly equivalent to an ordered dictionary or a multi-value collection. For now, ETKeyValuePair doesn't support subclassing.

Method summary

pairWithKey: value: 

+ (id) pairWithKey: (NSString*)aKey value: (id)aValue;

@taskunit Initialization

Returns a new autoreleased pair with the given key and value.

Returns a new autoreleased pair with the given key and value.


displayName 

- (NSString*) displayName;

@taskunit UI Presentation

Returns the key.

Returns the key.


initWithKey: value: 

- (id) initWithKey: (NSString*)aKey value: (id)aValue;
This is a designated initialiser for the class.

Initializes and returns a new pair with the given key and value.


isKeyValuePair 

- (BOOL) isKeyValuePair;

@taskunit Type Querying

Returns YES.

Returns YES.


key 

- (NSString*) key;

@taskunit Controlling the Represented Element

Returns the pair identifier.

Returns the pair identifier.


observableKeyPaths 

- (NSSet*) observableKeyPaths;

@taskunit Observing Changes From Other Objects

Returns displayName, key, value and representedObject.

Returns displayName, key, value and representedObject.


propertyNames 

- (NSArray*) propertyNames;

@taskunit Property-Value Coding

Exposes key and value in addition to the inherited properties.

Exposes key and value in addition to the inherited properties.


representedObject 

- (id) representedObject;
Description forthcoming.

setKey: 

- (void) setKey: (NSString*)aKey;

Sets the pair identifier.


setRepresentedObject: 

- (void) setRepresentedObject: (id)anObject;
Description forthcoming.

setValue: 

- (void) setValue: (id)aValue;

Sets the pair content.


value 

- (id) value;

@taskunit Accessing the Represented Element

Returns the pair content.

Returns the pair content.


Software documentation for the NSArray(ETKeyValuePairRepresentation) category

NSArray(ETKeyValuePairRepresentation)

Declared in:
ETKeyValuePair.h

@group Collection Additions

ETKeyValuePair-related extensions to NSArray.

Method summary

dictionaryRepresentation 

- (NSDictionary*) dictionaryRepresentation;

Returns a dictionary where every ETKeyValuePair present in the array is turned into a key/value entry.

For every other object, its index in the array becomes its key in the dictionary.

The returned dictionary is autoreleased.

Raises an NSGenericException when the receiver contains an object which is not an ETKeyValuePair object.


Software documentation for the NSObject(ETKeyValuePair) category

NSObject(ETKeyValuePair)

Declared in:
ETKeyValuePair.h

@group Collection Additions

ETKeyValuePair-related extensions to NSObject.

Method summary

isKeyValuePair 

- (BOOL) isKeyValuePair;

Returns whether the receiver is a ETKeyValuePair instance.