|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.AddrTools.AddrPrefix
public static final class AddrTools.AddrPrefix
Immutable store of a non-null, non-zero-length unsigned-byte IP(v4) address prefix.
| Field Summary | |
|---|---|
private byte[] |
prefix
Address prefix, non-zero-length, non-null. |
| Constructor Summary | |
|---|---|
AddrTools.AddrPrefix(AddrTools.AddrPrefix ap,
int len)
Create a shorter (but non-zero-length) instance from an existing prefix. |
|
AddrTools.AddrPrefix(byte[] addrPrefix)
Create an instance from a non-null, non-zero-length byte array. |
|
AddrTools.AddrPrefix(byte[] addrPrefix,
int len)
Create an instance from the prefix of a non-null, non-zero-length byte array. |
|
AddrTools.AddrPrefix(java.lang.String s)
Create an instance by parsing a padded dotted prefix format. |
|
| Method Summary | |
|---|---|
int |
compareTo(AddrTools.AddrPrefix other)
Sorted as if in a dictionary with the bytes treated as unsigned. |
boolean |
equals(java.lang.Object obj)
Equal if the prefixes are the same length and have the same content. |
int |
hashCode()
Compute hash based on the assumption that most prefixes are 1--3 bytes long. |
boolean |
isStrictPrefix(AddrTools.AddrPrefix other)
Returns true if the argument is a strict prefix of this value. |
int |
length()
Get the prefix length, in bytes; strictly positive. |
byte[] |
toByteArray()
Get a copy of the byte[] prefix data; never null. |
java.lang.String |
toPaddedDottedPrefix()
Print as padded dotted prefix; never null. |
java.lang.String |
toString()
Human-readable representation; currently equivalent to toPaddedDottedPrefix(); never null. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final byte[] prefix
| Constructor Detail |
|---|
public AddrTools.AddrPrefix(byte[] addrPrefix)
addrPrefix - prefix of address; non-null
public AddrTools.AddrPrefix(byte[] addrPrefix,
int len)
public AddrTools.AddrPrefix(AddrTools.AddrPrefix ap,
int len)
public AddrTools.AddrPrefix(java.lang.String s)
throws java.lang.IllegalArgumentException
Can be performance-critical, especially at start-up, so hand-crafted for speed and to avoid creating unnecessary objects.
s - dotted prefix of form n(.n)* eg 127.0.0 or 10.0 or 10.000;
there must be at least one octet,
and each octet must be between 1 and 3 digits long
java.lang.IllegalArgumentException - if the value is unparsable
or not at least one octet| Method Detail |
|---|
public int length()
public boolean isStrictPrefix(AddrTools.AddrPrefix other)
public int compareTo(AddrTools.AddrPrefix other)
compareTo in interface java.lang.Comparable<AddrTools.AddrPrefix>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic byte[] toByteArray()
public java.lang.String toPaddedDottedPrefix()
public java.lang.String toString()
toString in class java.lang.Object
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||