yijunyu/c-to-rust huggingface dataset:
// Original:
public CellRangeAddress[] getFormattingRanges() {return cfAggregate.getHeader().getCellRanges();}

// Translation:
public CellRangeAddress[] GetFormattingRanges(){return cfAggregate.Header.CellRanges;}
// Original:
public PrintStream append(CharSequence charSequence) {if (charSequence == null) {print("null");} else {print(charSequence.toString());}return this;}

// Translation:
public virtual java.io.PrintStream append(java.lang.CharSequence charSequence){if (charSequence == null){print("null");}else{print(charSequence.ToString());}return this;}
// Original:
public GetSkillGroupResult getSkillGroup(GetSkillGroupRequest request) {request = beforeClientExecution(request);return executeGetSkillGroup(request);}

// Translation:
public virtual GetSkillGroupResponse GetSkillGroup(GetSkillGroupRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetSkillGroupRequestMarshaller.Instance;options.ResponseUnmarshaller = GetSkillGroupResponseUnmarshaller.Instance;return Invoke<GetSkillGroupResponse>(request, options);}
// Original:
public DeleteObjectResult deleteObject(DeleteObjectRequest request) {request = beforeClientExecution(request);return executeDeleteObject(request);}

// Translation:
public virtual DeleteObjectResponse DeleteObject(DeleteObjectRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteObjectRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteObjectResponseUnmarshaller.Instance;return Invoke<DeleteObjectResponse>(request, options);}
// Original:
public boolean removeAll(final IntList c){boolean rval = false;for (int j = 0; j < c._limit; j++){if (removeValue(c._array[ j ])){rval = true;}}return rval;}

// Translation:
public bool RemoveAll(IntList c){bool rval = false;for (int j = 0; j < c._limit; j++){if (RemoveValue(c._array[j])){rval = true;}}return rval;}
// Original:
public String toString() {StringBuilder buffer = new StringBuilder();buffer.append("[FILEPASS]\n");buffer.append("    .type = ").append(HexDump.shortToHex(encryptionType)).append('\n');String prefix = "     ."+encryptionInfo.getEncryptionMode();buffer.append(prefix+".info = ").append(HexDump.shortToHex(encryptionInfo.getVersionMajor())).append('\n');buffer.append(prefix+".ver  = ").append(HexDump.shortToHex(encryptionInfo.getVersionMinor())).append('\n');buffer.append(prefix+".salt = ").append(HexDump.toHex(encryptionInfo.getVerifier().getSalt())).append('\n');buffer.append(prefix+".verifier = ").append(HexDump.toHex(encryptionInfo.getVerifier().getEncryptedVerifier())).append('\n');buffer.append(prefix+".verifierHash = ").append(HexDump.toHex(encryptionInfo.getVerifier().getEncryptedVerifierHash())).append('\n');buffer.append("[/FILEPASS]\n");return buffer.toString();}

// Translation:
public override String ToString(){StringBuilder buffer = new StringBuilder();buffer.Append("[FILEPASS]\n");buffer.Append("    .type = ").Append(HexDump.ShortToHex(_encryptionType)).Append("\n");buffer.Append("    .info = ").Append(HexDump.ShortToHex(_encryptionInfo)).Append("\n");buffer.Append("    .ver  = ").Append(HexDump.ShortToHex(_minorVersionNo)).Append("\n");buffer.Append("    .docId= ").Append(HexDump.ToHex(_docId)).Append("\n");buffer.Append("    .salt = ").Append(HexDump.ToHex(_saltData)).Append("\n");buffer.Append("    .hash = ").Append(HexDump.ToHex(_saltHash)).Append("\n");buffer.Append("[/FILEPASS]\n");return buffer.ToString();}
// Original:
public CreateCustomerGatewayResult createCustomerGateway(CreateCustomerGatewayRequest request) {request = beforeClientExecution(request);return executeCreateCustomerGateway(request);}

// Translation:
public virtual CreateCustomerGatewayResponse CreateCustomerGateway(CreateCustomerGatewayRequest request){var options = new InvokeOptions();options.RequestMarshaller = CreateCustomerGatewayRequestMarshaller.Instance;options.ResponseUnmarshaller = CreateCustomerGatewayResponseUnmarshaller.Instance;return Invoke<CreateCustomerGatewayResponse>(request, options);}
// Original:
public CharBuffer compact() {if (byteBuffer.isReadOnly()) {throw new ReadOnlyBufferException();}byteBuffer.limit(limit * SizeOf.CHAR);byteBuffer.position(position * SizeOf.CHAR);byteBuffer.compact();byteBuffer.clear();position = limit - position;limit = capacity;mark = UNSET_MARK;return this;}

// Translation:
public override java.nio.CharBuffer compact(){if (byteBuffer.isReadOnly()){throw new java.nio.ReadOnlyBufferException();}byteBuffer.limit(_limit * libcore.io.SizeOf.CHAR);byteBuffer.position(_position * libcore.io.SizeOf.CHAR);byteBuffer.compact();byteBuffer.clear();_position = _limit - _position;_limit = _capacity;_mark = UNSET_MARK;return this;}
// Original:
public DirCache getDirCache() {return cache;}

// Translation:
public virtual DirCache GetDirCache(){return cache;}
// Original:
public PatternReplaceCharFilterFactory(Map<String, String> args) {super(args);pattern = getPattern(args, "pattern");replacement = get(args, "replacement", "");if (!args.isEmpty()) {throw new IllegalArgumentException("Unknown parameters: " + args);}}

// Translation:
public PatternReplaceCharFilterFactory(IDictionary<string, string> args) : base(args){pattern = GetPattern(args, "pattern");replacement = Get(args, "replacement", "");maxBlockChars = GetInt32(args, "maxBlockChars",#pragma warning disable 612, 618PatternReplaceCharFilter.DEFAULT_MAX_BLOCK_CHARS);#pragma warning restore 612, 618if (args.TryGetValue("blockDelimiters", out blockDelimiters)){args.Remove("blockDelimiters");}if (args.Count > 0){throw new System.ArgumentException("Unknown parameters: " + args);}}
// Original:
public boolean getCreateEmptyCells() {return shouldCreateEmptyCells;}

// Translation:
public bool GetCreateEmptyCells(){return shouldCreateEmptyCells;}
// Original:
public long getIndexSize() {long sz = 8 ;sz += 4 * 4 ;sz += sizeOf(src);sz += sizeOf(table);sz += sizeOf(entries);return sz;}

// Translation:
public virtual long GetIndexSize(){long sz = 8;sz += 4 * 4;sz += SizeOf(src);sz += SizeOf(table);sz += SizeOf(entries);return sz;}
// Original:
public ShortBuffer put(short[] src, int srcOffset, int shortCount) {Arrays.checkOffsetAndCount(src.length, srcOffset, shortCount);if (shortCount > remaining()) {throw new BufferOverflowException();}for (int i = srcOffset; i < srcOffset + shortCount; ++i) {put(src[i]);}return this;}

// Translation:
public virtual java.nio.ShortBuffer put(short[] src, int srcOffset, int shortCount){java.util.Arrays.checkOffsetAndCount(src.Length, srcOffset, shortCount);if (shortCount > remaining()){throw new java.nio.BufferOverflowException();}{for (int i = srcOffset; i < srcOffset + shortCount; ++i){put(src[i]);}}return this;}
// Original:
public String toString() {if (getChildren() == null || getChildren().size() == 0)return "<multiPhrase/>";StringBuilder sb = new StringBuilder();sb.append("<multiPhrase>");for (QueryNode child : getChildren()) {sb.append("\n");sb.append(child.toString());}sb.append("\n</multiPhrase>");return sb.toString();}

// Translation:
public override string ToString(){var children = GetChildren();if (children == null || children.Count == 0)return "<multiPhrase/>";StringBuilder sb = new StringBuilder();sb.Append("<multiPhrase>");foreach (IQueryNode child in children){sb.Append("\n");sb.Append(child.ToString());}sb.Append("\n</multiPhrase>");return sb.ToString();}
// Original:
public GetGatewayResponseResult getGatewayResponse(GetGatewayResponseRequest request) {request = beforeClientExecution(request);return executeGetGatewayResponse(request);}

// Translation:
public virtual GetGatewayResponseResponse GetGatewayResponse(GetGatewayResponseRequest request){var options = new InvokeOptions();options.RequestMarshaller = GetGatewayResponseRequestMarshaller.Instance;options.ResponseUnmarshaller = GetGatewayResponseResponseUnmarshaller.Instance;return Invoke<GetGatewayResponseResponse>(request, options);}
// Original:
public SubscribeRequest(String topicArn, String protocol, String endpoint) {setTopicArn(topicArn);setProtocol(protocol);setEndpoint(endpoint);}

// Translation:
public SubscribeRequest(string topicArn, string protocol, string endpoint){_topicArn = topicArn;_protocol = protocol;_endpoint = endpoint;}
// Original:
public void setLengthNormFactors(int min, int max, float steepness, boolean discountOverlaps) {this.ln_min = min;this.ln_max = max;this.ln_steep = steepness;this.discountOverlaps = discountOverlaps;}

// Translation:
public virtual void SetLengthNormFactors(int min, int max, float steepness, bool discountOverlaps){this.ln_min = min;this.ln_max = max;this.ln_steep = steepness;this.DiscountOverlaps = discountOverlaps;}
// Original:
public void start() {mStartTime = ANIMATION_START;}

// Translation:
public virtual void start(){setStartTime(-1);}
// Original:
public DeleteLaunchConfigurationResult deleteLaunchConfiguration(DeleteLaunchConfigurationRequest request) {request = beforeClientExecution(request);return executeDeleteLaunchConfiguration(request);}

// Translation:
public virtual DeleteLaunchConfigurationResponse DeleteLaunchConfiguration(DeleteLaunchConfigurationRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteLaunchConfigurationRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteLaunchConfigurationResponseUnmarshaller.Instance;return Invoke<DeleteLaunchConfigurationResponse>(request, options);}
// Original:
public void remove( Object record ) {int i = 0;for (org.apache.poi.hssf.record.Record r : records) {if (r == record) {remove(i);break;}i++;}}

// Translation:
public void Remove(Record record){int i = records.IndexOf(record);this.Remove(i);}
// Original:
public void write(LittleEndianOutput out) {out.writeByte(sid + getPtgClass());out.writeShort(getFunctionIndex());}

// Translation:
public override void Write(ILittleEndianOutput out1){out1.WriteByte(sid + PtgClass);out1.WriteShort(_functionIndex);}
// Original:
public Term(String fld, BytesRef bytes) {field = fld;this.bytes = bytes == null ? null : BytesRef.deepCopyOf(bytes);}

// Translation:
public Term(string fld, BytesRef bytes){Field = fld;Bytes = bytes;}
// Original:
public long ramBytesUsed() {return RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER+ RamUsageEstimator.NUM_BYTES_OBJECT_REF+ Long.BYTES+ Float.BYTES)+ current.ramBytesUsed();}

// Translation:
public override long RamBytesUsed(){return RamUsageEstimator.AlignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER+ RamUsageEstimator.NUM_BYTES_OBJECT_REF+ RamUsageEstimator.NUM_BYTES_INT64+ RamUsageEstimator.NUM_BYTES_SINGLE)+ current.RamBytesUsed();}
// Original:
public int serialize( int offset, byte[] data){return serialize( offset, data, new NullEscherSerializationListener() );}

// Translation:
public int Serialize(int offset, byte[] data){return Serialize(offset, data, new NullEscherSerializationListener());}
// Original:
public String toString() {if (count == 0) {return "";}int wasted = value.length - count;if (wasted >= 256|| (wasted >= INITIAL_CAPACITY && wasted >= (count >> 1))) {return new String(value, 0, count);}shared = true;return new String(0, count, value);}

// Translation:
public override string ToString(){if (count == 0){return string.Empty;}int wasted = value.Length - count;if (wasted >= 256 || (wasted >= INITIAL_CAPACITY && wasted >= (count >> 1))){return new string(value, 0, count);}shared = true;return Sharpen.StringHelper.GetString(0, count, value);}
// Original:
public void serialize(LittleEndianOutput out) {out.writeShort(field_1_protect);}

// Translation:
public override void Serialize(ILittleEndianOutput out1){out1.WriteShort(field_1_protect);}
// Original:
public AssociateResolverEndpointIpAddressResult associateResolverEndpointIpAddress(AssociateResolverEndpointIpAddressRequest request) {request = beforeClientExecution(request);return executeAssociateResolverEndpointIpAddress(request);}

// Translation:
public virtual AssociateResolverEndpointIpAddressResponse AssociateResolverEndpointIpAddress(AssociateResolverEndpointIpAddressRequest request){var options = new InvokeOptions();options.RequestMarshaller = AssociateResolverEndpointIpAddressRequestMarshaller.Instance;options.ResponseUnmarshaller = AssociateResolverEndpointIpAddressResponseUnmarshaller.Instance;return Invoke<AssociateResolverEndpointIpAddressResponse>(request, options);}
// Original:
public RevertCommand include(AnyObjectId commit) {return include(commit.getName(), commit);}

// Translation:
public virtual NGit.Api.RevertCommand Include(AnyObjectId commit){return Include(commit.GetName(), commit);}
// Original:
public static ByteBuffer wrap(byte[] array) {return new ReadWriteHeapByteBuffer(array);}

// Translation:
public static java.nio.ByteBuffer wrap(byte[] array_1){return new java.nio.ReadWriteHeapByteBuffer(array_1);}
// Original:
public void removeSecurity() {remove1stProperty(PropertyIDMap.PID_SECURITY);}

// Translation:
public void RemoveSecurity(){MutableSection s = (MutableSection)FirstSection;s.RemoveProperty(PropertyIDMap.PID_SECURITY);}
// Original:
public ImportVolumeResult importVolume(ImportVolumeRequest request) {request = beforeClientExecution(request);return executeImportVolume(request);}

// Translation:
public virtual ImportVolumeResponse ImportVolume(ImportVolumeRequest request){var options = new InvokeOptions();options.RequestMarshaller = ImportVolumeRequestMarshaller.Instance;options.ResponseUnmarshaller = ImportVolumeResponseUnmarshaller.Instance;return Invoke<ImportVolumeResponse>(request, options);}
// Original:
public boolean isDetectRenames() {return renameDetector != null;}

// Translation:
public virtual bool IsDetectRenames(){return renameDetector != null;}
// Original:
public CacheCluster rebootCacheCluster(RebootCacheClusterRequest request) {request = beforeClientExecution(request);return executeRebootCacheCluster(request);}

// Translation:
public virtual RebootCacheClusterResponse RebootCacheCluster(RebootCacheClusterRequest request){var options = new InvokeOptions();options.RequestMarshaller = RebootCacheClusterRequestMarshaller.Instance;options.ResponseUnmarshaller = RebootCacheClusterResponseUnmarshaller.Instance;return Invoke<RebootCacheClusterResponse>(request, options);}
// Original:
public DescribeTemplateAliasResult describeTemplateAlias(DescribeTemplateAliasRequest request) {request = beforeClientExecution(request);return executeDescribeTemplateAlias(request);}

// Translation:
public virtual DescribeTemplateAliasResponse DescribeTemplateAlias(DescribeTemplateAliasRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeTemplateAliasRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeTemplateAliasResponseUnmarshaller.Instance;return Invoke<DescribeTemplateAliasResponse>(request, options);}
// Original:
public void reset() {if (overflow != null) {destroy();}if (blocks != null)blocks.clear();elseblocks = new ArrayList<>(initialBlocks);blocks.add(new Block(Math.min(inCoreLimit, Block.SZ)));}

// Translation:
public virtual void Reset(){if (overflow != null){Destroy();}if (inCoreLimit < TemporaryBuffer.Block.SZ){blocks = new AList<TemporaryBuffer.Block>(1);blocks.AddItem(new TemporaryBuffer.Block(inCoreLimit));}else{blocks = new AList<TemporaryBuffer.Block>(inCoreLimit / TemporaryBuffer.Block.SZ);blocks.AddItem(new TemporaryBuffer.Block());}}
// Original:
public DescribeWorkspaceSnapshotsResult describeWorkspaceSnapshots(DescribeWorkspaceSnapshotsRequest request) {request = beforeClientExecution(request);return executeDescribeWorkspaceSnapshots(request);}

// Translation:
public virtual DescribeWorkspaceSnapshotsResponse DescribeWorkspaceSnapshots(DescribeWorkspaceSnapshotsRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeWorkspaceSnapshotsRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeWorkspaceSnapshotsResponseUnmarshaller.Instance;return Invoke<DescribeWorkspaceSnapshotsResponse>(request, options);}
// Original:
public void clear() {name = null;body = null;title = null;date = null;props = null;id = -1;}

// Translation:
public void Clear(){Name = null;Body = null;Title = null;date = null;Props = null;ID = -1;}
// Original:
public DeleteDistributionResult deleteDistribution(DeleteDistributionRequest request) {request = beforeClientExecution(request);return executeDeleteDistribution(request);}

// Translation:
public virtual DeleteDistributionResponse DeleteDistribution(DeleteDistributionRequest request){var options = new InvokeOptions();options.RequestMarshaller = DeleteDistributionRequestMarshaller.Instance;options.ResponseUnmarshaller = DeleteDistributionResponseUnmarshaller.Instance;return Invoke<DeleteDistributionResponse>(request, options);}
// Original:
public final long next() {assert hasNext();long result = currentValues[pOff++];if (pOff == currentCount) {vOff += 1;pOff = 0;fillBlock();}return result;}

// Translation:
public long Next(){Debug.Assert(HasNext);long result = currentValues[pOff++];if (pOff == currentCount){vOff += 1;pOff = 0;if (vOff <= outerInstance.valuesOff){FillValues();}else{currentCount = 0;}}return result;}
// Original:
public AttachInstancesToLoadBalancerResult attachInstancesToLoadBalancer(AttachInstancesToLoadBalancerRequest request) {request = beforeClientExecution(request);return executeAttachInstancesToLoadBalancer(request);}

// Translation:
public virtual AttachInstancesToLoadBalancerResponse AttachInstancesToLoadBalancer(AttachInstancesToLoadBalancerRequest request){var options = new InvokeOptions();options.RequestMarshaller = AttachInstancesToLoadBalancerRequestMarshaller.Instance;options.ResponseUnmarshaller = AttachInstancesToLoadBalancerResponseUnmarshaller.Instance;return Invoke<AttachInstancesToLoadBalancerResponse>(request, options);}
// Original:
public PrintSetupRecord(RecordInputStream in) {field_1_paper_size    = in.readShort();field_2_scale         = in.readShort();field_3_page_start    = in.readShort();field_4_fit_width     = in.readShort();field_5_fit_height    = in.readShort();field_6_options       = in.readShort();field_7_hresolution   = in.readShort();field_8_vresolution   = in.readShort();field_9_headermargin  = in.readDouble();field_10_footermargin = in.readDouble();field_11_copies       = in.readShort();}

// Translation:
public PrintSetupRecord(RecordInputStream in1){field_1_paper_size = in1.ReadShort();field_2_scale = in1.ReadShort();field_3_page_start = in1.ReadShort();field_4_fit_width = in1.ReadShort();field_5_fit_height = in1.ReadShort();field_6_options = in1.ReadShort();field_7_hresolution = in1.ReadShort();field_8_vresolution = in1.ReadShort();field_9_headermargin = in1.ReadDouble();field_10_footermargin = in1.ReadDouble();field_11_copies = in1.ReadShort();}
// Original:
public UpdateNotificationSettingsResult updateNotificationSettings(UpdateNotificationSettingsRequest request) {request = beforeClientExecution(request);return executeUpdateNotificationSettings(request);}

// Translation:
public virtual UpdateNotificationSettingsResponse UpdateNotificationSettings(UpdateNotificationSettingsRequest request){var options = new InvokeOptions();options.RequestMarshaller = UpdateNotificationSettingsRequestMarshaller.Instance;options.ResponseUnmarshaller = UpdateNotificationSettingsResponseUnmarshaller.Instance;return Invoke<UpdateNotificationSettingsResponse>(request, options);}
// Original:
public DescribeSnapshotAttributeResult describeSnapshotAttribute(DescribeSnapshotAttributeRequest request) {request = beforeClientExecution(request);return executeDescribeSnapshotAttribute(request);}

// Translation:
public virtual DescribeSnapshotAttributeResponse DescribeSnapshotAttribute(DescribeSnapshotAttributeRequest request){var options = new InvokeOptions();options.RequestMarshaller = DescribeSnapshotAttributeRequestMarshaller.Instance;options.ResponseUnmarshaller = DescribeSnapshotAttributeResponseUnmarshaller.Instance;return Invoke<DescribeSnapshotAttributeResponse>(request, options);}
// Original:
public ListDocumentClassificationJobsResult listDocumentClassificationJobs(ListDocumentClassificationJobsRequest request) {request = beforeClientExecution(request);return executeListDocumentClassificationJobs(request);}

// Translation:
public virtual ListDocumentClassificationJobsResponse ListDocumentClassificationJobs(ListDocumentClassificationJobsRequest request){var options = new InvokeOptions();options.RequestMarshaller = ListDocumentClassificationJobsRequestMarshaller.Instance;options.ResponseUnmarshaller = ListDocumentClassificationJobsResponseUnmarshaller.Instance;return Invoke<ListDocumentClassificationJobsResponse>(request, options);}
// Original:
public Item() {parent = 0;child = 0;}

// Translation:
public Item(){parent = (char)0;child = (char)0;}
// Original:
public static final AbbreviatedObjectId fromObjectId(AnyObjectId id) {return new AbbreviatedObjectId(Constants.OBJECT_ID_STRING_LENGTH,id.w1, id.w2, id.w3, id.w4, id.w5);}

// Translation:
public static NGit.AbbreviatedObjectId FromObjectId(AnyObjectId id){return new NGit.AbbreviatedObjectId(Constants.OBJECT_ID_STRING_LENGTH, id.w1, id.w2, id.w3, id.w4, id.w5);}
// Original:
public String format(Object value) {StringBuffer sb = new StringBuffer();formatValue(sb, value);return sb.toString();}

// Translation:
public String Format(Object value){StringBuilder sb = new StringBuilder();FormatValue(sb, value);return sb.ToString();}
// Original:
public void processContinueRecord( byte[] record ){rawDataContainer.concatenate(record);}

// Translation:
public void ProcessContinueRecord(byte[] record){rawDataContainer.Concatenate(record);}
// Original:
public ListenerHandle addChangeListener(ConfigChangedListener listener) {return listeners.addConfigChangedListener(listener);}

// Translation:
public virtual ListenerHandle AddChangeListener(ConfigChangedListener listener){return listeners.AddConfigChangedListener(listener);}
// Original:
public BlendedTermQuery build() {return new BlendedTermQuery(ArrayUtil.copyOfSubArray(terms, 0, numTerms),ArrayUtil.copyOfSubArray(boosts, 0, numTerms),ArrayUtil.copyOfSubArray(contexts, 0, numTerms),rewriteMethod);}

// Translation:
public CompositeReaderContext Build(){return (CompositeReaderContext)Build(null, reader, 0, 0);}
// Original:
public void setFlagByBit(int bitmask, boolean enabled) {if (enabled) {flags |= bitmask;} else {flags &= (0xFFFF ^ bitmask);}}

// Translation:
public void SetFlagByBit(int bitmask, bool enabled){if (enabled){flags |= (short)bitmask;}else{flags &= (short)(0xFFFF ^ bitmask);}}
// Original:
public static double calculate(double pStartDateVal, double pEndDateVal, int basis) throws EvaluationException {if (basis < 0 || basis >= 5) {throw new EvaluationException(ErrorEval.NUM_ERROR);}int startDateVal = (int) Math.floor(pStartDateVal);int endDateVal = (int) Math.floor(pEndDateVal);if (startDateVal == endDateVal) {return 0;}if (startDateVal > endDateVal) {int temp = startDateVal;startDateVal = endDateVal;endDateVal = temp;}switch (basis) {case 0: return basis0(startDateVal, endDateVal);case 1: return basis1(startDateVal, endDateVal);case 2: return basis2(startDateVal, endDateVal);case 3: return basis3(startDateVal, endDateVal);case 4: return basis4(startDateVal, endDateVal);}throw new IllegalStateException("cannot happen");}

// Translation:
public static double Calculate(double pStartDateVal, double pEndDateVal, int basis){if (basis < 0 || basis >= 5){throw new EvaluationException(ErrorEval.NUM_ERROR);}int startDateVal = (int)Math.Floor(pStartDateVal);int endDateVal = (int)Math.Floor(pEndDateVal);if (startDateVal == endDateVal){return 0;}if (startDateVal > endDateVal){int temp = startDateVal;startDateVal = endDateVal;endDateVal = temp;}switch (basis){case 0: return Basis0(startDateVal, endDateVal);case 1: return Basis1(startDateVal, endDateVal);case 2: return Basis2(startDateVal, endDateVal);case 3: return Basis3(startDateVal, endDateVal);case 4: return Basis4(startDateVal, endDateVal);}throw new InvalidOperationException("cannot happen");}