File: MemoRecord.java

package info (click to toggle)
pilot-link 0.12.5-dfsg-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 6,868 kB
  • ctags: 5,811
  • sloc: ansic: 53,153; sh: 10,459; java: 2,584; perl: 2,247; python: 1,044; makefile: 991; yacc: 662; cpp: 551; xml: 39
file content (42 lines) | stat: -rw-r--r-- 967 bytes parent folder | download | duplicates (6)
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 org.gnu.pilotlink;

public class MemoRecord extends Record {
    String memo;
    
    /**
    * Calls the constructor of Record which calles setBuffer,
    * do not call setBuffer directly
    */
    public MemoRecord(Record r) {
        super(r);
    }
    public MemoRecord(String txt) {
        memo=txt+'\0';
        setSize(memo.length());
    }
    public String getText() {
        return memo;
    }
    public void setText(String m) {
        memo=m;
        setSize(m.length()+1);
    }
    
    
    /**
    * usually called by the Constructor of Record
    */
    public void setBuffer(byte dat[]) {
        memo=new String(dat)+'\0';
        setSize(memo.length()+1);
    }
    
    public byte[] getBuffer() {
        //Trying to write a Memo!
        //String str="Eine TestNachricht!";
        //byte a[]=str.getBytes();
        //Record r=new Record(a,a.length,64,2);
        //pl.writeRecord(dbh,r);
        return memo.getBytes();
    }
}