|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lukasfeiler.util.Int
A 32 Bit Integer. This class allows a bitwise handling of an integer. The integer can be as well separated into 4 octets. This class is also capable of handling the dotted-quad notation (as used for IPv4 addresses).
| Constructor Summary | |
Int(int i)
Constructor that takes an int value as an argument. |
|
Int(java.lang.String s)
Constructor that takes the integer in dottet-quad notation as an argument. |
|
| Method Summary | |
boolean |
allBitsSet()
Returns whether all bits are set. |
boolean |
getBit(int bitNumber)
Returns one of the 32 bits as a boolean value. |
short |
getOctet(int octetNumber)
Returns one of the 4 octets as a short value. |
short[] |
getOctets()
Returns the 4 octets of the 32 bit integer as a short array. |
int |
intValue()
Returns the int value of this instance. |
java.lang.String |
toBitString()
Returns all the bits of this integer as a string (e.g. 11000000101010000000000100001010 for -1062731510). |
java.lang.String |
toString()
Returns the integer in the dottet-quad notation (e.g. 192.168.1.10). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Int(java.lang.String s)
throws InvalidIntOctetException
s - A string in the dottet-quad notation (e.g. 192.168.1.10).public Int(int i)
| Method Detail |
public short[] getOctets()
public int intValue()
public java.lang.String toBitString()
public java.lang.String toString()
public short getOctet(int octetNumber)
public boolean getBit(int bitNumber)
public boolean allBitsSet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||