EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmbench.tabs.operations]

COVERAGE SUMMARY FOR SOURCE FILE [ParameterRepresentation.java]

nameclass, %method, %block, %line, %
ParameterRepresentation.java0%   (0/1)0%   (0/6)0%   (0/109)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParameterRepresentation0%   (0/1)0%   (0/6)0%   (0/109)0%   (0/25)
ParameterRepresentation (): void 0%   (0/1)0%   (0/3)0%   (0/1)
deleteComma (String): String 0%   (0/1)0%   (0/14)0%   (0/3)
isNotNull (String): String 0%   (0/1)0%   (0/6)0%   (0/1)
setDataTypeToString (DataType): String 0%   (0/1)0%   (0/30)0%   (0/11)
setExceptionsToString (EList): String 0%   (0/1)0%   (0/29)0%   (0/5)
setParametersToString (EList): String 0%   (0/1)0%   (0/27)0%   (0/4)

1package de.uka.ipd.sdq.pcmbench.tabs.operations;
2 
3import java.util.Iterator;
4 
5import org.eclipse.emf.common.util.EList;
6import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
7import org.eclipse.emf.edit.provider.IItemLabelProvider;
8 
9import de.uka.ipd.sdq.pcm.repository.DataType;
10import de.uka.ipd.sdq.pcm.repository.ExceptionType;
11import de.uka.ipd.sdq.pcm.repository.Parameter;
12import de.uka.ipd.sdq.pcm.repository.provider.RepositoryItemProviderAdapterFactory;
13import de.uka.ipd.sdq.pcmbench.ui.provider.PalladioItemProviderAdapterFactory;
14 
15/**
16 * @author roman
17 * Responsibly for representation different Signature propertys (ReturnType, Parameters, Exceptions), as string
18 */
19public class ParameterRepresentation {
20 
21        /**
22         * @param DataType
23         * @param AdapterFactory
24         * @return String
25         */
26        public String setDataTypeToString(DataType returnType) {
27 
28                String result = "";
29                
30                // RepositoryItemProviderAdapterFactory
31                ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory();
32                adapterFactory
33                                .addAdapterFactory(new RepositoryItemProviderAdapterFactory());
34 
35                PalladioItemProviderAdapterFactory decoratedFactory = new PalladioItemProviderAdapterFactory(
36                                adapterFactory);
37 
38 
39                if (returnType != null) {
40                        IItemLabelProvider datatypeProvider = (IItemLabelProvider) decoratedFactory
41                                        .adapt((Object) returnType, IItemLabelProvider.class);
42                        result = datatypeProvider.getText(returnType);
43                }
44 
45                return result;
46        }
47 
48        public String setParametersToString(EList<Parameter> parameters) {
49 
50                String result = "";
51 
52                for (Iterator<Parameter> it = parameters.iterator(); it.hasNext();) {
53                        result += it.next().getParameterName() + ", ";
54                }
55                return deleteComma(result);
56        }
57 
58        /**
59         * Comma of the sentence deletes ends
60         */
61        public String deleteComma(String result) {
62                if (!result.equals("")) {
63                        result = result.substring(0, result.length() - 2);
64                }
65                return result;
66        }
67 
68        public String setExceptionsToString(EList<ExceptionType> exceptions) {
69 
70                String result = "";
71                ExceptionType exceptionType;
72 
73                for (Iterator<ExceptionType> it = exceptions.iterator(); it.hasNext();) {
74                        exceptionType = it.next();
75                        result += exceptionType.getExceptionName() + ", ";
76                }
77                return deleteComma(result);
78 
79        }
80 
81 
82        public String isNotNull(String string) {
83                return string == null ? "" : string;
84        }
85}

[all classes][de.uka.ipd.sdq.pcmbench.tabs.operations]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov