Project

General

Profile

Revision 2

Final delivery

View differences:

Chunk.java
4 4
	private byte[] content;
5 5
	private int chunkN;
6 6
	private int size; 
7
	private int repDeg;
8
	private int goalRepDeg;
7 9

  
8
	public static int chunkMaxSize = 64000;
9
	
10 10

  
11 11

  
12

  
13 12
 
14 13
		public Chunk(String fileID, int chunkn, byte[] content) {
15 14
			this.chunkN = chunkn;
......
17 16
			this.content = content;
18 17
			this.size = content.length;
19 18
			this.chunkID=fileID + "chunk" + chunkn;
19
			this.repDeg = 1;
20 20
		
21 21
		}
22

  
23 22
		
24 23
		public String getChunkId() {
25 24
			return this.chunkID;
......
40 39
		public int getsize() {
41 40
			return this.size;
42 41
		}
42

  
43
		public int getRepDeg() {
44
			return repDeg;
45
		}
46

  
47
		public void setRepDeg(int repDeg) {
48
			this.repDeg = repDeg;
49
		}
43 50
		
51
		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
		}
44 65
	
45 66
	}

Also available in: Unified diff