Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings.html
More file actions
Latest commit
34 lines (34 loc) · 1.44 KB
/
Copy pathstrings.html
File metadata and controls
34 lines (34 loc) · 1.44 KB
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
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8">
<title>Strings as heap objects</title>
<linkrel="stylesheet" href="./dist/index.css">
<style>
body { margin:0; font-family: system-ui, sans-serif; }
java-memory-playground { display: block; width:100vw; height:100vh; }
</style>
</head>
<body>
<java-memory-playgroundid="expanded"></java-memory-playground>
<scriptsrc="./dist/index.umd.js"></script>
<script>
// inlineStrings off: the lesson is about Strings themselves.
document.getElementById('expanded').setAttribute('options',
JSON.stringify({inlineStrings: false,hideSidebar: true,hideDeclareGlobalVariable: false}));
document.getElementById('expanded').setAttribute('memory',JSON.stringify({
klasses: {Person: {attributes: {name: "String"}}},
objects: {
"@p1": {klass: "Person",attributes: {name: {dataType: "String",value: "@s1"}},position: {x: 60,y: 60}},
"@p2": {klass: "Person",attributes: {name: {dataType: "String",value: "@s1"}},position: {x: 60,y: 260}},
"@s1": {klass: "String",literal: "Ada",attributes: {},position: {x: 420,y: 160}}
},
variables: {
"@v1": {name: "a",dataType: "Person",value: "@p1",position: {x: -180,y: 60}},
"@v2": {name: "b",dataType: "Person",value: "@p2",position: {x: -180,y: 260}}
},
methodCalls: {}
}));
</script>
</body>
</html>