예제 #1
0
        /// <summary>
        /// Returns the list to which the specified property key is mapped, or
        /// an empty list if this properties contains no mapping for the property key.
        /// Note that the empty list is not mapped to the property key.
        /// </summary>
        /// <param name="property">
        ///          the property key whose associated list is to be returned </param>
        /// <returns> the list to which the specified property key is mapped, or
        ///         an empty list if this properties contains no mapping for the property key
        /// </returns>
        /// <seealso cref= #addListItem(PropertyListKey, Object) </seealso>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public <T> java.util.List<T> get(PropertyListKey<T> property)
        public virtual IList <T> get <T>(PropertyListKey <T> property)
        {
            if (contains(property))
            {
                return((IList <T>)properties[property.Name]);
            }
            else
            {
                return(new List <T>());
            }
        }
예제 #2
0
        /// <summary>
        /// Append the value to the list to which the specified property key is mapped. If
        /// this properties contains no mapping for the property key, the value append to
        /// a new list witch is associate the the specified property key.
        /// </summary>
        /// @param <T>
        ///          the type of elements in the list </param>
        /// <param name="property">
        ///          the property key whose associated list is to be added </param>
        /// <param name="value">
        ///          the value to be appended to list </param>
        public virtual void addListItem <T>(PropertyListKey <T> property, T value)
        {
            IList <T> list = get(property);

            list.Add(value);

            if (!contains(property))
            {
                set(property, list);
            }
        }
예제 #3
0
 /// <summary>
 /// Returns <code>true</code> if this properties contains a mapping for the specified property key.
 /// </summary>
 /// <param name="property">
 ///            the property key whose presence is to be tested </param>
 /// <returns> <code>true</code> if this properties contains a mapping for the specified property key </returns>
 public virtual bool contains <T1>(PropertyListKey <T1> property)
 {
     return(properties.ContainsKey(property.Name));
 }
예제 #4
0
 /// <summary>
 /// Associates the specified list with the specified property key. If the properties previously contained a mapping for the property key, the old
 /// value is replaced by the specified list.
 /// </summary>
 /// @param <T>
 ///          the type of elements in the list </param>
 /// <param name="property">
 ///          the property key with which the specified list is to be associated </param>
 /// <param name="value">
 ///          the list to be associated with the specified property key </param>
 public virtual void set <T>(PropertyListKey <T> property, IList <T> value)
 {
     properties[property.Name] = value;
 }