Class for support the bidirectional lists of objects.
More...
#import <SCBidirectionalList.h>
Class for support the bidirectional lists of objects.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.3
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.
- Exceptions
-
- (void) insertLastCollection: |
|
(id<SCCollection>) |
collection |
|
Inserts the objects from the specified collection into the receiving list before the last object.
- Parameters
-
collection | - the collection of objects to add into the receiving list |
- Exceptions
-
Inserts a given object into the receiving list before the last object.
- Parameters
-
object | - the object to add into the list |
- Exceptions
-
- (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.
- Parameters
-
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 |
- Exceptions
-
Creates and returns an unnamed empty bidirectional list.
- Returns
- A created bidirectional list
+ (instancetype) listWithCoder: |
|
(NSCoder *) |
coder |
|
Returns a bidirectional list created by using the specified coder.
- Parameters
-
- Returns
- A created bidirectional list
+ (instancetype) listWithCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a bidirectional list created by using the objects from the specified collection of any supported type.
- Parameters
-
collection | - the existing source collection |
- Returns
- A created bidirectional list
- Exceptions
-
+ (instancetype) listWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns a bidirectional list created by using the content of the serialized file with the specified path.
- Parameters
-
path | - the path to the source serialized file |
- Returns
- A created bidirectional list
+ (instancetype) listWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns a bidirectional list created by using the specified data dictionary.
- Parameters
-
dictionary | - the source data dictionary |
- Returns
- A created bidirectional list
+ (instancetype) listWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns a bidirectional list created by using the data dictionary from the specified file.
- Parameters
-
path | - the path to the source data dictionary file |
- Returns
- A created bidirectional list
+ (instancetype) listWithFileStream: |
|
(NSString *) |
path |
|
Returns a bidirectional list created by using the data from the file stream with the specified file.
- Parameters
-
path | - the path to the source file stream |
- Returns
- A created bidirectional list
- Exceptions
-
+ (instancetype) listWithList: |
|
(SCList *) |
list |
|
Creates and returns a bidirectional list containing objects from another given list.
- Parameters
-
list | - a list containing the objects with which to initialize the new bidirectional list |
- Returns
- A new bidirectional list containing the objects found in the specified list
- Exceptions
-
+ (instancetype) listWithName: |
|
(NSString *) |
name |
|
Returns an empty bidirectional list created by using the specified list name.
- Parameters
-
name | - the name of the new bidirectional list |
- Returns
- A created bidirectional list
Creates and returns a bidirectional list containing a given object.
- Parameters
-
object | - the object to adding into the bidirectional list |
- Returns
- A new bidirectional list containing a signe object
+ (instancetype) listWithObjects: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Creates and returns a bidirectional list containing the objects from the specified list.
- Parameters
-
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 |
- Returns
- A new bidirectional list containing the specified objects
+ (instancetype) listWithStream: |
|
(SCStream *) |
stream |
|
Returns a bidirectional list created by using the data from the specified stream.
- Parameters
-
stream | - the source stream |
- Returns
- A created bidirectional list
- Exceptions
-
Shifts the current object to the previous object in the receiving list and returns a pointer to the previous object.
- Returns
- A previous object or nil if the current object is a fist object within the list
- (void) removeLastObject |
|
|
|
Removes the last object from the receiving list.
- Exceptions
-
Replaces the last object with a given object.
- Parameters
-
object | - the object with which to replace the last object |
- Exceptions
-
The last object within the list or nil if the list is empty
The documentation for this class was generated from the following files: