Revision 1333,
609 bytes
checked in by wojtekp, 11 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package test.appProfConverter; |
---|
2 | import org.w3c.dom.Element; |
---|
3 | |
---|
4 | public class Memory { |
---|
5 | |
---|
6 | public Memory(Element e) throws Exception { |
---|
7 | LoadElement(e); |
---|
8 | } |
---|
9 | |
---|
10 | private void LoadElement(Element e) throws Exception { |
---|
11 | if (!e.getTagName().equals("Memory")) { |
---|
12 | throw new Exception("Invalid element tag."); |
---|
13 | } |
---|
14 | |
---|
15 | Capacity = Integer.parseInt(e.getElementsByTagName("Capacity").item(0) |
---|
16 | .getChildNodes().item(0).getNodeValue().trim()); |
---|
17 | } |
---|
18 | |
---|
19 | public int Capacity; |
---|
20 | |
---|
21 | public String ToString() { |
---|
22 | String str = ""; |
---|
23 | |
---|
24 | str += "Memory:\n"; |
---|
25 | str += " Capacity: " + Integer.toString(Capacity) + "\n"; |
---|
26 | |
---|
27 | return str; |
---|
28 | } |
---|
29 | |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.