新手上路~不要见笑
public static InetSocketAddressSpecification singleton(InetAddress address,
int port) {
return singleton(new InetSocketAddress(address, port));
} public static InetSocketAddressSpecification singleton(
final InetSocketAddress address) {
return new InetSocketAddressSpecification() {
public Iterator iterator() {
return IteratorUtils.singletonIterator(address);
}
};
}
public static InetSocketAddressSpecification singleton(InetAddress address,
int port) {
return singleton(new InetSocketAddress(address, port));
} public static InetSocketAddressSpecification singleton(
final InetSocketAddress address) {
return new InetSocketAddressSpecification() {
public Iterator iterator() {
return IteratorUtils.singletonIterator(address);
}
};
}
final InetSocketAddress address)
方法返回的是
new InetSocketAddressSpecification() {
public Iterator iterator() {
return IteratorUtils.singletonIterator(address);
}
}
return IteratorUtils.singletonIterator(address);
}