Revision 46008
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/function/programming/LenFunction.java | ||
---|---|---|
38 | 38 |
if( obj == null ) { |
39 | 39 |
return 0; |
40 | 40 |
} |
41 |
if( obj instanceof List ) { |
|
41 |
if( obj.getClass().isArray() ) { |
|
42 |
Object[] x = (Object[]) obj; |
|
43 |
value = x.length; |
|
44 |
|
|
45 |
} else if( obj instanceof List ) { |
|
42 | 46 |
List l = ((List)obj); |
43 | 47 |
value = l.size(); |
44 | 48 |
|
... | ... | |
58 | 62 |
Size64 s = (Size64)obj; |
59 | 63 |
value = s.size64(); |
60 | 64 |
|
65 |
|
|
61 | 66 |
} else { |
62 | 67 |
throw new ExpressionRuntimeException("The "+NAME+" function require a String, List, Map or Size and a received a '"+obj.getClass().getSimpleName()+"'."); |
63 | 68 |
} |
Also available in: Unified diff