Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasicSpreadsheetParserContext implements ExpressionNumberContextDeleg… #5557

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
import walkingkooka.datetime.DateTimeContextDelegator;
import walkingkooka.text.CharSequences;
import walkingkooka.tree.expression.ExpressionNumberContext;
import walkingkooka.tree.expression.ExpressionNumberKind;
import walkingkooka.tree.expression.ExpressionNumberContextDelegator;

import java.math.MathContext;
import java.util.Locale;
import java.util.Objects;

/**
* A {@link SpreadsheetParserContext} without any functionality.
*/
final class BasicSpreadsheetParserContext implements SpreadsheetParserContext,
DateTimeContextDelegator {
DateTimeContextDelegator,
ExpressionNumberContextDelegator {

/**
* Creates a new {@link BasicSpreadsheetParserContext}.
Expand Down Expand Up @@ -61,76 +61,36 @@ private BasicSpreadsheetParserContext(final DateTimeContext dateTimeContext,
this.valueSeparator = valueSeparator;
}

// DateTimeContextDelegator.........................................................................................

@Override
public DateTimeContext dateTimeContext() {
return this.dateTimeContext;
}

private final DateTimeContext dateTimeContext;

// ExpressionNumberContext.............................................................................................

@Override
public String currencySymbol() {
return this.expressionNumberContext.currencySymbol();
}

@Override
public char decimalSeparator() {
return this.expressionNumberContext.decimalSeparator();
}

@Override
public String exponentSymbol() {
return this.expressionNumberContext.exponentSymbol();
public char valueSeparator() {
return this.valueSeparator;
}

@Override
public ExpressionNumberKind expressionNumberKind() {
return this.expressionNumberContext.expressionNumberKind();
}
private final char valueSeparator;

@Override
public char groupSeparator() {
return this.expressionNumberContext.groupSeparator();
public Locale locale() {
return this.expressionNumberContext.locale();
}

@Override
public char negativeSign() {
return this.expressionNumberContext.negativeSign();
}
// DateTimeContextDelegator.........................................................................................

@Override
public char percentageSymbol() {
return this.expressionNumberContext.percentageSymbol();
public DateTimeContext dateTimeContext() {
return this.dateTimeContext;
}

@Override
public char positiveSign() {
return this.expressionNumberContext.positiveSign();
}
private final DateTimeContext dateTimeContext;

@Override
public Locale locale() {
return this.expressionNumberContext.locale();
}
// ExpressionNumberContext.............................................................................................

@Override
public MathContext mathContext() {
return this.expressionNumberContext.mathContext();
public ExpressionNumberContext expressionNumberContext() {
return this.expressionNumberContext;
}

private final ExpressionNumberContext expressionNumberContext;

@Override
public char valueSeparator() {
return this.valueSeparator;
}

private final char valueSeparator;

@Override
public String toString() {
return this.dateTimeContext + " " + this.expressionNumberContext + " " + CharSequences.quoteIfChars(this.valueSeparator);
Expand Down
Loading