Subtrees hinzugefügt
This commit is contained in:
parent
433a6f2eb1
commit
a02bf698e6
19 changed files with 2775 additions and 0 deletions
42
Quellcodes/iud_key_inf7_breakmono/Baustein.java
Normal file
42
Quellcodes/iud_key_inf7_breakmono/Baustein.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
public class Baustein implements Comparable<Baustein>{
|
||||
|
||||
// Anfang Attribute
|
||||
private String zeichen;
|
||||
private int anzahl;
|
||||
// Ende Attribute
|
||||
|
||||
public Baustein(String zeichen) {
|
||||
super();
|
||||
anzahl = 1;
|
||||
this.zeichen = zeichen;
|
||||
}
|
||||
// Anfang Methoden
|
||||
|
||||
|
||||
|
||||
public int compareTo(Baustein c) {
|
||||
|
||||
int anz = c.getAnzahl();
|
||||
|
||||
//ascending order
|
||||
return anz - this.anzahl;
|
||||
|
||||
//descending order
|
||||
//return compareQuantity - this.quantity;
|
||||
|
||||
}
|
||||
public String getZeichen() {
|
||||
return zeichen;
|
||||
}
|
||||
|
||||
public int getAnzahl() {
|
||||
return anzahl;
|
||||
}
|
||||
|
||||
public void incAnzahl() {
|
||||
anzahl++;
|
||||
}
|
||||
|
||||
|
||||
// Ende Methoden
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue