Package net.ssehub.easy.dslCore
Class TranslationResult<R>
java.lang.Object
net.ssehub.easy.dslCore.TranslationResult<R>
- Type Parameters:
R- the top-level result model class
Represents the result of a translation.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MessageReceiverStores an instance which provides access to the messages which occurred during the model translation.Stores the created language units / models. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty instance of this class, e.g., to be used as a dummy translation result without real messages / results.TranslationResult(List<R> results, MessageReceiver receiver) Creates an instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of errors among the messages.getMessage(int index) Returns the specified message.intReturns the number of messages.List<net.ssehub.easy.basics.messages.IMessage> Returns the list of messages (using the more common type).Returns the list of messages.Returns the message receiver.getResult(int index) Returns the specified result.intReturns the number of projects being part of the result.Returns a copy of the list of projects.
-
Field Details
-
receiver
Stores an instance which provides access to the messages which occurred during the model translation. -
results
Stores the created language units / models.
-
-
Constructor Details
-
TranslationResult
public TranslationResult()Creates an empty instance of this class, e.g., to be used as a dummy translation result without real messages / results. -
TranslationResult
Creates an instance of this class.- Parameters:
results- the resulting language units (pass in only instances created for this result)receiver- the message receiver providing access to translation messages (may be null)
-
-
Method Details
-
getMessageCount
public int getMessageCount()Returns the number of messages.- Returns:
- the number of messages
-
getErrorCount
public int getErrorCount()Returns the number of errors among the messages.- Returns:
- the number of errors
-
getMessage
Returns the specified message.- Parameters:
index- the position of the message to be returned- Returns:
- the specified message
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getMessageCount()
-
getReceiver
Returns the message receiver.- Returns:
- the receiver
-
getMessageList
Returns the list of messages (using the more common type).- Returns:
- the list of messages
-
getMessageListSpecific
Returns the list of messages.- Returns:
- the list of messages
-
getResultCount
public int getResultCount()Returns the number of projects being part of the result.- Returns:
- the number of projects
-
getResult
Returns the specified result.- Parameters:
index- the index of the result to be returned- Returns:
- the specified project
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getResultCount()
-
getResultsList
Returns a copy of the list of projects.- Returns:
- the list of projects
-