Question: make an interface for java programing, like this. and say how to implement those methods As an example, // Energy Manager models energy usage in
make an interface for java programing, like this. and say how to implement those methods

As an example, // Energy Manager models energy usage in an electrical grid in terms of energy // sources and energy consumers at a given point in time during the day. Provides // methods to allocate energy between sources and consumers, methods to prioritize // sources and consumers, and methods to deprioritize sources and consumers. public interface Energy Manager { } // Returns a map describing energy allocations in the energy grid. If sources // or consumers are prioritized, they will be allocated first. If there is not // enough energy to satisfy all consumers, allocations are made to prioritized // consumers first. Then, consumers will be allocated energy in the order they // appear the consumers list. public Map allocate( List sources, List consumers); // Prioritize the given energy source for allocation (e.g. renewables) public void prioritize (Energy Source source); // Prioritize the given energy consumer for allocation (e.g. infrastructure) public void prioritize (Energy Consumer consumer); // Deprioritize the given energy source for allocation (e.g. non-renewables) public void deprioritize (EnergySource source); // Deprioritize the given energy consumer for allocation (e.g. residences) public void deprioritize (Energy Consumer consumer); 71 K This particular interface also relies on other Java data types like Energy Source and Energy Consumer that we haven't defined. This is okay and encouraged, but take a moment in your meeting to discuss why you thought it would be helpful to have other data types that aren't just strings, numbers, or collections of strings or numbers.
Step by Step Solution
3.38 Rating (145 Votes )
There are 3 Steps involved in it
public interface EnergyManager Returns a map describing energy allocations in the energy grid If sou... View full answer
Get step-by-step solutions from verified subject matter experts
