FreewaySearchResult.java

Index Score
org.xnap.plugin.freeway
XNap 3

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
/* * XNap - A P2P framework and client. * * See the file AUTHORS for copyright information. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.xnap.plugin.freeway; import java.awt.event.ActionEvent; import javax.swing.Action; import javax.swing.Icon; import org.gnu.freeway.protocol.afs.esed2.RootNode; import org.xnap.XNap; import org.xnap.gui.action.AbstractDownloadAction; import org.xnap.gui.util.FocusManager; import org.xnap.peer.Peer; import org.xnap.plugin.Plugin; import org.xnap.search.AbstractSearchResult; import org.xnap.search.SearchResult; import org.xnap.search.SearchResultContainer; import org.xnap.transfer.DownloadManager; import org.xnap.util.Formatter; /** * */ public class FreewaySearchResult extends AbstractSearchResult { RootNode node; /** * */ public FreewaySearchResult(RootNode node) { this.node = node; put(XNap.tr("Filesize"), Formatter.formatSize(getFilesize())); put(XNap.tr("CRC"), new Integer(node.getFileIdentifier().getFileCRC())); put(XNap.tr("Description"), node.getDescription()); put(XNap.tr("Mimetype"), node.getMimeType()); put(XNap.tr("URI"), node.getFileIdentifier().toURI()); put(XNap.tr("Query Hash"), node.getFileIdentifier().chk.query.toHex()); put(XNap.tr("Key Hash"), node.getFileIdentifier().chk.key.toHex()); } /* * @see org.xnap.search.SearchResult#canGroup(org.xnap.search.SearchResult) */ public boolean canGroup(SearchResult result) { return false; } /* * @see org.xnap.search.SearchResult#createContainer() */ public SearchResultContainer createContainer() { return null; } public Icon getIcon() { return FreewayPlugin.ICON_16; } /* * @see org.xnap.search.SearchResult#getActions() */ public Action[] getActions() { return new Action[] { new FreewayDownloadAction() }; } /* * @see org.xnap.search.SearchResult#getAvailability() */ public int getAvailability() { return 0; } /* * @see org.xnap.search.SearchResult#getFilename() */ public String getFilename() { return node.getFileName(); } /* * @see org.xnap.search.SearchResult#getFilesize() */ public long getFilesize() { return node.getFileIdentifier().getFileLength(); } /* * @see org.xnap.search.SearchResult#getHash() */ public Object getHash() { return new Integer(node.getFileIdentifier().getFileCRC()); } /* * @see org.xnap.search.SearchResult#getPlugin() */ public Plugin getPlugin() { return null; } /* * @see org.xnap.search.SearchResult#getPeer() */ public Peer getPeer() { return null; } private class FreewayDownloadAction extends AbstractDownloadAction { public void actionPerformed(ActionEvent e) { DownloadManager.getInstance().add(new FreewayDownload(node)); FocusManager.setFocusTo("transfer",e); } } }

The table below shows all metrics for FreewaySearchResult.java.

MetricValueDescription