CList Class Reference

CList operates list of objects. More...

#import <clist.h>

List of all members.

Public Member Functions

(id) - initList:
 Initialize list.
(void) - dealloc
 Release resource for the object.
(id) - setNextNode:
 Set next node.
(id) - setPrevNode:
 Set previous node.
(id) - obj
 Get element object.
(id) - set:
 Set element object.
(uint_t) - num
 Get number of data in list.
(CList *) - next
 Get next node.
(CList *) - prev
 Get previous node.
(CList *) - first
 Get first node of the list.
(CList *) - last
 Get last node of the list.
(CList *) - addObject:
 Add new next node and set the new element.
(CList *) - insertObject:
 Insert new previous node and set the new element.
(CList *) - appendObject:
 Append node to last and set the new element.
(CList *) - prependObject:
 Prepend node to head of the list and set the new element.

Static Public Member Functions

(CList *) + appendObject:after:
 Add new object to the tail of the list.
(void) + link:after:
 Link src2 list after src1 list.

Protected Attributes

id current_obj
CListlist_next
CListlist_prev


Detailed Description

CList operates list of objects.

Description
CList operates list of objects.


Member Function Documentation

- (CList *) addObject: (id)  obj  
 

Add new next node and set the new element.

Returns:
New added node.
Parameters:
obj New element to add.
Description
Add new next node and set the new element to it.

- (CList *) appendObject: (id)  obj  
 

Append node to last and set the new element.

Returns:
New appended node.
Parameters:
obj New element to add.
Description
Append node to last and set the new element to it.

+ (id) appendObject: (id)  obj
after: (CList *)  list
 
 

Add new object to the tail of the list.

Returns:
1st node of linked list.
Parameters:
obj Object to add to list as last item.
list Destination list to add new object.
Description
Link src2 list after src1. Check following specification:
  1. If "list" is nil, The new list which contains only "obj" is generated and returned.
  2. In the other case, the new item which contains "obj" is generated and added to the last of "list".

- (void) dealloc  
 

Release resource for the object.

Description
Release resource for the object.

- (CList *) first  
 

Get first node of the list.

Description
Get first node of the list.
Returns:
First node or nil.

- (id) initList: (id)  obj  
 

Initialize list.

Description
Initialize list.
Parameters:
obj Content of the list.
Returns:
The object itself.

- (CList *) insertObject: (id)  obj  
 

Insert new previous node and set the new element.

Returns:
New inserted node.
Parameters:
obj New element to add.
Description
Insert new previous node and set the new element to it.

- (CList *) last  
 

Get last node of the list.

Description
Get last node of the list.
Returns:
Last node or nil.

+ (void) link: (CList *)  src1
after: (CList *)  src2
 
 

Link src2 list after src1 list.

Returns:
Linked list.
Parameters:
src1 Next list. The previous link of it is replaced.
src2 Previous node. The next link of it is replaced.
Description
Link src2 list after src1. Check following specification:
  • The previous link of src1 is replaced by src2.
  • The next link of src2 is replaced by src1.

- (CList *) next  
 

Get next node.

Description
Get next node.
Returns:
Next node or nil.

- (uint_t) num  
 

Get number of data in list.

Returns:
Number of data.
Description
Get number of data in list.

- (id) obj  
 

Get element object.

Description
Get element object.

- (CList *) prependObject: (id)  obj  
 

Prepend node to head of the list and set the new element.

Returns:
New prepended node.
Parameters:
obj New element to add.
Description
Prepend node to head of the list and set the new element.

- (CList *) prev  
 

Get previous node.

Description
Get previois node.
Returns:
Previous node or nil.

- (id) set: (id)  obj  
 

Set element object.

Description
Set element object.
Parameters:
obj Object to replace current one.

- (id) setNextNode: (CList *)  node  
 

Set next node.

Description
Set next node.

- (id) setPrevNode: (CList *)  node  
 

Set previous node.

Description
Set previous node.


Member Data Documentation

- (id) current_obj [protected]
 

Content object

- (CList*) list_next [protected]
 

Pointer for next line

- (CList*) list_prev [protected]
 

Pointer for previous line


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 18:45:20 2006 for Coconut by  doxygen 1.4.6