org.xnap.search
Class AbstractSearchResult

java.lang.Object
  extended by org.xnap.search.AbstractSearchResult
All Implemented Interfaces:
SearchResult
Direct Known Subclasses:
FreewaySearchResult, GiFTSearchResult, JTellaSearchResult, LimeWireSearchResult, OpenNapSearchResult, OvernetSearchResult

public abstract class AbstractSearchResult
extends java.lang.Object
implements SearchResult

This class is the default implementation for search results.


Field Summary
 
Fields inherited from interface org.xnap.search.SearchResult
BITRATE, FREQUENCY, HIDE_PREFIX, LENGTH, MD5, SHA1, URN
 
Constructor Summary
AbstractSearchResult()
           
AbstractSearchResult(java.lang.String separatorChars)
          Constructs the search result object.
 
Method Summary
 java.lang.Object get(java.lang.String key)
          Returns a value.
 javax.swing.Icon getIcon()
          Returns null.
 java.lang.String[] getPath()
          Returns the path.
 java.lang.String getShortFilename()
          Splits SearchResult.getFilename() by the last occurence of separatorChars and returns the remainder.
 int getSourcesCount()
          Returns 1.
 java.util.Iterator keys()
          Returns an iterator for all keys that can be retreived by calling SearchResult.get(String).
 void put(java.lang.String key, java.lang.Object value)
          Sets the value of key to value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xnap.search.SearchResult
canGroup, createContainer, getActions, getAvailability, getFilename, getFilesize, getHash, getPeer, getPlugin
 

Constructor Detail

AbstractSearchResult

public AbstractSearchResult(java.lang.String separatorChars)
Constructs the search result object.

Parameters:
separatorCharss - the path separator chars

AbstractSearchResult

public AbstractSearchResult()
Method Detail

get

public java.lang.Object get(java.lang.String key)
Returns a value. Uses a Hashtable to retreive the value.

Specified by:
get in interface SearchResult
Parameters:
key - the key

getIcon

public javax.swing.Icon getIcon()
Returns null.

Specified by:
getIcon in interface SearchResult

getPath

public java.lang.String[] getPath()
Returns the path. Uses a StringTokenizer to split SearchResult.getFilename() by separatorCharss.

Specified by:
getPath in interface SearchResult
Returns:
null, if result has no path; the path, otherwise

getShortFilename

public java.lang.String getShortFilename()
Splits SearchResult.getFilename() by the last occurence of separatorChars and returns the remainder.

Specified by:
getShortFilename in interface SearchResult

getSourcesCount

public int getSourcesCount()
Returns 1.

Specified by:
getSourcesCount in interface SearchResult

keys

public java.util.Iterator keys()
Description copied from interface: SearchResult
Returns an iterator for all keys that can be retreived by calling SearchResult.get(String).

Specified by:
keys in interface SearchResult
Returns:
null, if no keys are defined

put

public void put(java.lang.String key,
                java.lang.Object value)
Sets the value of key to value.



Copyright © 2001-2005 XNap Team. All Rights Reserved.