public class Tax
extends java.lang.Object
Constructor and Description |
---|
Tax(double percent,
java.lang.String category,
java.lang.String name,
java.lang.String comment) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares tax instances for equality.
|
java.lang.String |
getCategory()
Returns the category code of the tax
|
java.lang.String |
getComment()
Returns the comment on the tax
|
java.lang.String |
getName()
Returns the name of the tax
|
double |
getPercent()
Returns the percentage of the tax
|
java.lang.String |
getStringPercent()
Returns a suitable string representation of the percentage of the tax
|
int |
hashCode()
Returns the hash code of a tax instance
|
void |
setCategory(java.lang.String category)
Sets the category code of the tax
It must be one of:
AE
L
M
E
S
Z
G
O
K
|
void |
setComment(java.lang.String comment)
Sets a comment on the tax
|
void |
setName(java.lang.String name)
Sets the name of the tax
|
void |
setPercent(double percent)
Sets the percentage of the tax
|
public Tax(double percent, java.lang.String category, java.lang.String name, java.lang.String comment)
percent
- the percentage of the taxcategory
- the category code of the taxname
- the name of the taxcomment
- a comment on the taxpublic double getPercent()
public java.lang.String getStringPercent()
public void setPercent(double percent)
percent
- the percentagepublic java.lang.String getCategory()
public void setCategory(java.lang.String category)
It must be one of:
category
- the category codejava.lang.IllegalArgumentException
- if the category code is invalid.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the namepublic java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- the commentpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-