Guava HashBiMap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava HashBiMap class.

This code example shows how to use the following methods:containsKey, get
        } 
    } 
     
    public ASTNode getReplacementNode(TIRNode node)
    { 
        if (fTIRToRawASTTable.containsKey(node))
        { 
            ASTNode replacementNode = fTIRToRawASTTable.get(node);
            if (replacementNode != null)
            { 
                return replacementNode;
            } 
            else 
            { 
                throw new NoSuchElementException("Entry for TIRNode " + node + " is null in TIR to AST table");
            } 
        } 
        else 
        { 
            throw new NoSuchElementException("Key TIRNode " + node + " is not present in TIR to AST table");
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:put
    public void testSerialization() { 
        BeanWithBiMapTypes bean = new BeanWithBiMapTypes();
 
        bean.hashBiMap = HashBiMap.create();
        // only one value since it is not sorted 
        bean.hashBiMap.put( "one", 1 );
 
        bean.biMap = bean.hashBiMap;
 
        bean.enumHashBiMap = EnumHashBiMap.create( AlphaEnum.class );
        bean.enumHashBiMap.put( AlphaEnum.A, 1 );
        bean.enumHashBiMap.put( AlphaEnum.D, 4 );
        bean.enumHashBiMap.put( AlphaEnum.C, 3 );
        bean.enumHashBiMap.put( AlphaEnum.B, 2 );
 
        bean.enumBiMap = EnumBiMap.create( AlphaEnum.class, NumericEnum.class );
        bean.enumBiMap.put( AlphaEnum.A, NumericEnum.ONE );
        bean.enumBiMap.put( AlphaEnum.D, NumericEnum.FOUR );
        bean.enumBiMap.put( AlphaEnum.C, NumericEnum.THREE );
        bean.enumBiMap.put( AlphaEnum.B, NumericEnum.TWO );
4
CodeRank
Experience pair programming with AI  Get Codota for Java