blob: c06e14091f2ac3907fccafa5983349a152777671 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2009, 2017 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.rj.data.impl;
import java.io.IOException;
import org.eclipse.statet.rj.data.RFunction;
import org.eclipse.statet.rj.data.RJIO;
import org.eclipse.statet.rj.data.RObjectFactory;
import org.eclipse.statet.rj.data.RStore;
public class RFunctionImpl extends AbstractRObject
implements RFunction, ExternalizableRObject {
private String headerSource;
private String bodySource;
public RFunctionImpl(final String header) {
this.headerSource= header;
}
public RFunctionImpl(final RJIO io, final RObjectFactory factory) throws IOException {
readExternal(io, factory);
}
public void readExternal(final RJIO io, final RObjectFactory factory) throws IOException {
/*final int options =*/ io.readInt();
this.headerSource= io.readString();
}
@Override
public void writeExternal(final RJIO io, final RObjectFactory factory) throws IOException {
io.writeInt(/*options*/ 0);
io.writeString(this.headerSource);
}
@Override
public byte getRObjectType() {
return TYPE_FUNCTION;
}
@Override
public String getRClassName() {
return "function";
}
@Override
public long getLength() {
return 0;
}
@Override
public String getHeaderSource() {
return this.headerSource;
}
@Override
public String getBodySource() {
return this.bodySource;
}
@Override
public RStore<?> getData() {
return null;
}
}