File: Record.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 (42 lines) | stat: -rw-r--r-- 1,080 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

package Pdapilot;

import java.io.*;

/** A representation of a database record.
 */

public class Record extends Block {
		public int index, category;
		public RecordID id;
		public boolean deleted, modified, busy, secret, archived;
		
		public Record() {
			super();
		}
		
		public Record(byte[] contents, RecordID id, int index, int attr, int category) {
			this.id = id;
			this.index = index;
			this.deleted = ((attr & 0x80)!=0) ? true : false;
			this.modified = ((attr & 0x40)!=0) ? true : false;
			this.busy = ((attr & 0x20)!=0) ? true : false;
			this.secret = ((attr & 0x10)!=0) ? true : false;
			this.archived = ((attr & 0x08)!=0) ? true : false;
			this.category = category;
			this.unpack(contents);
		}
		
		public void Fill() {
			this.deleted = false;
			this.modified = false;
			this.busy = false;
			this.secret = false;
			this.archived = false;
		}
		
		public String describe() {
			return " id "+id+", index "+index+", deleted "+deleted+", modified "+modified+
			", busy "+busy+", secret "+secret+", archived "+archived+", category "+ category;
		}
}