public Object[] getProperties() { Object[] v = new Object[valueNames.length]; for (int i = 0; i < valueNames.length; i++) { v[i] = values.get(valueNames[i]); } return v; }
public void getDetails(Packet packet) { values.clear(); if (!isInstance(packet)) { return; } ip = (IPPacket) packet; values.put(valueNames[0], new Integer(6)); values.put(valueNames[1], new Integer(ip.priority)); values.put(valueNames[2], new Integer(ip.flow_label)); values.put(valueNames[3], new Integer(ip.length)); values.put(valueNames[4], new Integer(ip.protocol)); values.put(valueNames[5], new Integer(ip.hop_limit)); values.put(valueNames[6], ip.src_ip.getHostAddress()); values.put(valueNames[7], ip.dst_ip.getHostAddress()); values.put(valueNames[8], ip.src_ip.getHostName()); values.put(valueNames[9], ip.dst_ip.getHostName()); }
Object getPropertyAt(int index) { if (index < 0 || index >= valueNames.length) { return null; } return values.get(valueNames[index]); }
public Object getProperty(String propertyName) { return values.get(propertyName); }