コード例 #1
0
  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;
  }
コード例 #2
0
 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());
 }
コード例 #3
0
 Object getPropertyAt(int index) {
   if (index < 0 || index >= valueNames.length) {
     return null;
   }
   return values.get(valueNames[index]);
 }
コード例 #4
0
 public Object getProperty(String propertyName) {
   return values.get(propertyName);
 }