Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write CubeImpl method based on Cube interface: package model; import java.util.Set; public interface Cube { public Set getAllPossibleCubeNets(); } package model; import java.awt.Color; import java.util.HashMap;

Write CubeImpl method based on Cube interface:

package model;

import java.util.Set;

public interface Cube {

public Set getAllPossibleCubeNets();

}

package model;

import java.awt.Color;

import java.util.HashMap;

import java.util.HashSet;

import java.util.Map;

import java.util.Set;

public class CubeImpl_Opinca implements Cube {

private CubeNet representativeNet;

public CubeImpl_Opinca(CubeNet cubeNetRepresentative) {

assert cubeNetRepresentative != null : "cubeNetRepresentative is null!";

this.representativeNet = cubeNetRepresentative;

}

@Override

public Set getAllPossibleCubeNets() {

}

or make this code that's commented out work:

// public CubeNet rotateTopFaceClockwise() {

// Color top = representativeNet.getTop();

// Color front = representativeNet.getFront();

// Color right = representativeNet.getRight();

// Color back = representativeNet.getBack();

// Color left = representativeNet.getLeft();

// Color bottom = representativeNet.getBottom();

//

// Map faceToColorMap = new HashMap<>();

// Color[][] rotatedStickers = rotateTopFaceClockwise();

// faceToColorMap.put(Face.TOP, rotatedStickers[1][1]);

// faceToColorMap.put(Face.FRONT, front);

// faceToColorMap.put(Face.RIGHT, right);

// faceToColorMap.put(Face.BACK, back);

// faceToColorMap.put(Face.LEFT, left);

// faceToColorMap.put(Face.BOTTOM, bottom);

//

// return new CubeNetImpl_Opinca(faceToColorMap);

// }

//

//private Color[][] rotateTopFaceClockwise(Color[][] stickers) {

// Color[][] newStickers = new Color[3][3];

// newStickers[0][0] = stickers[2][0];

// newStickers[0][1] = stickers[1][0];

// newStickers[0][2] = stickers[0][0];

// newStickers[1][0] = stickers[2][1];

// newStickers[1][1] = stickers[1][1];

// newStickers[1][2] = stickers[0][1];

// newStickers[2][0] = stickers[2][2];

// newStickers[2][1] = stickers[1][2];

// newStickers[2][2] = stickers[0][2];

// return newStickers;

//}

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions