beispiele.demos.k2Schatzsuche
Enum Insel
java.lang.Object
java.lang.Enum<Insel>
beispiele.demos.k2Schatzsuche.Insel
- All Implemented Interfaces:
- Serializable, Comparable<Insel>
public enum Insel
- extends Enum<Insel>
Aufzaehlungsklasse Insel. Haelt die Namen der sechs Inseln des Spiels
Schatzsuche aus Kapitel 2. Jede Insel bietet zwei Dienste an:
dukatenfaehreNutzen und kristallfaehreNutzen, ausgegeben wird die Folgeinsel.
In dieser "Komfortversion" bietet jede Insel auch noch die weiteren Dienste
bildGeben und textGeben an. Wenn man in einer einfacheren Version auf Bild
und Text zu einer Insel (zunaechst) verzichtet, muss man diese beiden Dienste
nicht implementieren.
- Version:
- 02.2008
- Author:
- Florian Prager, Ute Heuer, Universitaet Passau
JAVA
public static final Insel JAVA
MAGISCHE_INSEL
public static final Insel MAGISCHE_INSEL
OSTERINSEL
public static final Insel OSTERINSEL
PIRATENINSEL
public static final Insel PIRATENINSEL
SCHATZINSEL
public static final Insel SCHATZINSEL
TOTENKOPFINSEL
public static final Insel TOTENKOPFINSEL
bildGeben
public abstract Bild bildGeben()
dukatenfaehreNutzen
public Insel dukatenfaehreNutzen()
kristallfaehreNutzen
public Insel kristallfaehreNutzen()
textGeben
public abstract Text textGeben()
valueOf
public static Insel valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
values
public static Insel[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Insel c : Insel.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared