blob: 568e1612b2b0c29e958c305cf233b2ccefa4ad13 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2010, 2019 Stephan Wahlbrink 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, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.r.ui.dataeditor;
import java.util.List;
import org.eclipse.statet.internal.r.ui.dataeditor.RDataFormatter;
import org.eclipse.statet.r.core.model.RElementName;
import org.eclipse.statet.rj.data.RStore;
public class RDataTableColumn implements IRDataTableVariable {
private final long fIndex;
private final String fName;
private final String fRExpression;
private final RElementName fElementName;
private final int fColumnType;
private final RStore fDataStore;
private final List<String> fClassNames;
private final RDataFormatter fDefaultFormat;
public RDataTableColumn(final long columnIndex, final String name,
final String rExpression, final RElementName elementName,
final int columnType, final RStore dataStore, final List<String> classNames,
final RDataFormatter defaultFormat) {
this.fIndex= columnIndex;
this.fName= name;
this.fRExpression= rExpression;
this.fElementName= elementName;
this.fColumnType= columnType;
this.fDataStore= dataStore;
this.fClassNames= classNames;
this.fDefaultFormat= defaultFormat;
}
@Override
public int getVarPresentation() {
return COLUMN;
}
public long getIndex() {
return this.fIndex;
}
@Override
public String getName() {
return this.fName;
}
public String getRExpression() {
return this.fRExpression;
}
public RElementName getElementName() {
return this.fElementName;
}
@Override
public int getVarType() {
return this.fColumnType;
}
public RStore getDataStore() {
return this.fDataStore;
}
public List<String> getClassNames() {
return this.fClassNames;
}
public RDataFormatter getDefaultFormat() {
return this.fDefaultFormat;
}
@Override
public int hashCode() {
final int h= (int) (this.fIndex ^ (this.fIndex >>> 32));
return h ^ (h >>> 7);
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof RDataTableColumn)) {
return false;
}
final RDataTableColumn other= (RDataTableColumn) obj;
return (this.fIndex == other.fIndex);
}
}