AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
aud.SList< T >.Iterator Class Reference

Forward iterator. More...

+ Inheritance diagram for aud.SList< T >.Iterator:
+ Collaboration diagram for aud.SList< T >.Iterator:

Public Member Functions

boolean hasNext ()
 return true unless "advanced" over tail More...
 
next ()
 return current entry and advance More...
 
void remove ()
 not implemented More...
 
boolean equals (Object other)
 

Detailed Description

Forward iterator.

Definition at line 245 of file SList.java.

Member Function Documentation

◆ equals()

boolean aud.SList< T >.Iterator.equals ( Object  other)

Definition at line 281 of file SList.java.

281 {
282 return node_==((Iterator) other).node_;
283 }

◆ hasNext()

boolean aud.SList< T >.Iterator.hasNext ( )

return true unless "advanced" over tail

Definition at line 254 of file SList.java.

254 {
255 return node_!=null;
256 }

◆ next()

T aud.SList< T >.Iterator.next ( )

return current entry and advance

Definition at line 262 of file SList.java.

262 {
263 if (node_==null)
264 throw new NoSuchElementException();
265 T data=node_.data_;
266 node_=node_.next_;
267 return data;
268 }

◆ remove()

void aud.SList< T >.Iterator.remove ( )

not implemented

Exceptions
UnsupportedOperationException

Definition at line 275 of file SList.java.

275 {
276 throw new UnsupportedOperationException();
277 }

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