MCPcopy Index your code
hub / github.com/antlr/codebuff / first

Method first

output/java8/1.4.12/Interpreter.java:923–934  ·  view source on GitHub ↗

Return the first attribute if multi-valued, or the attribute itself if single-valued. This method is used for rendering expressions of the form .

(InstanceScope scope, Object v)

Source from the content-addressed store, hash-verified

921 */
922
923 public Object first(InstanceScope scope, Object v) {
924 if ( v==null ) return null;
925 Object r = v;
926 v = convertAnythingIteratableToIterator(scope, v);
927 if ( v instanceof Iterator ) {
928 Iterator<?> it = (Iterator<?>)v;
929 if ( it.hasNext() ) {
930 r = it.next();
931 }
932 }
933 return r;
934 }
935
936 /**
937 * Return the last attribute if multi-valued, or the attribute itself if

Callers 1

_execMethod · 0.95

Calls 3

nextMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected