Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.algorithmstudy.pattern.creation.prototype

data class MyComputer(
val motherBoard: String,
val graphicCard: String,
val cpu: String,
val ram: String
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.algorithm.BFS
import com.example.algorithmstudy.algorithm.DFS
import com.example.algorithmstudy.datastructure.StackSolution
import com.example.algorithmstudy.kotlin.CalculatorUtil
import com.example.algorithmstudy.kotlin.StringUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.java.DPJava
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.algorithm.Dijkstra
import org.junit.Test

class DijstraTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.algorithm.Greedy
import com.example.algorithmstudy.java.GreedyJava
import com.example.algorithmstudy.kotlin.GreedyUtil
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.kotlin.HashUtil
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.java.PriorityQueueUtil
import com.example.algorithmstudy.kotlin.HeapUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.pattern.creation.factory.Car
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.java.QueueSolution
import com.example.algorithmstudy.kotlin.QueueUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.kotlin.SearchUtil
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.algorithm

import com.example.algorithmstudy.kotlin.SortUtil
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.algorithmstudy
package com.example.algorithmstudy.design_pattern

import com.example.algorithmstudy.pattern.creation.abstract_factory.HQ
import com.example.algorithmstudy.pattern.creation.abstract_factory.InfantryUnits
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.algorithmstudy.design_pattern

import com.example.algorithmstudy.pattern.creation.prototype.MyComputer
import org.junit.Test

class PrototypeTest {

@Test
fun testPrototype() {
val myOriginalPc = MyComputer(
motherBoard = "Asus",
cpu = "Intel",
ram = "8GB",
graphicCard = "Nvidia"
)

println(myOriginalPc)
println(myOriginalPc.copy(graphicCard = "Rygen"))

}
}