All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redhat.ceylon.compiler.java.wrapping.WrappedCeylonMap Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package com.redhat.ceylon.compiler.java.wrapping;

import java.io.Serializable;
import java.util.AbstractMap;
import java.util.Set;

import com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor;

/**
 * A wrapper for a Ceylon List that satisfies {@code java.util.List}
 */
class WrappedCeylonMap 
        extends AbstractMap 
        implements Serializable {

    private static final long serialVersionUID = 8123632437919187363L;
    
    private ceylon.language.Map cMap;
    private WrappedCeylonSet, java.util.Map.Entry> entrySet;

    public WrappedCeylonMap(TypeDescriptor $reified$Key, TypeDescriptor $reified$Item, 
            ceylon.language.Map cMap,
            Wrapping keyWrapping,
            Wrapping itemWrapping) {
        super();
        this.cMap = cMap;
        Wrapping, java.util.Map.Entry> inverted = Wrappings.toCeylonEntry($reified$Key, $reified$Item, keyWrapping.inverted(), itemWrapping.inverted()).inverted();
        this.entrySet = new WrappedCeylonSet, java.util.Map.Entry>(
                (ceylon.language.Collection)cMap, 
                inverted);
    }

    @Override
    public Set> entrySet() {
        return entrySet;
    }
    
    public ceylon.language.Map unwrap() {
        return cMap;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy