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
public class TranslationResult<R> extends java.lang.ObjectRepresents the result of a translation.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private MessageReceiverreceiverStores an instance which provides access to the messages which occurred during the model translation.private java.util.List<R>resultsStores the created language units / models.
-
Constructor Summary
Constructors Constructor Description TranslationResult()Creates an empty instance of this class, e.g., to be used as a dummy translation result without real messages / results.TranslationResult(java.util.List<R> results, MessageReceiver receiver)Creates an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorCount()Returns the number of errors among the messages.MessagegetMessage(int index)Returns the specified message.intgetMessageCount()Returns the number of messages.java.util.List<IMessage>getMessageList()Returns the list of messages (using the more common type).java.util.List<Message>getMessageListSpecific()Returns the list of messages.RgetResult(int index)Returns the specified result.intgetResultCount()Returns the number of projects being part of the result.java.util.List<R>getResultsList()Returns a copy of the list of projects.
-
-
-
Field Detail
-
receiver
private MessageReceiver receiver
Stores an instance which provides access to the messages which occurred during the model translation.
-
results
private java.util.List<R> results
Stores the created language units / models.
-
-
Constructor Detail
-
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
public TranslationResult(java.util.List<R> results, MessageReceiver receiver)
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 Detail
-
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
public Message getMessage(int index)
Returns the specified message.- Parameters:
index- the position of the message to be returned- Returns:
- the specified message
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getMessageCount()
-
getMessageList
public java.util.List<IMessage> getMessageList()
Returns the list of messages (using the more common type).- Returns:
- the list of messages
-
getMessageListSpecific
public java.util.List<Message> 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
public R getResult(int index)
Returns the specified result.- Parameters:
index- the index of the result to be returned- Returns:
- the specified project
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getResultCount()
-
getResultsList
public java.util.List<R> getResultsList()
Returns a copy of the list of projects.- Returns:
- the list of projects
-
-