1 9 package org.jrobin.core.jrrd; 10 11 import java.io.IOException ; 12 13 19 public class PDPStatusBlock { 20 21 long offset; 22 long size; 23 String lastReading; 24 int unknownSeconds; 25 double value; 26 27 PDPStatusBlock(RRDFile file) throws IOException { 28 29 offset = file.getFilePointer(); 30 lastReading = file.readString(Constants.LAST_DS_LEN); 31 32 file.align(4); 33 34 unknownSeconds = file.readInt(); 35 36 file.skipBytes(4); 37 38 value = file.readDouble(); 39 40 file.skipBytes(64); 42 43 size = file.getFilePointer() - offset; 44 } 45 46 51 public String getLastReading() { 52 return lastReading; 53 } 54 55 60 public double getValue() { 61 return value; 62 } 63 64 70 public int getUnknownSeconds() { 71 return unknownSeconds; 72 } 73 74 79 public String toString() { 80 81 StringBuffer sb = new StringBuffer ("[PDPStatus: OFFSET=0x"); 82 83 sb.append(Long.toHexString(offset)); 84 sb.append(", SIZE=0x"); 85 sb.append(Long.toHexString(size)); 86 sb.append(", lastReading="); 87 sb.append(lastReading); 88 sb.append(", unknownSeconds="); 89 sb.append(unknownSeconds); 90 sb.append(", value="); 91 sb.append(value); 92 sb.append("]"); 93 94 return sb.toString(); 95 } 96 } 97 | Popular Tags |