1 18 19 20 package sync4j.framework.core; 21 22 30 public final class Mem 31 implements java.io.Serializable { 32 33 35 private Boolean sharedMem; 36 private long freeMem ; 37 private long freeID ; 38 39 41 44 protected Mem(){} 45 46 54 public Mem(final boolean sharedMem, final long freeMem, final long freeID) { 55 setFreeMem(freeMem); 56 setFreeID(freeID); 57 this.sharedMem = (sharedMem) ? new Boolean (sharedMem) : null; 58 } 59 60 62 68 public boolean isSharedMem() { 69 return (sharedMem != null); 70 } 71 72 77 public void setSharedMem(Boolean sharedMem) { 78 this.sharedMem = (sharedMem.booleanValue()) ? sharedMem : null; 79 } 80 81 86 public Boolean getSharedMem() { 87 if (!sharedMem.booleanValue()) { 88 return null; 89 } 90 return sharedMem; 91 } 92 93 99 public long getFreeMem() { 100 return freeMem; 101 } 102 103 110 public void setFreeMem(long freeMem) { 111 if (freeMem < 0) { 112 throw new IllegalArgumentException ("freeMem cannot be < 0)"); 113 } 114 this.freeMem = freeMem; 115 } 116 117 123 public long getFreeID() { 124 return freeID; 125 } 126 127 134 public void setFreeID(long freeID) { 135 if (freeID < 0) { 136 throw new IllegalArgumentException ("freeID cannot be < 0)"); 137 } 138 this.freeID = freeID; 139 } 140 } 141 | Popular Tags |