示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public <T> java.util.Set<MarketDataId<T>> findIds(MarketDataName<T> name)
        public ISet <MarketDataId <T> > findIds <T>(MarketDataName <T> name)
        {
            // no type check against id.getMarketDataType() as checked in factory
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: return values.keySet().stream().filter(id -> id instanceof NamedMarketDataId).filter(id -> ((NamedMarketDataId<?>) id).getMarketDataName().equals(name)).map(id -> (MarketDataId<T>) id).collect(toImmutableSet());
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            return(values.Keys.Where(id => id is NamedMarketDataId).Where(id => ((NamedMarketDataId <object>)id).MarketDataName.Equals(name)).Select(id => (MarketDataId <T>)id).collect(toImmutableSet()));
        }
示例#2
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Compares this name to another.
 /// <para>
 /// Instances are compared in alphabetical order based on the name, taking into account the implementation type.
 ///
 /// </para>
 /// </summary>
 /// <param name="other">  the object to compare to </param>
 /// <returns> the comparison </returns>
 public virtual int compareTo <T1>(MarketDataName <T1> other)
 {
     if (this.GetType() == other.GetType())
     {
         return(Name.CompareTo(other.Name));
     }
     return(compareSlow(other));
 }
示例#3
0
        /// <summary>
        /// Checks if this instance equals another.
        /// <para>
        /// Instances are compared based on the name and market data type.
        ///
        /// </para>
        /// </summary>
        /// <param name="obj">  the object to compare to, null returns false </param>
        /// <returns> true if equal </returns>
        public override sealed bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj != null && obj.GetType() == this.GetType())
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: MarketDataName<?> other = (MarketDataName<?>) obj;
                MarketDataName <object> other = (MarketDataName <object>)obj;
                return(Name.Equals(other.Name));
            }
            return(false);
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public <R> java.util.Set<MarketDataId<R>> findIds(MarketDataName<R> name)
        public ISet <MarketDataId <R> > findIds <R>(MarketDataName <R> name)
        {
            ISet <MarketDataId <R> > ids = underlying.findIds(name);

            if (id is NamedMarketDataId)
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: NamedMarketDataId<?> named = (NamedMarketDataId<?>) id;
                NamedMarketDataId <object> named = (NamedMarketDataId <object>)id;
                if (named.MarketDataName.Equals(name))
                {
                    return(ImmutableSet.builder <MarketDataId <R> >().addAll(ids).add((MarketDataId <R>)id).build());
                }
            }
            return(ids);
        }
 public ISet <MarketDataId <T> > findIds <T>(MarketDataName <T> name)
 {
     return(ImmutableSet.of());
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public <T> java.util.Set<MarketDataId<T>> findIds(MarketDataName<T> name)
        public ISet <MarketDataId <T> > findIds <T>(MarketDataName <T> name)
        {
            return(ImmutableSet.builder <MarketDataId <T> >().addAll(underlying1.findIds(name)).addAll(underlying2.findIds(name)).build());
        }
示例#7
0
        // compare when classes differ, broken out for inlining
        private int compareSlow <T1>(MarketDataName <T1> other)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            return(ComparisonChain.start().compare(this.GetType().FullName, other.GetType().FullName).compare(Name, other.Name).result());
        }