|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.limegroup.gnutella.altlocs.AlternateLocationCollection
This class holds a collection of AlternateLocation instances, providing type safety for alternate location data.
AlternateLocation| Method Summary | |
boolean |
add(AlternateLocation al)
Adds a new AlternateLocation to the list. |
int |
addAll(AlternateLocationCollection alc)
Implements the AlternateLocationCollector interface. |
void |
clear()
|
boolean |
contains(AlternateLocation loc)
|
static AlternateLocationCollection |
create(URN sha1)
Factory constructor for creating a new AlternateLocationCollection for this URN. |
static AlternateLocationCollection |
createCollectionFromHttpValue(java.lang.String value)
Creates a new AlternateLocationCollection with all alternate locations contained in the given comma-delimited HTTP header value string. |
boolean |
equals(java.lang.Object o)
|
int |
getAltLocsSize()
Number of alternate locations this collector is holding |
URN |
getSHA1Urn()
Returns the SHA1 for this AlternateLocationCollection. |
boolean |
hasAlternateLocations()
Returns whether or not this AlternateLocationCollector has any alternate locations. |
java.lang.String |
httpStringValue()
Implements the HTTPHeaderValue interface. |
java.util.Iterator |
iterator()
|
boolean |
remove(AlternateLocation al)
Removes this AlternateLocation from the active locations and adds it to the removed locations. |
java.lang.String |
toString()
Overrides Object.toString to print out all of the alternate locations for this collection of alternate locations. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public static AlternateLocationCollection create(URN sha1)
sha1 - the SHA1 URN for this collection
public static AlternateLocationCollection createCollectionFromHttpValue(java.lang.String value)
value - the HTTP header value containing alternate locations
NullPointerException - if value is nullpublic URN getSHA1Urn()
getSHA1Urn in interface AlternateLocationCollectorpublic boolean add(AlternateLocation al)
add in interface AlternateLocationCollectoral - the AlternateLocation to add
IllegalArgumentException - if the
AlternateLocation being added does not have a SHA1 urn or if
the SHA1 urn does not match the urn for this collectionpublic boolean remove(AlternateLocation al)
remove in interface AlternateLocationCollectorpublic int addAll(AlternateLocationCollection alc)
addAll in interface AlternateLocationCollectoralc - the AlternateLocationCollection to add
NullPointerException - if alc is
null
IllegalArgumentException - if the SHA1 of the
collection to add does not match the collection of thispublic void clear()
public boolean hasAlternateLocations()
AlternateLocationCollector
hasAlternateLocations in interface AlternateLocationCollectorpublic boolean contains(AlternateLocation loc)
public java.lang.String httpStringValue()
httpStringValue in interface HTTPHeaderValuepublic int getAltLocsSize()
AlternateLocationCollector
getAltLocsSize in interface AlternateLocationCollectorpublic java.util.Iterator iterator()
public java.lang.String toString()
public boolean equals(java.lang.Object o)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||