Samond Classes Library 1.2.1-RELEASE build 181
List of all members
SCBidirectionalList Class Reference

Class for support the bidirectional lists of objects. More...

#import <SCBidirectionalList.h>

Inheritance diagram for SCBidirectionalList:
SCList SCCollection SCObject <SCMutableCollection> <SCCollection>

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
 

Additional Inherited Members

- Instance Methods inherited from SCList
(instancetype) - initWithName:
 
(instancetype) - initWithObject:
 
(instancetype) - initWithObjects:
 
(instancetype) - initWithCollection:
 
(instancetype) - initWithList:
 
(instancetype) - init
 
(void) - setList:
 
(BOOL) - isEqualToList:
 
(BOOL) - isEqualToContentsOfList:
 
(id) - nextObject
 
(void) - insertCurrentObject:
 
(void) - insertCurrentObjects:
 
(void) - insertCurrentCollection:
 
(void) - insertFirstObject:
 
(void) - insertFirstObjects:
 
(void) - insertFirstCollection:
 
(void) - removeCurrentObject
 
(void) - removeFirstObject
 
(void) - replaceCurrentObjectWithObject:
 
(void) - replaceFirstObjectWithObject:
 
(void) - duplicateCurrentObject
 
(void) - duplicateFirstObject
 
- Instance Methods inherited from SCCollection
(void) - enumerateWithDelegate:
 
(void) - enumerate
 
(void) - reverseEnumerateWithDelegate:
 
(void) - reverseEnumerate
 
(void) - setCollection:
 
(void) - setObject:
 
(void) - setObjects:
 
(BOOL) - isEqualToCollection:
 
(BOOL) - isEqual:
 
(void) - addObjects:
 
(void) - addCollection:
 
(void) - removeObjectsWithClass:
 
(void) - removeObjectsWithClassName:
 
(void) - removeCollection:
 
(void) - removeObject:
 
(void) - removeObjects:
 
(BOOL) - containsObjects:
 
(BOOL) - containsCollection:
 
(BOOL) - containsAnyObject:
 
(BOOL) - containsAnyObjectFromCollection:
 
(BOOL) - isCollection
 
(BOOL) - isLibraryCollection
 
(BOOL) - isFoundationCollection
 
(BOOL) - isArray
 
(BOOL) - isLibraryArray
 
(BOOL) - isFoundationArray
 
(BOOL) - isSet
 
(BOOL) - isLibrarySet
 
(BOOL) - isFoundationSet
 
(BOOL) - isOrderedSet
 
(BOOL) - isLibraryOrderedSet
 
(BOOL) - isFoundationOrderedSet
 
(BOOL) - isDictionary
 
(BOOL) - isLibraryDictionary
 
(BOOL) - isFoundationDictionary
 
(BOOL) - isStack
 
(BOOL) - isQueue
 
(BOOL) - isSortable
 
- Instance Methods inherited from SCObject
(instancetype) - initWithContentsOfSerializedFile:
 
(BOOL) - writeContentsToSerializedFile:
 
(instancetype) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(instancetype) - initWithFileStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
- Instance Methods inherited from <SCMutableCollection>
- Instance Methods inherited from <SCCollection>
- Class Methods inherited from SCCollection
(BOOL) + isCollectionClass:
 
(BOOL) + isLibraryCollectionClass:
 
(BOOL) + isFoundationCollectionClass:
 
(BOOL) + isArrayClass:
 
(BOOL) + isLibraryArrayClass:
 
(BOOL) + isFoundationArrayClass:
 
(BOOL) + isSetClass:
 
(BOOL) + isLibrarySetClass:
 
(BOOL) + isFoundationSetClass:
 
(BOOL) + isOrderedSetClass:
 
(BOOL) + isLibraryOrderedSetClass:
 
(BOOL) + isFoundationOrderedSetClass:
 
(BOOL) + isDictionaryClass:
 
(BOOL) + isLibraryDictionaryClass:
 
(BOOL) + isFoundationDictionaryClass:
 
(BOOL) + isStackClass:
 
(BOOL) + isQueueClass:
 
(BOOL) + isListClass:
 
(BOOL) + isSortableClass:
 
(BOOL) + isCollection:
 
(BOOL) + isLibraryCollection:
 
(BOOL) + isFoundationCollection:
 
(BOOL) + isArray:
 
(BOOL) + isLibraryArray:
 
(BOOL) + isFoundationArray:
 
(BOOL) + isSet:
 
(BOOL) + isLibrarySet:
 
(BOOL) + isFoundationSet:
 
(BOOL) + isOrderedSet:
 
(BOOL) + isLibraryOrderedSet:
 
(BOOL) + isFoundationOrderedSet:
 
(BOOL) + isDictionary:
 
(BOOL) + isLibraryDictionary:
 
(BOOL) + isFoundationDictionary:
 
(BOOL) + isStack:
 
(BOOL) + isQueue:
 
(BOOL) + isList:
 
(BOOL) + isSortable:
 
- Properties inherited from SCList
id currentObject
 
id firstObject
 
- Properties inherited from SCCollection
NSString * name
 
BOOL readOnly
 
id< SCCollectionDelegatedelegate
 
SCIndex count
 
BOOL empty
 
NSString * typeName
 
NSString * description
 
NSEnumerator * objectEnumerator
 
NSEnumerator * reverseObjectEnumerator
 
- Properties inherited from <SCCollection>
NSString * name
 
SCIndex count
 
BOOL empty
 
NSString * description
 
SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
NSEnumerator * objectEnumerator
 

Detailed Description

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:

Method Documentation

- (void) duplicateLastObject

Duplicates the first object within the receiving list.

Exceptions
SCCollectionException- collection error detected
- (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
SCCollectionException- collection error detected
- (void) insertLastObject: (id<SCCollectioning>)  object

Inserts a given object into the receiving list before the last object.

Parameters
object- the object to add into the list
Exceptions
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.

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
SCCollectionException- collection error detected
+ (instancetype) list

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
coder- the source coder
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
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.

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
SCStreamException- stream error detected
SCSystemException- system error detected
+ (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
SCCollectionException- collection error detected
+ (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
+ (instancetype) listWithObject: (id<SCCollectioning>)  object

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
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.

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
SCCollectionException- collection error detected
- (void) replaceLastObjectWithObject: (id<SCCollectioning>)  object

Replaces the last object with a given object.

Parameters
object- the object with which to replace the last object
Exceptions
SCCollectionException- collection error detected

Property Documentation

- (id) lastObject
readnonatomicretain

The last object within the list or nil if the list is empty


The documentation for this class was generated from the following files: