/**
  * Returns the values for the BeanMap.
  *
  * @return values for the BeanMap.  The returned collection is not
  *        modifiable.
  */
 public override java.util.Collection <Object> values()
 {
     java.util.ArrayList <Object> answer = new java.util.ArrayList <Object>(readMethods.size());
     for (java.util.Iterator <Object> iter = valueIterator(); iter.hasNext();)
     {
         answer.add(iter.next());
     }
     return(UnmodifiableList.decorate(answer));
 }
예제 #2
0
        /**
         * Returns a List view of the keys rather than a set view.  The returned
         * list is unmodifiable.  This is required because changes to the values of
         * the list (using {@link java.util.ListIterator#set(Object)}) will
         * effectively remove the value from the list and reinsert that value at
         * the end of the list, which is an unexpected side effect of changing the
         * value of a list.  This occurs because changing the key, changes when the
         * mapping is added to the map and thus where it appears in the list.
         *
         * <p>An alternative to this method is to use {@link #keySet()}
         *
         * @see #keySet()
         * @return The ordered list of keys.
         */
        public java.util.List <Object> sequence()
        {
            java.util.List <Object>     l    = new java.util.ArrayList <Object>(size());
            java.util.Iterator <Object> iter = keySet().iterator();
            while (iter.hasNext())
            {
                l.add(iter.next());
            }

            return(UnmodifiableList.decorate(l));
        }
 /**
  * Returns an unmodifiable list backed by the given list.
  * <p>
  * This method uses the implementation in the decorators subpackage.
  *
  * @param list  the list to make unmodifiable, must not be null
  * @return an unmodifiable list backed by the given list
  * @throws IllegalArgumentException  if the list is null
  */
 public static java.util.List <Object> unmodifiableList(java.util.List <Object> list)
 {
     return(UnmodifiableList.decorate(list));
 }
예제 #4
0
        //-----------------------------------------------------------------------

        /**
         * Gets an unmodifiable view of the order of the Set.
         *
         * @return an unmodifiable list view
         */
        public virtual java.util.List <Object> asList()
        {
            return(UnmodifiableList.decorate(setOrder));
        }
 /**
  * Gets the collections being decorated.
  *
  * @return Unmodifiable collection of all collections in this composite.
  */
 public virtual java.util.Collection <Object> getCollections()
 {
     return(UnmodifiableList.decorate(java.util.Arrays <Object> .asList <Object>(this.all)));
 }
 public override java.util.List <Object> subList(int fromIndexInclusive, int toIndexExclusive)
 {
     return(UnmodifiableList.decorate(base.subList(fromIndexInclusive, toIndexExclusive)));
 }
 /**
  * Gets a view over the keys in the map as a List.
  * <p>
  * The List will be ordered by object insertion into the map.
  * The List is unmodifiable.
  *
  * @see #keySet()
  * @return the unmodifiable list view over the keys
  * @since Commons Collections 3.2
  */
 public virtual java.util.List <Object> keyList()
 {
     return(UnmodifiableList.decorate(insertOrder));
 }
예제 #8
0
 /**
  * Get the list of Iterators (unmodifiable)
  *
  * @return the unmodifiable list of iterators added
  */
 public java.util.List <Object> getIterators()
 {
     return(UnmodifiableList.decorate(iteratorChain));
 }
 /**
  * Gets the list of Iterators (unmodifiable).
  *
  * @return the unmodifiable list of iterators added
  */
 public virtual java.util.List <Object> getIterators()
 {
     return(UnmodifiableList.decorate(iterators));
 }