org.hd.d.pg2k.svrCore.location
Class GeoUtils.CCTLD

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.location.GeoUtils.CCTLD
All Implemented Interfaces:
MemoryTools.Internable
Enclosing class:
GeoUtils

public static final class GeoUtils.CCTLD
extends java.lang.Object
implements MemoryTools.Internable

An immutable DNS ccTLD (two-letter) country code. Lower-case, two-ASCII-letter code.

This is not the ISO3316-1 code; eg the United Kingdom is "uk" not "gb" though "gb" may be acceptable as an alias.


Field Summary
 java.lang.String code
          The two-letter lower-case-ASCII ccTLD; never null.
 
Constructor Summary
GeoUtils.CCTLD(java.lang.String code)
          Construct instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two ccTLDs are the same if their underlying codes are the same.
 int hashCode()
          A fast hash reflecting approx ~5 bits of information per char.
static boolean isSyntaticallyValidCcTLD(java.lang.String code)
          True if argument is a (non-null) syntatically-valid ccTLD code.
 java.lang.String toString()
          This returns the code as its String representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code

public final java.lang.String code
The two-letter lower-case-ASCII ccTLD; never null.

Constructor Detail

GeoUtils.CCTLD

public GeoUtils.CCTLD(java.lang.String code)
Construct instance. Supplied code must not be null and must consist of exactly two lower-case 7-bit-ASCII letters.

The code is only checked for syntax, not that such a country code actually exists.

Method Detail

isSyntaticallyValidCcTLD

public static boolean isSyntaticallyValidCcTLD(java.lang.String code)
True if argument is a (non-null) syntatically-valid ccTLD code. This only looks for syntactic validity.

Returns:
true iff two-letter lower-case-ASCII argument; false for null or otherwise-invalid arguments

hashCode

public int hashCode()
A fast hash reflecting approx ~5 bits of information per char.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Two ccTLDs are the same if their underlying codes are the same.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
This returns the code as its String representation.

Overrides:
toString in class java.lang.Object

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.