Skip to content

Package: ByRef

ByRef

nameinstructionbranchcomplexitylinemethod
ByRef(Object)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getValue()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setValue(Object)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: package de.fhdw.gaming.ipspiel23.dilemma.utils;
2:
3: /**
4: * A reference to a value.
5: * <p>
6: * Used to emulate pass-by-reference semantics in Java ({@code ref} and {@code out} parameters in C#) or to
7: * explicitly indicate that a parameter is used to return a value.
8: * <p>
9: * @param <T> The type of the referenced value.
10: */
11: public class ByRef<T> {
12:
13: /**
14: * The referenced value.
15: */
16: private T value;
17:
18: /**
19: * Creates a new instance of the {@link ByRef} class.
20: *
21: * @param value The initial value of the reference.
22: */
23: ByRef(final T value) {
24: this.value = value;
25: }
26:
27: /**
28: * Sets the value of the reference.
29: *
30: * @param value The new value of the reference.
31: */
32: public void setValue(final T value) {
33: this.value = value;
34: }
35:
36: /**
37: * Gets the value of the reference.
38: *
39: * @return The value of the reference.
40: */
41: public T getValue() {
42: return this.value;
43: }
44: }