Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

• Create a ShipRegistry class that implements ShipRegistryInterface. It will con

ID: 3695765 • Letter: #

Question

• Create a ShipRegistry class that implements ShipRegistryInterface. It will contain an Arraylist which holds Ship objects (Cargo, Cruise, and Warship all extending Ship). It will have methods required by the ShipRegistryInterface, i.e., addShip, getShips, getShipDescriptions, getWarshipDescriptions, readFile, and writeFile. • Create a toString method for each ship class that will return a String describing the ship’s name, year commissioned, and type, and the following field or fields depending on ship type. For each ship type, the fourth and subsequent fields will be: CARGO – number of tons of cargo CRUISE – number of passengers WARSHIP – number of guns, number of torpedo launchers, and number of aircraft CARRIER – number of aircraft CRUISER – number of guns DESTROYER – number of guns MINE_SWEEPER – number of guns SUBMARINE – number of torpedo launchers

Explanation / Answer

Refreshes this registry instance.

Specified by:

refresh in interface Registry

Throws:

java.lang.Exception

See Also:

Registry.refresh()

isFulfillmentCenterEffective

Deprecated. Use isFulfillmentCenterEffective(Integer,Integer,Integer,Timestamp,Long,CommandContext).

Returns whether the specified FulfillmentCenter is effective for the specified combination of Store and ShippingMode at the specified time.

Parameters:

anFulfillmentCenterId - the fulfillmentCenterId

anStoreId - the storeId

anShippingModeId - the shippingModeId

aTimestamp - the time

Returns:

true if the specified FulfillmentCenter is effective

Throws:

ECException -

getEffectiveFulfillmentCenterIds

Deprecated. Use getEffectiveFulfillmentCenterIds(Integer,Integer,Timestamp,Long,CommandContext).

Returns the list of effective fulfillmentCenterIds for the specified combination of Store and ShippingMode at the specified time.

Parameters:

anStoreId - the storeId

anShippingModeId - the shippingModeId

aTimestamp - the time

Returns:

the list of fulfillmentCenterIds

Throws:

ECException -

isFulfillmentCenterEffective

Returns true if the specified fulfillment center is effective for the specified store, shipping mode, time, and shipping address.

Parameters:

anFulfillmentCenterId - the fulfillment center identifier.

anStoreId - the store identifier.

anShippingModeId - the shipping mode identifier.

aTimestamp - the time.

anAddressId - if not null, the results are limited to those that can ship to this shipping address.

aCommandContext - the command context. Can be null if anAddressId is null.

Returns:

true if the specified fulfillment center is effective as specified by the other input parameter values.

Throws:

ECException

getEffectiveFulfillmentCenterIds

Returns an array of fulfillment center identifiers that are effective for the specified store, shipping mode, time, and shipping address.

Parameters:

anStoreId - the store identifier.

anShippingModeId - the shipping mode identifier.

aTimestamp - the time.

anAddressId - if not null, the results are limited to those that can ship to this shipping address.

aCommandContext - the command context. Can be null if anAddressId is null.

Returns:

A non-null array of identifiers of effective fulfillment centers.

Throws:

ECException

isShippingArrangementRestricted

Returns true if any shipping arrangements (that are effective for the specified store, shipping mode, and time) are restricted to certain shipping jurisdiction groups.

Parameters:

anStoreId - the identifier of the store.

anShippingModeId - the shipping mode identifier.

aTimestamp - the time.

Returns:

true if any of the specified shipping arrangements are restricted to certain shipping jurisdiction groups.

Throws:

ECException

isFulfillmentCenterRestricted

Returns true if any shipping arrangements are restricted to certain shipping jurisdiction groups. The shipping arrangements should be effective for the specified fulfillment center, store, shipping mode, and time.

Parameters:

anFulfillmentCenterId - the fulfillment center.

anStoreId - the identifier of the store.

anShippingModeId - the shipping mode identifier.

aTimestamp - the time.

Returns:

true if any of the specified shipping arrangements are restricted to certain shipping jurisdiction groups.

Throws:

ECException

getShippingArrangement

Returns singleton shippingArrangementCache, the caller should always use this singleton cache instead to create new cache.

Returns:

ShippingArrangementCache