Back to index

moin  1.9.0~rc2
FigureEnumerator.java
Go to the documentation of this file.
00001 /*
00002  * @(#)FigureEnumerator.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.standard;
00007 
00008 import CH.ifa.draw.framework.*;
00009 import java.util.*;
00010 
00014 public final class FigureEnumerator implements FigureEnumeration {
00015     Vector v;
00016     Enumeration fEnumeration;
00017 
00018     public FigureEnumerator(Vector v) {
00019         this.v = v;
00020            fEnumeration = v.elements();
00021     }
00022 
00027     public boolean hasMoreElements() {
00028            return fEnumeration.hasMoreElements();
00029     }
00030 
00036     public Object nextElement() {
00037         return fEnumeration.nextElement();
00038     }
00039 
00045     public Figure nextFigure() {
00046         return (Figure)fEnumeration.nextElement();
00047     }
00048 
00053     public boolean contains(Figure figure) {
00054         return v.contains(figure);
00055     }
00056 }