1 25 26 package org.jrobin.inspector; 27 28 import org.jrobin.core.*; 29 30 import java.io.File ; 31 import java.io.IOException ; 32 33 class RrdNode { 34 private int dsIndex = -1, arcIndex = -1; 35 private String label; 36 37 RrdNode(RrdDb rrd) { 38 String path = rrd.getRrdBackend().getPath(); 40 label = new File (path).getName(); 41 } 42 43 RrdNode(RrdDb rrd, int dsIndex) throws IOException , RrdException { 44 this.dsIndex = dsIndex; 46 RrdDef def = rrd.getRrdDef(); 47 DsDef[] dsDefs = def.getDsDefs(); 48 label = dsDefs[dsIndex].dump(); 49 } 50 51 RrdNode(RrdDb rrd, int dsIndex, int arcIndex) throws IOException , RrdException { 52 this.dsIndex = dsIndex; 54 this.arcIndex = arcIndex; 55 ArcDef[] arcDefs = rrd.getRrdDef().getArcDefs(); 56 label = arcDefs[arcIndex].dump(); 57 } 58 59 int getDsIndex() { 60 return dsIndex; 61 } 62 63 int getArcIndex() { 64 return arcIndex; 65 } 66 67 public String toString() { 68 return label; 69 } 70 } 71 | Popular Tags |