1 |
/* IntegerSyntax.java -- |
/* IntegerSyntax.java -- |
2 |
Copyright (C) 2003, 2004 Free Software Foundation, Inc. |
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
40 |
import java.io.Serializable; |
import java.io.Serializable; |
41 |
|
|
42 |
/** |
/** |
43 |
* @author Michael Koch |
* <code>IntegerSyntax</code> is the abstract base class of all attribute |
44 |
|
* classes having an integer as value. |
45 |
|
* |
46 |
|
* @author Michael Koch (konqueror@gmx.de) |
47 |
*/ |
*/ |
48 |
public abstract class IntegerSyntax implements Cloneable, Serializable |
public abstract class IntegerSyntax implements Cloneable, Serializable |
49 |
{ |
{ |
52 |
/** |
/** |
53 |
* Creates a <code>IntegerSyntax</code> with the given value. |
* Creates a <code>IntegerSyntax</code> with the given value. |
54 |
* |
* |
55 |
* @param value the value to set |
* @param value the integer to set |
56 |
*/ |
*/ |
57 |
protected IntegerSyntax(int value) |
protected IntegerSyntax(int value) |
58 |
{ |
{ |
60 |
} |
} |
61 |
|
|
62 |
/** |
/** |
63 |
* Creates a <code>IntegerSyntax</code> with the given arguments. |
* Creates a <code>IntegerSyntax</code> with the given integer value |
64 |
|
* and checks if the value lies inside the given bounds.. |
65 |
* |
* |
66 |
* @param value the value to set |
* @param value the integer to set |
67 |
* @param lowerBound the lower bound for the value |
* @param lowerBound the lower bound for the value |
68 |
* @param upperBound the upper bound for the value |
* @param upperBound the upper bound for the value |
69 |
* |
* |
82 |
/** |
/** |
83 |
* Returns the value of this object. |
* Returns the value of this object. |
84 |
* |
* |
85 |
* @return the value |
* @return The integer value. |
86 |
*/ |
*/ |
87 |
public int getValue() |
public int getValue() |
88 |
{ |
{ |
90 |
} |
} |
91 |
|
|
92 |
/** |
/** |
93 |
* Tests of obj is equal to this object. |
* Tests if the given object is equal to this object. |
94 |
* |
* |
95 |
* @param obj the object to test |
* @param obj the object to test |
96 |
* |
* |
97 |
* @return true if both objects are equal, false otherwise. |
* @return <code>true</code> if both objects are equal, |
98 |
|
* <code>false</code> otherwise. |
99 |
*/ |
*/ |
100 |
public boolean equals(Object obj) |
public boolean equals(Object obj) |
101 |
{ |
{ |
108 |
/** |
/** |
109 |
* Returns the hashcode for this object. |
* Returns the hashcode for this object. |
110 |
* |
* |
111 |
* @return the hashcode |
* @return The hashcode. |
112 |
*/ |
*/ |
113 |
public int hashCode() |
public int hashCode() |
114 |
{ |
{ |
118 |
/** |
/** |
119 |
* Returns the string representation for this object. |
* Returns the string representation for this object. |
120 |
* |
* |
121 |
* @return the string representation |
* @return The string representation. |
122 |
*/ |
*/ |
123 |
public String toString() |
public String toString() |
124 |
{ |
{ |