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)
| 1033 | */ |
| 1034 | |
| 1035 | public Object reverse(InstanceScope scope, Object v) { |
| 1036 | if ( v==null ) return null; |
| 1037 | v = convertAnythingIteratableToIterator(scope, v); |
| 1038 | if ( v instanceof Iterator ) { |
| 1039 | List<Object> a = new LinkedList<Object>(); |
| 1040 | Iterator<?> it = (Iterator<?>)v; |
| 1041 | while ( it.hasNext() ) a.add(0, it.next()); |
| 1042 | return a; |
| 1043 | } |
| 1044 | return v; |
| 1045 | } |
| 1046 | |
| 1047 | /** |
| 1048 | * Return the length of a multi-valued attribute or 1 if it is a single |
no test coverage detected