@Override public int maxSize(Node node) { return maxLength(node) ; }
@Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { new NodecSSE() } } ) ; }
@Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { new NodecSSE() } } ) ; }
private static int maxLength(Node node) { if ( node.isBlank() ) // "_:" return 2+maxLength(node.getBlankNodeLabel()) ; if ( node.isURI() ) // "<>" return 2+maxLength(node.getURI()) ; if ( node.isLiteral() ) { int len = 2+maxLength(node.getLiteralLexicalForm()) ; if ( NodeUtils.isLangString(node) ) // Space for @ (language tag is ASCII) len = len + 3 + node.getLiteralLanguage().length() ; else if ( ! NodeUtils.isSimpleString(node) ) // The quotes and also space for ^^<> len = len + 4 + maxLength(node.getLiteralDatatypeURI()) ; return len ; } if ( node.isVariable() ) // "?" return 1+maxLength(node.getName()) ; throw new TDBException("Unrecognized node type: "+node) ; }