-
Notifications
You must be signed in to change notification settings - Fork 0
/
classDiagram.puml
82 lines (81 loc) · 1.98 KB
/
classDiagram.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@startuml
skinparam classAttributeIconSize 0
interface Algorithm {
+ void startAlgorithm()
+ void printResult()
}
class Truck {
- {static} int loadLimit
- LinkedList<Parcel> parcelLoaded
- int loadedWeight
- {static} int count
- char label
+ <<Create>> Truck()
+ {static} void resetLabel()
+ String getLabel()
+ {static} int getLoadLimit()
+ {static} void setLoadLimit(int)
+ boolean isFull()
+ boolean canLoad(int)
+ boolean canLoad(Parcel)
+ String printParcelStored()
+ boolean loadParcel(Parcel)
}
class NextFit {
+ <<Create>> NextFit(List<Parcel>)
+ void startAlgorithm()
}
class Main {
- {static} Scanner scanner
- {static} LinkedList<Parcel> parcelList
- {static} LinkedList<Parcel> defaultParcelList
- {static} Algorithm algorithm
+ {static} void main(String[])
- {static} void enterToContinue()
- {static} void initDefaultList()
- {static} List<Parcel> checkIsParcelListEmpty()
- {static} int getIntInput(String)
+ {static} void addParcel()
+ {static} void generateRandomList()
+ {static} void listParcel()
+ {static} void resetList()
+ {static} void setLoadLimit()
- {static} void startAlgorithm()
+ {static} void nextFit()
+ {static} void firstFitDecreasing()
}
class FirstFitDecreasing {
+ <<Create>> FirstFitDecreasing(List<Parcel>)
+ void startAlgorithm()
}
class Parcel {
- int weight
- Truck loadedAt
- {static} int count
- int label
+ <<Create>> Parcel(int)
+ {static} void resetLabel()
+ String getLabel()
+ String toString()
+ Parcel loadInto(Truck)
+ Truck getLoadedAt()
+ int getWeight()
+ void setWeight(int)
+ int compareTo(Parcel)
}
abstract class AbstractAlgorithm {
# LinkedList<Parcel> parcelList
# LinkedList<Truck> truckList
# LinkedList<Parcel> loadedParcel
# boolean loadParcelToTruck(Truck,Parcel)
+ void recordLoadedParcel(Parcel)
+ boolean notAllParcelBeingLoaded()
+ void createNewTruck()
+ void printResult()
}
Truck "1" o-- "many " Parcel : contains
AbstractAlgorithm <|-- NextFit
AbstractAlgorithm <|-- FirstFitDecreasing
Comparable <|.. Parcel
Algorithm <|.. AbstractAlgorithm
@enduml