Class ModelInfoHolder<M extends IModel>
java.lang.Object
net.ssehub.easy.basics.modelManagement.ModelInfoHolder<M>
- Type Parameters:
M- the specific type of model
- All Implemented Interfaces:
IModelLoader.IModelInfoHolder<M>
An implementation of the model info holder for internal use.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionModelInfoHolder(AvailableModels<M> availableModels) Creates an instance from the currently available model. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a model information as result of an operation.voidNotifies about an error.getResult(int index) Returns the the specified result.intReturns the resulting model information instances.booleanisKnown(URI uri, IModelLoader<M> loader) Checks whether model information for a given URI is known.
-
Field Details
-
knownURI
-
result
-
-
Constructor Details
-
ModelInfoHolder
ModelInfoHolder(AvailableModels<M> availableModels) Creates an instance from the currently available model.- Parameters:
availableModels- the available models
-
-
Method Details
-
addResult
Description copied from interface:IModelLoader.IModelInfoHolderAdds a model information as result of an operation.- Specified by:
addResultin interfaceIModelLoader.IModelInfoHolder<M extends IModel>- Parameters:
toAdd- the information object to add
-
isKnown
Description copied from interface:IModelLoader.IModelInfoHolderChecks whether model information for a given URI is known.- Specified by:
isKnownin interfaceIModelLoader.IModelInfoHolder<M extends IModel>- Parameters:
uri- the URI to checkloader- update the loader in case of unspecified loader- Returns:
trueif it is known,falseelse
-
getResultCount
public int getResultCount()Returns the resulting model information instances.- Returns:
- the resulting instances
-
getResult
Returns the the specified result.- Parameters:
index- the index of the result- Returns:
- the result instance
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getResultCount()
-
error
Description copied from interface:IModelLoader.IModelInfoHolderNotifies about an error.- Specified by:
errorin interfaceIModelLoader.IModelInfoHolder<M extends IModel>- Parameters:
message- the error message
-