Package nl.cwi.monetdb.jdbc
Class MonetINET
java.lang.Object
nl.cwi.monetdb.jdbc.MonetINET
- All Implemented Interfaces:
SQLData
public class MonetINET extends Object implements SQLData
The INET class represents the INET datatype in MonetDB. It
represents a IPv4 address with a certain mask applied. Currently,
IPv6 is not supported.
The input format for INET is x.x.x.x/y where x.x.x.x is an IP address and y is the number of bits in the netmask. If the /y part is left off, then the netmask is 32, and the value represents just a single host. On display, the /y portion is suppressed if the netmask is 32.
This class allows to retrieve the value of this INET as InetAddress. This is probably meaningful only and only if the netmask is 32. The getNetmaskBits() method can be used to retrieve the subnet bits.
The input format for INET is x.x.x.x/y where x.x.x.x is an IP address and y is the number of bits in the netmask. If the /y part is left off, then the netmask is 32, and the value represents just a single host. On display, the /y portion is suppressed if the netmask is 32.
This class allows to retrieve the value of this INET as InetAddress. This is probably meaningful only and only if the netmask is 32. The getNetmaskBits() method can be used to retrieve the subnet bits.
- Author:
- Fabian Groffen
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidfromString(String newinet)StringgetAddress()InetAddressgetInetAddress()intgetNetmaskBits()StringgetSQLTypeName()voidreadSQL(SQLInput stream, String typeName)voidsetAddress(String newinet)voidsetInetAddress(InetAddress iaddr)voidsetNetmaskBits(int bits)StringtoString()voidwriteSQL(SQLOutput stream)
-
Constructor Details
-
Method Details
-
getSQLTypeName
- Specified by:
getSQLTypeNamein interfaceSQLData
-
readSQL
- Specified by:
readSQLin interfaceSQLData- Throws:
SQLException
-
writeSQL
- Specified by:
writeSQLin interfaceSQLData- Throws:
SQLException
-
toString
-
fromString
- Throws:
Exception
-
getAddress
-
setAddress
- Throws:
Exception
-
getNetmaskBits
- Throws:
SQLException
-
setNetmaskBits
- Throws:
Exception
-
getInetAddress
- Throws:
SQLException
-
setInetAddress
- Throws:
Exception
-