Package EnchantmentOrder
Class SearchResult
java.lang.Object
kkchengaf.EnchantmentOrder.SearchResult
A class that store the Search Result,
Extends this class as you like
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResult
(ArrayList<Integer> weightOrder, BinaryTree btree, Integer anvilCost, Integer enchantmentCost) Constructor of the search result -
Method Summary
Modifier and TypeMethodDescriptionget the total cost of prior work penaltygetBTree()
get the Binary Treeget the total cost of the enchantments weightsget the ArrayList of sorted weightWrapper to tree.parseTree(arrayList, hashmap)parseTreeString
(HashMap<String, Integer> input) String version of searchResult.parseTree, Wrapper to tree.parseTree(arrayList, hashmap)void
Override this function as you like, or just call this.traversal(f)toString()
to String, return the costs, the sorted weights and the tree structure stringvoid
Wrapper to searchResult.getBTree().traversal(root, f)
-
Constructor Details
-
SearchResult
public SearchResult(ArrayList<Integer> weightOrder, BinaryTree btree, Integer anvilCost, Integer enchantmentCost) Constructor of the search result- Parameters:
weightOrder
- , ArrayList of sorted weightbtree
- , BinaryTree of the optimal orderanvilCost
- , the total anvil cost of the resultenchantmentCost
- , the total enchantment cost of the result
-
-
Method Details
-
getWeightOrder
get the ArrayList of sorted weight- Returns:
- ArrayList Integer
-
getBTree
get the Binary Tree- Returns:
- BinaryTree
-
getAnvilCost
get the total cost of prior work penalty- Returns:
- Integer
-
getEnchantmentCost
get the total cost of the enchantments weights- Returns:
- Integer
-
toString
to String, return the costs, the sorted weights and the tree structure string -
parseTree
Wrapper to tree.parseTree(arrayList, hashmap)- Parameters:
input
- , hashmap input- Returns:
- the total cost to combine all items
-
parseTreeString
String version of searchResult.parseTree, Wrapper to tree.parseTree(arrayList, hashmap)- Parameters:
input
- , hashmap input- Returns:
- the total cost to combine all items
-
traversal
Wrapper to searchResult.getBTree().traversal(root, f)- Parameters:
f
- , the function to handle the node information
-
printResult
public void printResult()Override this function as you like, or just call this.traversal(f)
-