Samond Classes Library 1.2.2-RELEASE build 188
|
Class for support the bidirectional lists of objects. More...
#import <SCBidirectionalList.h>
Creating Lists | |
(instancetype) | + listWithCoder: |
(instancetype) | + listWithContentsOfSerializedFile: |
(instancetype) | + listWithDataDictionary: |
(instancetype) | + listWithDataDictionaryFromFile: |
(instancetype) | + listWithStream: |
(instancetype) | + listWithFileStream: |
(instancetype) | + listWithName: |
(instancetype) | + listWithObject: |
(instancetype) | + listWithObjects: |
(instancetype) | + listWithCollection: |
(instancetype) | + listWithList: |
(instancetype) | + list |
Querying a List | |
id | lastObject |
List Control | |
(id) | - previousObject |
Adding Objects | |
(void) | - insertLastObject: |
(void) | - insertLastObjects: |
(void) | - insertLastCollection: |
Removing Objects | |
(void) | - removeLastObject |
Replacing Objects | |
(void) | - replaceLastObjectWithObject: |
Copying Objects | |
(void) | - duplicateLastObject |
Class for support the bidirectional lists of objects.
In the bidirectional list each object node contains, besides the next-node link, a seconf link field pointing to the previous node in the sequence. The two links may be called forwards and backwards, or next and prev.
Class SCBidirectionalList provides changing the current object pointer in two directions - from current object to the next object and from current to the previous object. Additionally, class SCBidirectionalList declares the methods for accessing to the list last object.
Class instances can thrown the following exceptions:
- (void) duplicateLastObject |
Duplicates the first object within the receiving list.
SCCollectionException | - collection error detected |
- (void) insertLastCollection: | (id<SCCollection>) | collection |
Inserts the objects from the specified collection into the receiving list before the last object.
collection | - the collection of objects to add into the receiving list |
SCCollectionException | - collection error detected |
- (void) insertLastObject: | (id<SCCollectioning>) | object |
Inserts a given object into the receiving list before the last object.
object | - the object to add into the list |
SCCollectionException | - collection error detected |
- (void) insertLastObjects: | (id<SCCollectioning>) | object | |
, | NS_REQUIRES_NIL_TERMINATION | ||
Inserts the objects from the specified null-terminated list into the receiving list before the last object.
object | - the first object to add into the list |
... | - other objects from the null-terminated list to add into the receiving list |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
SCCollectionException | - collection error detected |
+ (instancetype) list |
Creates and returns an unnamed empty bidirectional list.
+ (instancetype) listWithCoder: | (NSCoder *) | coder |
Returns a bidirectional list created by using the specified coder.
coder | - the source coder |
+ (instancetype) listWithCollection: | (id<SCCollection>) | collection |
Returns a bidirectional list created by using the objects from the specified collection of any supported type.
collection | - the existing source collection |
SCCollectionException | - collection error detected |
+ (instancetype) listWithContentsOfSerializedFile: | (NSString *) | path |
Returns a bidirectional list created by using the content of the serialized file with the specified path.
path | - the path to the source serialized file |
+ (instancetype) listWithDataDictionary: | (NSDictionary *) | dictionary |
Returns a bidirectional list created by using the specified data dictionary.
dictionary | - the source data dictionary |
+ (instancetype) listWithDataDictionaryFromFile: | (NSString *) | path |
Returns a bidirectional list created by using the data dictionary from the specified file.
path | - the path to the source data dictionary file |
+ (instancetype) listWithFileStream: | (NSString *) | path |
Returns a bidirectional list created by using the data from the file stream with the specified file.
path | - the path to the source file stream |
SCStreamException | - stream error detected |
SCSystemException | - system error detected |
+ (instancetype) listWithList: | (SCList *) | list |
Creates and returns a bidirectional list containing objects from another given list.
list | - a list containing the objects with which to initialize the new bidirectional list |
SCCollectionException | - collection error detected |
+ (instancetype) listWithName: | (NSString *) | name |
Returns an empty bidirectional list created by using the specified list name.
name | - the name of the new bidirectional list |
+ (instancetype) listWithObject: | (id<SCCollectioning>) | object |
Creates and returns a bidirectional list containing a given object.
object | - the object to adding into the bidirectional list |
+ (instancetype) listWithObjects: | (id<SCCollectioning>) | object | |
, | NS_REQUIRES_NIL_TERMINATION | ||
Creates and returns a bidirectional list containing the objects from the specified list.
object | - the first object to add into the new bidirectional list |
... | - a null-terminated list of alternating objects to add into the new list |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
+ (instancetype) listWithStream: | (SCStream *) | stream |
Returns a bidirectional list created by using the data from the specified stream.
stream | - the source stream |
SCStreamException | - stream error detected |
SCSystemException | - system error detected |
- (id) previousObject |
Shifts the current object to the previous object in the receiving list and returns a pointer to the previous object.
- (void) removeLastObject |
Removes the last object from the receiving list.
SCCollectionException | - collection error detected |
- (void) replaceLastObjectWithObject: | (id<SCCollectioning>) | object |
Replaces the last object with a given object.
object | - the object with which to replace the last object |
SCCollectionException | - collection error detected |
|
readnonatomicassign |
The last object within the list or nil if the list is empty