コード例 #1
0
            /// <summary>
            /// Recode the incoming object to a String, compacting it into a
            /// BCF2 string if the value is a list.
            /// </summary>
            /// <param name="value"> a String or List<String> to encode, or null </param>
            /// <returns> a non-null string to encode </returns>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Ensures("result != null") private String javaStringToBCF2String(final Object value)
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
            private string javaStringToBCF2String(object value)
            {
                if (value == null)
                {
                    return("");
                }
                else if (value is IList)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.List<String> l = (java.util.List<String>)value;
                    IList <string> l = (IList <string>)value;
                    if (l.Count == 0)
                    {
                        return("");
                    }
                    else
                    {
                        return(BCF2Utils.collapseStringList(l));
                    }
                }
                else
                {
                    return((string)value);
                }
            }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Ensures("encodeStream.size() > old(encodeStream.size())") public final void encodeTyped(List<? extends Object> v, final org.broadinstitute.variant.bcf2.BCF2Type type) throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
        public void encodeTyped <T1>(IList <T1> v, BCF2Type type) where T1 : Object
        {
            if (type == BCF2Type.CHAR && v.Count != 0)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String s = org.broadinstitute.variant.bcf2.BCF2Utils.collapseStringList((List<String>) v);
                string s = BCF2Utils.collapseStringList((IList <string>)v);
                v = stringToBytes(s);
            }

            encodeType(v.Count, type);
            encodeRawValues(v, type);
        }