blob: 5b621422ec3bfa9e499e6e7dc3e3aab9fae2fd4e [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2020 Original NatTable authors and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Original NatTable authors and others - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ecommons.waltable.sort;
import org.eclipse.statet.ecommons.waltable.command.AbstractDimPositionCommand;
import org.eclipse.statet.ecommons.waltable.layer.ILayerDim;
public class SortDimPositionCommand extends AbstractDimPositionCommand {
private final boolean accumulate;
private final SortDirection direction;
public SortDimPositionCommand(final ILayerDim layerDim, final long columnPosition,
final boolean accumulate) {
this(layerDim, columnPosition, null, accumulate);
}
public SortDimPositionCommand(final ILayerDim layerDim, final long columnPosition,
final SortDirection direction, final boolean accumulate) {
super(layerDim, columnPosition);
this.direction= direction;
this.accumulate= accumulate;
}
protected SortDimPositionCommand(final SortDimPositionCommand command) {
super(command);
this.accumulate= command.accumulate;
this.direction= command.direction;
}
@Override
public SortDimPositionCommand cloneCommand() {
return new SortDimPositionCommand(this);
}
public boolean isAccumulate() {
return this.accumulate;
}
/**
* The sort direction, if specified.
*
* @return the sort direction or <code>null</code> for automatic iteration
*/
public SortDirection getDirection() {
return this.direction;
}
}