root / proj / src / Chunk.java @ 2
History | View | Annotate | Download (1.07 KB)
1 | 1 | up20160559 | public class Chunk{ |
---|---|---|---|
2 | private String chunkID; |
||
3 | private String fileID; |
||
4 | private byte[] content; |
||
5 | private int chunkN; |
||
6 | private int size; |
||
7 | 2 | up20160559 | private int repDeg; |
8 | private int goalRepDeg; |
||
9 | 1 | up20160559 | |
10 | |||
11 | |||
12 | |||
13 | public Chunk(String fileID, int chunkn, byte[] content) { |
||
14 | this.chunkN = chunkn;
|
||
15 | this.fileID = fileID;
|
||
16 | this.content = content;
|
||
17 | this.size = content.length;
|
||
18 | this.chunkID=fileID + "chunk" + chunkn; |
||
19 | 2 | up20160559 | this.repDeg = 1; |
20 | 1 | up20160559 | |
21 | } |
||
22 | |||
23 | public String getChunkId() { |
||
24 | return this.chunkID; |
||
25 | } |
||
26 | |||
27 | public int getChunkN() { |
||
28 | return this.chunkN; |
||
29 | } |
||
30 | |||
31 | public String getFileID() { |
||
32 | return this.fileID; |
||
33 | } |
||
34 | |||
35 | public byte[] getContent() { |
||
36 | return this.content; |
||
37 | } |
||
38 | |||
39 | public int getsize() { |
||
40 | return this.size; |
||
41 | } |
||
42 | 2 | up20160559 | |
43 | public int getRepDeg() { |
||
44 | return repDeg;
|
||
45 | } |
||
46 | |||
47 | public void setRepDeg(int repDeg) { |
||
48 | this.repDeg = repDeg;
|
||
49 | } |
||
50 | 1 | up20160559 | |
51 | 2 | up20160559 | public void increaseRepDeg() { |
52 | this.repDeg++;
|
||
53 | } |
||
54 | public void decreaseRepDeg() { |
||
55 | this.repDeg--;
|
||
56 | } |
||
57 | |||
58 | public int getGoalRepDeg() { |
||
59 | return goalRepDeg;
|
||
60 | } |
||
61 | |||
62 | public void setGoalRepDeg(int goalRepDeg) { |
||
63 | this.goalRepDeg = goalRepDeg;
|
||
64 | } |
||
65 | 1 | up20160559 | |
66 | } |