Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create this enum in JAVA enum Spot implements Representable, Passable enum Spot implements Representable and Passable interfaces. (what methods will Spot have to implement as

Create this enum in JAVA

image text in transcribed

enum Spot implements Representable, Passable

enum Spot implements Representable and Passable interfaces. (what methods will Spot have to implement as a consequence?) Spots represent the permanent walls, spaces, and signage at a particular coordinate on a Map. Other things may be also present at a coordinate or not during the simulation, but the Spot is the actual wall, open spot, exit (also open in a sense), or sign (an open spot with an exit sign).

Values

Open, Wall, Exit, SignN, SignE, SignS, SignW.

Fields

You can add whatever fields you'd like beyond String repr in order to complete the required methods. If you do, they must either be private or be public final. It may be useful to use the following: boolean lookThrough, boolean passThrough, Direction dir.

public final String repr. Representation of the spot. The correct characters must be used (see Map Representations).

Methods

Spot( ??? ). Constructor, intializes any fields you have. Luckily for testing purposes, we don't get to create extra values of your enumeration type, so it doesn't matter what exact signature your constructor has as long as the methods below are provided as expected.

Manual Inspection Criteria (5%) : your constructor correctly initializes any and all fields your Spot enumeration contains.

public boolean isSign(). Determines if the spot is one of our four SignX spot values.

@Override public String toString(). Uses the repr value as its result.

@Override public String repr(). Uses the repr value as its result.

@Override public boolean canLookThrough(). Answers if a person is able to look beyond this spot. It is true for all spots except Wall.

@Override public boolean canPassThrough(). Answers if a person is able to walk into/through this spot. It is true for all spots except Wall.

enum Spot implements Representable, Passable enum Spot implements Representable and Passable interfaces. (what methods will Spot have to implement as a consequence?) Spots represent the permanent walls, spaces, and signage at a particular coordinate on a Map. Other things may be also present at a coordinate or not during the simulation, but the Spot is the actual wall, open spot, exit (also open in a sense), or Sign Lan open spot with an , exit (also open in a sense), or sign an open spot with an exit sign). Values Open, Vall, Exit, Signti, Sigri, Signs, Signy. Fields You can add whatever fields you'd like beyond String rept in order to complete the required methods. If you do, they must either be private or be public final. It may be useful to use the following: boolean lookThrougl, boolean pass Through, Direction dir. public final String repr. Representation of the spot. The correct characters must be used (see Map Representations). Methods Spot ( ??? ). Constructor, intializes any fields you have. Luckily for testing purposes, we don't get to create extra values of your enumeration type, so it doesn't matter what exact signature your constructor has as long as the methods below are provided as expected. o Manual Inspection Criteria (5%) : your constructor correctly initializes any and all fields your Spot enumeration contains. public boolean isSign (). Determines if the spot is one of our four SignX spot values. 80verride public String toString(). Uses the repr value as its result. Override public String repr (). Uses the repr value as its result. Override public boolean canLookThrough (). Answers if a person is able to look beyond this spot. It is true for all spots except all. @Override public boolean canPass Through (). Answers if a person is able to walk into/ through this spot. It is true for all spots except Fall

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago