<commit_before>package com.brmuncey.shortcutcalculator.Controller;

import com.brmuncey.shortcutcalculator.Model.CartItem;
import com.brmuncey.shortcutcalculator.Model.ShoppingCart;

import java.util.List;

public class CartController {

    private ShoppingCart cart = new ShoppingCart();

    public void addToCart(double price  , CartItem.ItemType type){ cart.addItem(price, type); }

    public void deleteFromCart(CartItem item) { cart.deleteItem(item); }

    public double getTotal(){ return cart.getTotal(); }

    public String getTaxedTotal() {
        return cart.getTaxedTotal();
    }

    public void updateItemPrice(CartItem item, double newPrice) { if(cart.getItem(item) != null) { cart.getItem(item).updatePrice(newPrice); } }

    public CartItem.ItemType getItemType(int index) {
        return CartItem.ItemType.values()[index];
    }

    public List<CartItem> getCart() {
        return cart.getCart();
    }

    public boolean checkForState() {
        return false;
    }
}<commit_msg>Refactor CartController.<commit_after>package com.brmuncey.shortcutcalculator.Controller;

import com.brmuncey.shortcutcalculator.Model.CartItem;
import com.brmuncey.shortcutcalculator.Model.ShoppingCart;

import java.util.List;

public class CartController {

    private ShoppingCart cart = new ShoppingCart();

    public void addToCart(double price  , CartItem.ItemType type){ cart.addItem(price, type); }

    //public void deleteFromCart(CartItem item) { cart.deleteItem(item); }

    //public double getTotal(){ return cart.getTotal(); }

    public String getTaxedTotal() { return cart.getTaxedTotal(); }

    //public void updateItemPrice(CartItem item, double newPrice) { if(cart.getItem(item) != null) { cart.getItem(item).updatePrice(newPrice); } }

    public CartItem.ItemType getItemType(int index) { return CartItem.ItemType.values()[index]; }

    public List<CartItem> getCart() { return cart.getCart(); }

    public boolean checkForState() { return false; }
}
{'fraction_non_alphanumeric': 0.11312217194570136, 'fraction_numerical': 0.0, 'mean_word_length': 4.335120643431635, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2373851', 'n_tokens_mistral': 607, 'n_tokens_neox': 591, 'n_words': 129}