Package java.util

Examples of java.util.AbstractSet


        @aribaapi documented
    */
    public Set keySet ()
    {
        if (keySet == null) {
            keySet = new AbstractSet()
            {
                public Iterator iterator ()
                {
                    return MapUtil.enumerationToIterator(keys());
                }
View Full Code Here


    {
  JSONObject jso = (JSONObject)o;
  String java_class = getJavaClass(jso);
  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 = getSet(jso);

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

  Iterator i = jsonset.keys();
  String key = null;

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

            for (int i = 0; i < length; ++i) {
                XSObject xso = item(i);
                entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);
            }
            // Create a view of this immutable map.
            fEntrySet = new AbstractSet() {
                public Iterator iterator() {
                    return new Iterator() {
                        private int index = 0;
                        public boolean hasNext() {
                            return (index < length);
View Full Code Here

            this.useDefault = useDefault ;
        }

        public Set entrySet()
        {
            return new AbstractSet()
            {
                public Iterator iterator()
                {
                    return new Iterator() {
                        // index of next element to return
View Full Code Here

     */
    public Set entrySet() {
        if (entrySet != null) {
            return entrySet;
        }
        entrySet = new AbstractSet() {
            public int size() {
                return ReferenceMap.this.size();
            }

            public void clear() {
View Full Code Here

     *
     *  @return a set view of this map's keys
     */
    public Set keySet() {
        if (keySet != null) return keySet;
        keySet = new AbstractSet() {
            public int size() {
                return ReferenceMap.this.size();
            }

            public Iterator iterator() {
View Full Code Here

  /**
   *  Implements {@link Map#keySet()}.
   */
  public Set keySet() {
    return new AbstractSet() {

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

  /**
   *  Implements {@link 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

            itr.close();
        }
    }

    public Set keySet() {
        return new AbstractSet() {
            public int size() {
                return AbstractLRSProxyMap.this.size();
            }

            public boolean remove(Object o) {
View Full Code Here

            }
        };
    }

    public Set entrySet() {
        return new AbstractSet() {
            public int size() {
                return AbstractLRSProxyMap.this.size();
            }

            public Iterator iterator() {
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.