示例#1
0
        /// <summary>
        /// Create a list of ExcludeEntry from the Exclude object.
        /// </summary>
        ///
        /// <param name="exclude">The Exclude object to read.</param>
        /// <returns>A new list of ExcludeEntry.</returns>
        private static ArrayList getExcludeEntries(Exclude exclude)
        {
            ArrayList entries = new ArrayList();

            for (int i = 0; i < exclude.size(); ++i)
            {
                if (exclude.get(i).getType() == net.named_data.jndn.Exclude.Type.ANY)
                {
                    if (entries.Count == 0)
                    {
                        // Add a "beginning ANY".
                        ILOG.J2CsMapping.Collections.Collections.Add(entries, new Producer.ExcludeEntry(new Name.Component(), true));
                    }
                    else
                    {
                        // Set anyFollowsComponent of the final component.
                        ((Producer.ExcludeEntry)entries[entries.Count - 1]).anyFollowsComponent_ = true;
                    }
                }
                else
                {
                    ILOG.J2CsMapping.Collections.Collections.Add(entries, new Producer.ExcludeEntry(exclude.get(i).getComponent(),
                                                                                                    false));
                }
            }

            return(entries);
        }