// Path: app/src/main/java/com/annimon/hotarufx/exceptions/TypeException.java
// public class TypeException extends HotaruRuntimeException {
// 
//     public TypeException(String message) {
//         super(message);
//     }
// 
//     public TypeException(String message, SourcePosition start, SourcePosition end) {
//         super(message, start, end);
//     }
// }


import com.annimon.hotarufx.exceptions.TypeException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
    private final Map<String, Value> map;

    public MapValue(int size) {
        this.map = new HashMap<>(size);
    }

    public MapValue(Map<String, Value> map) {
        this.map = map;
    }

    @Override
    public int type() {
        return Types.MAP;
    }

    public int size() {
        return map.size();
    }

    public Map<String, Value> getMap() {
        return map;
    }

    @Override
    public Object raw() {
        return map;
    }

    @Override
    public Number asNumber() {
// Path: app/src/main/java/com/annimon/hotarufx/exceptions/TypeException.java
// public class TypeException extends HotaruRuntimeException {
// 
//     public TypeException(String message) {
//         super(message);
//     }
// 
//     public TypeException(String message, SourcePosition start, SourcePosition end) {
//         super(message, start, end);
//     }
// }


// Path: app/src/main/java/com/annimon/hotarufx/lib/MapValue.java
import com.annimon.hotarufx.exceptions.TypeException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;

    private final Map<String, Value> map;

    public MapValue(int size) {
        this.map = new HashMap<>(size);
    }

    public MapValue(Map<String, Value> map) {
        this.map = map;
    }

    @Override
    public int type() {
        return Types.MAP;
    }

    public int size() {
        return map.size();
    }

    public Map<String, Value> getMap() {
        return map;
    }

    @Override
    public Object raw() {
        return map;
    }

    @Override
    public Number asNumber() {
        throw new TypeException("Cannot cast map to number");