|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.util.Telno
public class Telno
A phone-number.
A phone-number is defined as follows:
+CCC AAAA NNNN[-EEEE] C = country code A = area code N = number E = extension (optional)
| Constructor Summary | |
|---|---|
Telno()
Creates an empty (and invalid) phono number without extension |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the phone number |
int |
getArea()
Gets the area code. |
int |
getCountry()
Gets the country code. |
int |
getDefaultCountry()
Gets the default country code. |
String |
getError()
Gets the error message. |
int |
getExtension()
Gets the extension. |
int |
getNumber()
Gets the number part. |
String |
getTelno()
Gets the phone number as a string. |
boolean |
isValid()
Returns whether number is valid |
void |
setArea(int area)
Sets the area code. |
void |
setCountry(int country)
Sets the country code. |
void |
setDefaultCountry(int defaultCountry)
Sets the default country code. |
void |
setError(String error)
Sets the error message. |
void |
setExtension(int extension)
Sets the extension. |
void |
setNumber(int number)
Sets the number part. |
boolean |
setTelno(String telno)
Sets the phone number and verifies it. The digits must be either seperated by a dash or a space. |
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Telno()
| Method Detail |
|---|
public void clear()
public boolean setTelno(String telno)
telno - the string to parse, null if "not set"
public String getTelno()
public String toString()
java.lang.ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString in class Objectpublic boolean isValid()
public int getCountry()
public void setCountry(int country)
country - the country codepublic int getArea()
public void setArea(int area)
area - the area codepublic int getNumber()
public void setNumber(int number)
number - the phone number partpublic int getExtension()
public void setExtension(int extension)
extension - the extension, -1 if nonepublic int getDefaultCountry()
public void setDefaultCountry(int defaultCountry)
defaultCountry - the default country code, 0 if no defaultpublic String getError()
public void setError(String error)
error - the error message, null if none
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||