EMMA Coverage Report (generated Wed Aug 29 00:03:59 CDT 2007)
[all classes][org.fuwjax.jon.type]

COVERAGE SUMMARY FOR SOURCE FILE [CharArrayType.java]

nameclass, %method, %block, %line, %
CharArrayType.java100% (1/1)100% (7/7)100% (39/39)100% (12/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CharArrayType100% (1/1)100% (7/7)100% (39/39)100% (12/12)
CharArrayType (): void 100% (1/1)100% (4/4)100% (2/2)
createInstance (CharSequence, Object): Object 100% (1/1)100% (20/20)100% (5/5)
getClassCastStrategy (): ClassCastStrategy 100% (1/1)100% (2/2)100% (1/1)
getLiteral (): Literal 100% (1/1)100% (2/2)100% (1/1)
getReferenceStrategy (): ReferenceStrategy 100% (1/1)100% (2/2)100% (1/1)
getSymbolSpec (): Symbol 100% (1/1)100% (2/2)100% (1/1)
toString (Object): CharSequence 100% (1/1)100% (7/7)100% (1/1)

1/*
2 * This file is part of JON.
3 *
4 * JON is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * JON is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 * 
17 * Copyright 2007 Michael Doberenz
18 */
19package org.fuwjax.jon.type;
20 
21import org.fuwjax.jon.ClassCastStrategy;
22import org.fuwjax.jon.ObjectAccessException;
23import org.fuwjax.jon.ReferenceStrategy;
24import org.fuwjax.jon.accessor.Literal;
25import org.fuwjax.jon.accessor.LiteralAccessor;
26import org.fuwjax.jon.accessor.Symbol;
27 
28/**
29 * An abstraction layer over byte array.
30 * @author michaeldoberenz
31 */
32public class CharArrayType extends AbstractIndirectType implements LiteralAccessor{
33        /**
34         * Creates an abstraction layer for byte[].
35         */
36        public CharArrayType(){
37                super(char[].class);
38        }
39 
40        public ClassCastStrategy getClassCastStrategy(){
41                return ClassCastStrategy.AlwaysCast;
42        }
43 
44        public ReferenceStrategy getReferenceStrategy(){
45                return ReferenceStrategy.AssignedReference;
46        }
47 
48        public Symbol getSymbolSpec(){
49                return Symbol.Literal;
50        }
51 
52        public Object createInstance(final CharSequence literal, final Object source) throws ObjectAccessException{
53                char[] out = literal.toString().toCharArray();
54                if(source instanceof char[]){
55                        System.arraycopy(out, 0, source, 0, out.length);
56                        out = (char[])source;
57                }
58                return out;
59        }
60 
61        public Literal getLiteral(){
62                return Literal.String;
63        }
64 
65        public CharSequence toString(final Object object) throws ObjectAccessException{
66                return new String((char[])object);
67        }
68}

[all classes][org.fuwjax.jon.type]
EMMA 2.0.5312 (C) Vladimir Roubtsov