DataStructure
public class RouterAddress extends DataStructureImpl
コンストラクタ | 説明 |
---|---|
RouterAddress() |
|
RouterAddress(java.lang.String style,
OrderedProperties options,
int cost) |
For efficiency when created by a Transport.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
boolean |
deepEquals(RouterAddress addr) |
Everything, including Transport, host, port, options, and cost
|
boolean |
equals(java.lang.Object object) |
Transport, host, and port only.
|
int |
getCost() |
Retrieve the weighted cost of this address, relative to other methods of
contacting this router.
|
java.util.Date |
getExpiration() |
推奨されていません。
unused for now
|
long |
getExpirationTime() |
推奨されていません。
unused for now
|
java.lang.String |
getHost() |
Convenience, same as getOption("host").
|
byte[] |
getIP() |
Caching version of InetAddress.getByName(getOption("host")).getAddress(), which is slow.
|
java.lang.String |
getOption(java.lang.String opt) |
|
java.util.Properties |
getOptions() |
推奨されていません。
use getOptionsMap()
|
java.util.Map<java.lang.Object,java.lang.Object> |
getOptionsMap() |
Retrieve the transport specific options necessary for communication
|
int |
getPort() |
Caching version of Integer.parseInt(getOption("port"))
Caches valid ports 1-65535 only.
|
java.lang.String |
getTransportStyle() |
Retrieve the type of transport that must be used to communicate on this address.
|
int |
hashCode() |
Just use a few items for speed (expiration is always null).
|
void |
readBytes(java.io.InputStream in) |
As of 0.9.3, expiration MUST be all zeros as it is ignored on
readin and the signature will fail.
|
void |
setCost(int cost) |
Configure the weighted cost of using the address.
|
void |
setExpiration(java.util.Date expiration) |
推奨されていません。
unused for now
|
void |
setOptions(java.util.Properties options) |
推奨されていません。
unused, use 3-arg constructor
|
void |
setTransportStyle(java.lang.String transportStyle) |
推奨されていません。
unused, use 3-arg constructor
|
java.lang.String |
toString() |
This is used on peers.jsp so sort options so it looks better.
|
void |
writeBytes(java.io.OutputStream out) |
As of 0.9.3, expiration MUST be all zeros as it is ignored on
readin and the signature will fail.
|
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
public static final java.lang.String PROP_HOST
public static final java.lang.String PROP_PORT
public RouterAddress()
public RouterAddress(java.lang.String style, OrderedProperties options, int cost)
options
- not copied; do not reuse or modifycost
- 0-255public int getCost()
public void setCost(int cost)
@Deprecated public java.util.Date getExpiration()
@Deprecated public long getExpirationTime()
@Deprecated public void setExpiration(java.util.Date expiration)
public java.lang.String getTransportStyle()
@Deprecated public void setTransportStyle(java.lang.String transportStyle)
java.lang.IllegalStateException
- if was already set@Deprecated public java.util.Properties getOptions()
public java.util.Map<java.lang.Object,java.lang.Object> getOptionsMap()
public java.lang.String getOption(java.lang.String opt)
@Deprecated public void setOptions(java.util.Properties options)
options
- non-nulljava.lang.IllegalStateException
- if was already setpublic byte[] getIP()
public java.lang.String getHost()
public int getPort()
public void readBytes(java.io.InputStream in) throws DataFormatException, java.io.IOException
in
- stream to read fromjava.lang.IllegalStateException
- if was already read inDataFormatException
- if the data is improperly formattedjava.io.IOException
- if there was a problem reading the streampublic void writeBytes(java.io.OutputStream out) throws DataFormatException, java.io.IOException
out
- stream to write toDataFormatException
- if the data was incomplete or not yet ready to be writtenjava.io.IOException
- if there was a problem writing to the streampublic boolean equals(java.lang.Object object)
equals
クラス内 java.lang.Object
public boolean deepEquals(RouterAddress addr)
addr
- may be nullpublic int hashCode()
hashCode
クラス内 java.lang.Object
public java.lang.String toString()
toString
クラス内 java.lang.Object