1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
\documentclass[a5paper,landscape]{handout}
\csname endofdump\endcsname
\usepackage{minted}
\begin{document}
\thispagestyle{empty}
\subsection*{\underline{Felder von komplexen Datentypen}}
\begin{tabular}{p{0.4\textwidth} p{0.1\textwidth} p{0.49\textwidth}}
\begin{defbox}{Syntax}
\begin{itemize}
\item \textbf{Datentyp}: \solution{KLASSENNAME[]}
\item \textbf{Deklaration}: \solution{KLASSENNAME{} feldname;}
\item \textbf{Initialisierung}: \solution{feldname = new KLASSENNAME[laenge];}
\end{itemize}
\end{defbox} & &
\begin{minipage}[t]{0.59\textwidth}
\begin{minted}[escapeinside=$$]{java}
class SPIELAUTOMAT {
// Deklaration Spielwalzen Feld
$\solution{SPIELWALZEN[] walzen;}$
// SPIELAUTOMAT Konstruktor
SPIELAUTOMAT($\solution{int n }$) {
// Initialisierung Spielwalzen Feld
$walzen = \solution{new SPIELWALZEN[n];}$
for (int i = 0; i < $\solution{walzen.length }$; i++) {
// Initialisierung der einzelnen Spielwalzen
$\solution{walzen[i] = new SPIELWALZE(i*100, 0);}$
$\solution{}$
}
}
}
\end{minted}
\end{minipage} \\
\end{tabular}
\subsection*{\underline{1 zu n Beziehungen in Java}}
\begin{tabular}{p{0.49\linewidth} p{0.49\linewidth}}
\vspace{0.5cm}
\begin{tikzpicture}[
class/.style={
draw,
rectangle,
minimum width={width("SPIELAUTOMAT")},
font=\small}]
\node[class] (sa) at (0,0) {SPIELAUTOMAT};
\node[class] (sw) at (7, 0) {SPIELWALZE};
\draw (sa.east) edge[above, align=center] node {\small 1 ~~~~ $>$ enthält ~~~~ 3} (sw.west);
\end{tikzpicture} &
\begin{minipage}[t]{0.49\textwidth}
\begin{minted}[]{java}
class SPIELAUTOMAT {
SPIELWALZEN walze1;
SPIELWALZEN walze2;
SPIELWALZEN walze3;
...
}
\end{minted}
\end{minipage} \\
\LARGE \hspace{5cm} $\Downarrow$ & \hspace{2cm} \LARGE $\Downarrow$ \\
\vspace{1cm}
\begin{tikzpicture}[
class/.style={
draw,
rectangle,
minimum width={width("SPIELAUTOMAT")},
font=\small}]
\node[class] (sa) at (0,0) {SPIELAUTOMAT};
\node[class] (sw) at (7, 0) {SPIELWALZE};
\draw (sa.east) edge[above, align=center] node {\small 1 ~~~~ $>$ enthält ~~~~ \boldred{n}} (sw.west);
\end{tikzpicture} &
\vspace{0.5cm}
\begin{minipage}[t]{0.49\textwidth}
\begin{minted}[escapeinside=$$]{java}
class SPIELAUTOMAT {
$\solution{SPIELWALZEN[] walzen;}$
SPIELAUTOMAT($\solution{int n }$) {
walzen = SPIELWALZE$\solution{[n];}$
}
...
}
\end{minted}
\end{minipage} \\
\end{tabular}
\end{document}
|