1 18 package org.apache.activemq.kaha.impl.data; 19 20 import org.apache.activemq.kaha.StoreLocation; 21 22 23 28 public final class DataItem implements Item, StoreLocation{ 29 30 private int file=(int) POSITION_NOT_SET; 31 private long offset=POSITION_NOT_SET; 32 private int size; 33 34 public DataItem(){} 35 36 DataItem(DataItem item) { 37 this.file = item.file; 38 this.offset = item.offset; 39 this.size = item.size; 40 } 41 42 boolean isValid(){ 43 return file != POSITION_NOT_SET; 44 } 45 46 50 public int getSize(){ 51 return size; 52 } 53 54 57 public void setSize(int size){ 58 this.size=size; 59 } 60 61 65 public long getOffset(){ 66 return offset; 67 } 68 69 72 public void setOffset(long offset){ 73 this.offset=offset; 74 } 75 76 80 public int getFile(){ 81 return file; 82 } 83 84 87 public void setFile(int file){ 88 this.file=file; 89 } 90 91 94 public String toString(){ 95 String result="offset = "+offset+", file = " + file + ", size = "+size; 96 return result; 97 } 98 99 public DataItem copy() { 100 return new DataItem(this); 101 } 102 } 103 | Popular Tags |