Top Description Fields Constructors Methods
org.xnio.channels

public final Class SocketAddressBuffer

extends Object
Class Inheritance
Imports
java.net.SocketAddress

A buffer for source and destination addresses.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private SocketAddress
private SocketAddress

Constructor Summary

AccessConstructor and Description
public
SocketAddressBuffer()

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clear both addresses in the buffer.

public SocketAddress

Returns:

the destination address, or null if not set
getDestinationAddress
()

Get the destination address.

public <A extends SocketAddress> A

Returns:

the destination address, or null if not set
getDestinationAddress
(Class<A>
the address type to get
type
)

Get the destination address.

public SocketAddress

Returns:

the source address, or null if not set
getSourceAddress
()

Get the source address.

public <A extends SocketAddress> A

Returns:

the source address, or null if not set
getSourceAddress
(Class<A>
the address type to get
type
)

Get the source address.

public void
setDestinationAddress(final SocketAddress
the destination address, or null to clear
destinationAddress
)

Set the destination address.

public void
setSourceAddress(final SocketAddress
the source address, or null to clear
sourceAddress
)

Set the source address.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

destinationAddressback to summary
private SocketAddress destinationAddress
sourceAddressback to summary
private SocketAddress sourceAddress

Constructor Detail

SocketAddressBufferback to summary
public SocketAddressBuffer()

Construct a new instance.

Method Detail

clearback to summary
public void clear()

Clear both addresses in the buffer.

getDestinationAddressback to summary
public SocketAddress getDestinationAddress()

Get the destination address.

Returns:SocketAddress

the destination address, or null if not set

getDestinationAddressback to summary
public <A extends SocketAddress> A getDestinationAddress(Class<A> type)

Get the destination address.

Parameters
type:Class<A>

the address type to get

Returns:A

the destination address, or null if not set

getSourceAddressback to summary
public SocketAddress getSourceAddress()

Get the source address.

Returns:SocketAddress

the source address, or null if not set

getSourceAddressback to summary
public <A extends SocketAddress> A getSourceAddress(Class<A> type)

Get the source address.

Parameters
type:Class<A>

the address type to get

Returns:A

the source address, or null if not set

setDestinationAddressback to summary
public void setDestinationAddress(final SocketAddress destinationAddress)

Set the destination address.

Parameters
destinationAddress:SocketAddress

the destination address, or null to clear

setSourceAddressback to summary
public void setSourceAddress(final SocketAddress sourceAddress)

Set the source address.

Parameters
sourceAddress:SocketAddress

the source address, or null to clear