Object Oriented Software Engineering   View all facts   Glossary   Help
subject > representation > abstraction > data abstraction > interface > Java interface > Iterator
Next Java interfaceRunnable    UpJava interface

Iterator
subjectfact 
Iteratorhas example
//counts the number of empty strings in a collection of strings
emptyCount = 0;
Iterator i = aCollection.iterator();
while(i.hasNext())
{
if(((String)i.next()).length()==0)
emptyCount++;
}
link: chapter2section2.8.html#859, 2001-08-30 14:56:06.0
has remove method that allows you to selectively delete elements of the underlying collectionlink: chapter2section2.8.html#860, 2001-08-30 14:56:06.0
is a subtopic of The Basics of Java2001-08-30 14:56:06.0
is an instance of Java interfacelink: chapter2section2.8.html#853, 2001-08-30 14:56:06.0
Java interfacecan be considered an extreme example of a horizontal framework: There is no implementation, and all the specified methods represent slots that must be filled2001-08-30 14:56:15.0
is implemented by a class2001-08-30 14:56:15.0
interfacecannot have any concrete methods or instance variables2001-08-30 14:56:01.0
describes a portion of the visible behaviour of a set of objects2001-08-30 14:56:01.0
has purpose to specify a set of methods that a variety of different classes can implement polymorphically2001-08-30 14:56:01.0
is like a class except that it does not have any executable statements - it only contains abstract methods and class variables2001-08-30 14:56:01.0
is created using superclasses containing only abstract methods in some languages2001-08-30 14:56:01.0
is drawn as a small circle (like a lollipop), labelled with the name of the interface or as a class rectangle, with the expression Ğinterfaceğ at the top, and (optionally) a list of supported operations in a UML diagram2001-08-30 14:56:01.0
is implemented using the implements keyword in Java2001-08-30 14:56:01.0
provides many of the same benefits as multiple inheritance2001-08-30 14:56:01.0
see also interface^22001-08-30 14:56:01.0
see also interface^32001-08-30 14:56:01.0
should not be confused with generalizations2001-08-30 14:56:01.0
shows a can-be-seen-as relation between the implementing class and the interface2001-08-30 14:56:01.0
data abstractiongroups the pieces of data that describe some entity, so that programmers can manipulate that data as a unit2001-08-30 14:55:09.0
helps a programmer to cope with the complexity of data2001-08-30 14:55:09.0
hides the details of data2001-08-30 14:55:09.0

Next Java interfaceRunnable    UpJava interface