File: AppBlock.java

package info (click to toggle)
pilot-link 0.8.7-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,256 kB
  • ctags: 3,233
  • sloc: ansic: 24,039; java: 2,162; cpp: 1,641; sh: 1,585; makefile: 1,363; perl: 723; yacc: 660; python: 239; tcl: 14
file content (43 lines) | stat: -rw-r--r-- 948 bytes parent folder | download | duplicates (2)
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

package Pdapilot.expense;

import java.io.*;
import Pdapilot.Util;

public class AppBlock extends Pdapilot.CategoryAppBlock {
	
	public sort sortOrder;
	public CustomCurrency[] currencies;
		
	public AppBlock() {
		super();
	}
		
	public AppBlock(byte[] contents) {
		super(contents);
	}
	
	public native void unpack(byte[] data);
	public native byte[] pack();
	
	public void fill() {
		currencies = new CustomCurrency[4];
	}
		
	public String describe() {
		StringBuffer c = new StringBuffer();
		c.append("currencies=[");
		if (currencies != null)
			for (int i=0;i<currencies.length;i++) {
				if (i>0)
					c.append(",");
				c.append("[");
				c.append("name=" + Util.prettyPrint(currencies[i].name));
				c.append(",symbol=" + Util.prettyPrint(currencies[i].symbol));
				c.append(",rate=" + Util.prettyPrint(currencies[i].rate));
				c.append("]");
			}
		c.append("]");
		return "sort="+ sortOrder+", " + c + ", " + super.describe();
	}
}