home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-08-23 | 580 b | 38 lines |
- /**
- * An employee section object. Allows creation, validation, and ordering of employee sections.
- */
-
- public class Section
- {
- int val;
- final static int MAX_LENGTH = 10;
-
- Section(int a)
- {
- val = a;
- }
-
- Section(String a)
- throws NumberFormatException
- {
- System.out.println("Parsing section; a='" + a + "' (" + a.length() + " chars)");
- val = Integer.parseInt(a.trim());
- }
-
- int value()
- {
- return val;
- }
-
- public boolean isValid()
- {
- return val > 0;
- }
-
- public boolean isGreaterThan(Section a)
- {
- return val > a.value();
- }
- }
-
-