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>
class ModelInfoHolder<M extends IModel> extends java.lang.Object implements IModelLoader.IModelInfoHolder<M>
An implementation of the model info holder for internal use.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ModelInfoHolder(AvailableModels<M> availableModels)Creates an instance from the currently available model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResult(ModelInfo<M> toAdd)Adds a model information as result of an operation.voiderror(java.lang.String message)Notifies about an error.ModelInfo<M>getResult(int index)Returns the the specified result.intgetResultCount()Returns the resulting model information instances.booleanisKnown(java.net.URI uri, IModelLoader<M> loader)Checks whether model information for a given URI is known.
-
-
-
Constructor Detail
-
ModelInfoHolder
ModelInfoHolder(AvailableModels<M> availableModels)
Creates an instance from the currently available model.- Parameters:
availableModels- the available models
-
-
Method Detail
-
addResult
public void addResult(ModelInfo<M> toAdd)
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
public boolean isKnown(java.net.URI uri, IModelLoader<M> loader)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
public ModelInfo<M> getResult(int index)
Returns the the specified result.- Parameters:
index- the index of the result- Returns:
- the result instance
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getResultCount()
-
error
public void error(java.lang.String message)
Description copied from interface:IModelLoader.IModelInfoHolderNotifies about an error.- Specified by:
errorin interfaceIModelLoader.IModelInfoHolder<M extends IModel>- Parameters:
message- the error message
-
-