Package adams.core.base
Class BaseHostname
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.BaseHostname
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class BaseHostname extends AbstractBaseString
Wrapper for internet hostnames. See also: WikiPedia- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
VALID_CHARS
the valid characters.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description BaseHostname()
Initializes the string with localhost and no port.BaseHostname(String s)
Initializes the object with the hostname to parse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).boolean
hasFavoritesSupport()
Whether this object should have favorites support.String
hostnameValue()
Returns the hostname part without the port.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.int
portValue()
Returns the port part of the hostname, if available.int
portValue(int defPort)
Returns the port part of the hostname, if available.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, initialize, isEmpty, length, setValue, stringValue
-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
VALID_CHARS
public static final String VALID_CHARS
the valid characters.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseHostname
public BaseHostname()
Initializes the string with localhost and no port.
-
BaseHostname
public BaseHostname(String s)
Initializes the object with the hostname to parse.- Parameters:
s
- the string to parse
-
-
Method Detail
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValid
in classAbstractBaseString
- Parameters:
value
- the string value to check- Returns:
- true if non-null
-
hostnameValue
public String hostnameValue()
Returns the hostname part without the port.- Returns:
- the hostname
-
portValue
public int portValue()
Returns the port part of the hostname, if available.- Returns:
- the port, -1 if none specified
-
portValue
public int portValue(int defPort)
Returns the port part of the hostname, if available.- Parameters:
defPort
- the default port to use- Returns:
- the port, defPort if none specified
-
hasFavoritesSupport
public boolean hasFavoritesSupport()
Whether this object should have favorites support.- Overrides:
hasFavoritesSupport
in classBaseObject
- Returns:
- true if to support favorites
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classAbstractBaseString
- Returns:
- the tool tip
-
-