Package java.util

Examples of java.util.AbstractSet


         return size() == 0;
      }

      public Set keySet()
      {
         return new AbstractSet()
         {

            @Override
            public Iterator iterator()
            {
View Full Code Here


    super();
    this.servletContext = servletContext;
  }

  public Set entrySet() {
    return new AbstractSet() {

      public Iterator iterator() {
        return new Iterator() {
          private Enumeration initNames = servletContext.getInitParameterNames();
         
View Full Code Here

  /**
   * @see java.util.Map#keySet()
   */
  public Set keySet()
  {
    return new AbstractSet()
    {
      public Iterator iterator()
      {
        return new Iterator()
        {
View Full Code Here

  /**
   * @see java.util.Map#entrySet()
   */
  public Set entrySet()
  {
    return new AbstractSet()
    {
      public Iterator iterator()
      {
        return new Iterator()
        {
View Full Code Here

     *
     * @return BeanMap mappings.  The Set returned by this method
     *         is not modifiable.
     */
    public Set entrySet() {
        return Collections.unmodifiableSet(new AbstractSet() {
            public Iterator iterator() {
                return new Iterator() {

                    Iterator methodIter =
                      BeanMap.this.readMethods.keySet().iterator();
View Full Code Here

            throw new UnmarshallException("Could not read javaClass", e);
        }
        if (java_class == null) {
            throw new UnmarshallException("no type hint");
        }
        AbstractSet abset = null;
        if (java_class.equals("java.util.Set") || java_class.equals("java.util.AbstractSet") || java_class.equals("java.util.HashSet")) {
            abset = new HashSet();
        } else if (java_class.equals("java.util.TreeSet")) {
            abset = new TreeSet();
        } else if (java_class.equals("java.util.LinkedHashSet")) {
            abset = new LinkedHashSet();
        } else {
            throw new UnmarshallException("not a Set");
        }
        JSONObject jsonset;
        try {
            jsonset = jso.getJSONObject("set");
        } catch (JSONException e) {
            throw new UnmarshallException("set missing", e);
        }

        if (jsonset == null) {
            throw new UnmarshallException("set missing");
        }

        Iterator i = jsonset.keys();
        String key = null;
        state.setSerialized(o, abset);
        try {
            while (i.hasNext()) {
                key = (String) i.next();
                Object setElement = jsonset.get(key);
                abset.add(_ser.unmarshall(state, null, setElement));
            }
        } catch (UnmarshallException e) {
            throw new UnmarshallException("key " + i + e.getMessage(), e);
        } catch (JSONException e) {
            throw new UnmarshallException("key " + key + " " + e.getMessage(), e);
View Full Code Here

    sentinel.prev = sentinel;
  }

  // per Map.keySet()
  public Set keySet() {
    return new AbstractSet() {

      // required impls
      public Iterator iterator() { return new OrderedIterator(KEY); }
      public boolean remove(Object o) {
        return SequencedHashMap.this.remove(o) != null;
View Full Code Here

    };
  }

  // per Map.entrySet()
  public Set entrySet() {
    return new AbstractSet() {
      // helper
      private Entry findEntry(Object o) {
        if(o == null) return null;
        if(!(o instanceof Map.Entry)) return null;
       
View Full Code Here

     * Each MapEntry can be set but not removed.
     *
     * @return the unmodifiable set of mappings
     */
    public Set entrySet() {
        return UnmodifiableSet.decorate(new AbstractSet() {
            public Iterator iterator() {
                return entryIterator();
            }
            public int size() {
              return BeanMap.this.readMethods.size();
View Full Code Here

     * @return a set view of the mappings contained in this map.
     */
    public Set entrySetByValue() {

        if (setOfEntries[VALUE] == null) {
            setOfEntries[VALUE] = new AbstractSet() {

                public Iterator iterator() {

                    return new DoubleOrderedMapIterator(VALUE) {

View Full Code Here

TOP

Related Classes of java.util.AbstractSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.