473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

StringConstraint

oll3i
679 512MB
Expand|Select|Wrap|Line Numbers
  1.  
  2. package zad1_2;
  3.  
  4. import java.util.*;
  5.  
  6. import bounded_type_p.Box;
  7.  
  8. public class Zad1_2 {
  9.     ArrayList<String> list = new ArrayList<String>();
  10.  
  11.  
  12.     public static final StringConstraint FIRST_NAME_CONSTRAINT =
  13.         new StringConstraint("firstName", false, 30);
  14.  
  15.  
  16.     public static final StringConstraint LAST_NAME_CONSTRAINT =
  17.         new StringConstraint("lastName", false, 30);
  18.  
  19.     public static final StringConstraint PHONE_CONSTRAINT =
  20.         new StringConstraint("phone", false, 20);
  21.  
  22. String firstName;
  23. String lastName;
  24. String phone;
  25.  
  26. public void setFirstName(final String firstName) {
  27.     FIRST_NAME_CONSTRAINT.validate(firstName);
  28.     final String oldFirstName = this.firstName;
  29.     this.firstName = firstName;
  30.     propertyChangeSupport.firePropertyChange("firstName", oldFirstName, this.firstName);
  31. }
  32.  
  33. public String getFirstName() {
  34.     return this.firstName;
  35. }
  36.  
  37. public void setLastName(final String lastName) {
  38.     LAST_NAME_CONSTRAINT.validate(lastName);
  39.     final String oldLastName = this.lastName;
  40.     this.lastName = lastName;
  41.     propertyChangeSupport.firePropertyChange("lastName", oldLastName, this.lastName);
  42. }
  43.  
  44.  
  45. public String getLastName() {
  46.     return this.lastName;
  47. }
  48.  
  49.  
  50.  
  51. public void setPhone(final String phone) {
  52.     PHONE_CONSTRAINT.validate(phone);
  53.     final String oldPhone = this.phone;
  54.     this.phone = phone;
  55.     propertyChangeSupport.firePropertyChange("phone", oldPhone, this.phone);
  56. }
  57.  
  58. public String getPhone() {
  59.     return this.phone;
  60. }
  61.  
  62.  
  63. public static void main(String[] args) {
  64.  
  65. }
  66.  
  67. }
  68.  
why it highlihgts StringConstraint as an error
Mar 16 '07 #1
1 1443
r035198x
13,262 8TB
Expand|Select|Wrap|Line Numbers
  1.  
  2. package zad1_2;
  3.  
  4. import java.util.*;
  5.  
  6. import bounded_type_p.Box;
  7.  
  8. public class Zad1_2 {
  9.     ArrayList<String> list = new ArrayList<String>();
  10.  
  11.  
  12. public static final StringConstraint FIRST_NAME_CONSTRAINT =
  13. new StringConstraint("firstName", false, 30);
  14.  
  15.  
  16. public static final StringConstraint LAST_NAME_CONSTRAINT =
  17. new StringConstraint("lastName", false, 30);
  18.  
  19. public static final StringConstraint PHONE_CONSTRAINT =
  20. new StringConstraint("phone", false, 20);
  21.  
  22. String firstName;
  23. String lastName;
  24. String phone;
  25.  
  26. public void setFirstName(final String firstName) {
  27. FIRST_NAME_CONSTRAINT.validate(firstName);
  28. final String oldFirstName = this.firstName;
  29. this.firstName = firstName;
  30. propertyChangeSupport.firePropertyChange("firstName", oldFirstName, this.firstName);
  31. }
  32.  
  33. public String getFirstName() {
  34. return this.firstName;
  35. }
  36.  
  37. public void setLastName(final String lastName) {
  38. LAST_NAME_CONSTRAINT.validate(lastName);
  39. final String oldLastName = this.lastName;
  40. this.lastName = lastName;
  41. propertyChangeSupport.firePropertyChange("lastName", oldLastName, this.lastName);
  42. }
  43.  
  44.  
  45. public String getLastName() {
  46. return this.lastName;
  47. }
  48.  
  49.  
  50.  
  51. public void setPhone(final String phone) {
  52. PHONE_CONSTRAINT.validate(phone);
  53. final String oldPhone = this.phone;
  54. this.phone = phone;
  55. propertyChangeSupport.firePropertyChange("phone", oldPhone, this.phone);
  56. }
  57.  
  58. public String getPhone() {
  59. return this.phone;
  60. }
  61.  
  62.  
  63. public static void main(String[] args) {
  64.  
  65. }
  66.  
  67. }
  68.  
why it highlihgts StringConstraint as an error
Where did you get the StringConstraint class from? It does not appear to be part of the standard java API.
Mar 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
oll3i
by: oll3i | last post by:
how to constrain a string to 30 chars?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.