MCPcopy Create free account
hub / github.com/BaseXdb/basex / string

Method string

basex-core/src/main/java/org/basex/query/value/item/ADate.java:337–360  ·  view source on GitHub ↗
(final InputInfo ii)

Source from the content-addressed store, hash-verified

335 }
336
337 @Override
338 public byte[] string(final InputInfo ii) {
339 final TokenBuilder tb = new TokenBuilder();
340 final boolean ymd = year != Long.MAX_VALUE;
341 if(ymd) {
342 if(year < 0) tb.add('-');
343 prefix(tb, Math.abs(yea()), 4);
344 tb.add('-');
345 prefix(tb, mon(), 2);
346 tb.add('-');
347 prefix(tb, day(), 2);
348 }
349 if(hour >= 0) {
350 if(ymd) tb.add('T');
351 prefix(tb, hour(), 2);
352 tb.add(':');
353 prefix(tb, minute(), 2);
354 tb.add(':');
355 if(seconds.intValue() < 10) tb.add('0');
356 tb.add(Token.chopNumber(Token.token(seconds().abs().toPlainString())));
357 }
358 zone(tb);
359 return tb.finish();
360 }
361
362 /**
363 * Adds the time zone to the specified token builder.

Callers 1

toStringMethod · 0.95

Calls 13

addMethod · 0.95
prefixMethod · 0.95
yeaMethod · 0.95
monMethod · 0.95
dayMethod · 0.95
hourMethod · 0.95
minuteMethod · 0.95
chopNumberMethod · 0.95
tokenMethod · 0.95
secondsMethod · 0.95
zoneMethod · 0.95
finishMethod · 0.95

Tested by

no test coverage detected