FileDocCategorySizeDatePackage
IpItem.javaAPI DocAzureus 3.0.3.42324Sun Sep 23 04:55:00 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.peers

IpItem

public class IpItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener, org.gudy.azureus2.ui.swt.debug.ObfusticateCellText
author
Olivier
author
TuxPaper (2004/Apr/19: modified to TableCellAdapter)

Fields Summary
Constructors Summary
public IpItem(String table_id)
Default Constructor

    super("ip", POSITION_LAST, 100, table_id);
    setObfustication(true);
   
Methods Summary
public java.lang.StringgetObfusticatedText(TableCell cell)

  	return cell.getText().substring(0, 3);
  
public voidrefresh(TableCell cell)

    PEPeer peer = (PEPeer)cell.getDataSource();
    String sText = (peer == null) ? "" : peer.getIp();

    if (cell.setText(sText) || !cell.isValid()) {
      String[] sBlocks = sText.split("\\.");
      if (sBlocks.length == 4) {
        try {
          long l = (Long.parseLong(sBlocks[0]) << 24) +
                   (Long.parseLong(sBlocks[1]) << 16) +
                   (Long.parseLong(sBlocks[2]) << 8) +
                   Long.parseLong(sBlocks[3]);
          cell.setSortValue(l);
        } catch (Exception e) { e.printStackTrace(); /* ignore */ }
      }
    }