Return a list with the same elements as v but in reverse order. Note that null values are not stripped out; use reverse(strip(v)) to do that.
(InstanceScope scope, Object v)
| 1080 | */ |
| 1081 | |
| 1082 | public Object reverse(InstanceScope scope, Object v) { |
| 1083 | if ( v==null ) return null; |
| 1084 | v = convertAnythingIteratableToIterator(scope, v); |
| 1085 | if ( v instanceof Iterator) { |
| 1086 | List<Object> a = new LinkedList<Object>(); |
| 1087 | Iterator<?> it = (Iterator<?>)v; |
| 1088 | while ( it.hasNext() ) a.add(0, it.next()); |
| 1089 | return a; |
| 1090 | } |
| 1091 | return v; |
| 1092 | } |
| 1093 | |
| 1094 | /** |
| 1095 | * Return the length of a multi-valued attribute or 1 if it is a single |
no test coverage detected