@Override public String toString() { StringBuilder buf = new StringBuilder(getName() + "("); if (children.size()==0) return buf.append(")").toString(); if (hasLengthExpression) { buf.append(getStrExpression()); buf.append(", "); buf.append(getOffsetExpression()); buf.append(", "); buf.append(getLengthExpression()); } else { buf.append(getStrExpression()); buf.append(", "); buf.append(getOffsetExpression()); } buf.append(")"); return buf.toString(); }
private void init() { isOffsetConstant = getOffsetExpression() instanceof LiteralExpression; isLengthConstant = getLengthExpression() instanceof LiteralExpression; hasLengthExpression = !isLengthConstant || ((LiteralExpression)getLengthExpression()).getValue() != null; isFixedWidth = getStrExpression().getDataType().isFixedWidth() && ((hasLengthExpression && isLengthConstant) || (!hasLengthExpression && isOffsetConstant)); if (hasLengthExpression && isLengthConstant) { Integer maxLength = ((Number)((LiteralExpression)getLengthExpression()).getValue()).intValue(); this.maxLength = maxLength >= 0 ? maxLength : 0; } else if (isOffsetConstant) { Number offsetNumber = (Number)((LiteralExpression)getOffsetExpression()).getValue(); if (offsetNumber != null) { int offset = offsetNumber.intValue(); PDataType type = getStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getStrExpression().getMaxLength(); this.maxLength = maxLength - offset + (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
@Override public String toString() { StringBuilder buf = new StringBuilder(getName() + "("); if (children.size()==0) return buf.append(")").toString(); if (hasLengthExpression) { buf.append(getStrExpression()); buf.append(", "); buf.append(getOffsetExpression()); buf.append(", "); buf.append(getLengthExpression()); } else { buf.append(getStrExpression()); buf.append(", "); buf.append(getOffsetExpression()); } buf.append(")"); return buf.toString(); }
Expression lengthExpression = getLengthExpression(); if (!lengthExpression.evaluate(tuple, ptr)) { return false;
private void init() { isOffsetConstant = getOffsetExpression() instanceof LiteralExpression; isLengthConstant = getLengthExpression() instanceof LiteralExpression; hasLengthExpression = !isLengthConstant || ((LiteralExpression)getLengthExpression()).getValue() != null; isFixedWidth = getStrExpression().getDataType().isFixedWidth() && ((hasLengthExpression && isLengthConstant) || (!hasLengthExpression && isOffsetConstant)); if (hasLengthExpression && isLengthConstant) { Integer maxLength = ((Number)((LiteralExpression)getLengthExpression()).getValue()).intValue(); this.maxLength = maxLength >= 0 ? maxLength : 0; } else if (isOffsetConstant) { Number offsetNumber = (Number)((LiteralExpression)getOffsetExpression()).getValue(); if (offsetNumber != null) { int offset = offsetNumber.intValue(); PDataType type = getStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getStrExpression().getMaxLength(); this.maxLength = maxLength - offset + (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
private void init() { isOffsetConstant = getOffsetExpression() instanceof LiteralExpression; isLengthConstant = getLengthExpression() instanceof LiteralExpression; hasLengthExpression = !isLengthConstant || ((LiteralExpression)getLengthExpression()).getValue() != null; isFixedWidth = getStrExpression().getDataType().isFixedWidth() && ((hasLengthExpression && isLengthConstant) || (!hasLengthExpression && isOffsetConstant)); if (hasLengthExpression && isLengthConstant) { Integer maxLength = ((Number)((LiteralExpression)getLengthExpression()).getValue()).intValue(); this.maxLength = maxLength >= 0 ? maxLength : 0; } else if (isOffsetConstant) { Number offsetNumber = (Number)((LiteralExpression)getOffsetExpression()).getValue(); if (offsetNumber != null) { int offset = offsetNumber.intValue(); PDataType type = getStrExpression().getDataType(); if (type.isFixedWidth()) { if (offset >= 0) { Integer maxLength = getStrExpression().getMaxLength(); this.maxLength = maxLength - offset + (offset == 0 ? 0 : 1); } else { this.maxLength = -offset; } } } } }
Expression lengthExpression = getLengthExpression(); if (!lengthExpression.evaluate(tuple, ptr)) { return false;
Expression lengthExpression = getLengthExpression(); if (!lengthExpression.evaluate(tuple, ptr)) { return false;