Package java.util

Examples of java.util.AbstractSet


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

        if (setOfKeys[KEY] == null) {
            setOfKeys[KEY] = new AbstractSet() {

                public Iterator iterator() {

                    return new DoubleOrderedMapIterator(KEY) {

View Full Code Here


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

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

                public Iterator iterator() {

                    return new DoubleOrderedMapIterator(KEY) {

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

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


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 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

     @return a set view of this map's entries
     */
    public Set entrySet()
    {
        if (entrySet != null) return entrySet;
        entrySet = new AbstractSet()
        {
            public int size()
            {
                return ReferenceMap.this.size();
            }
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 size;
            }
View Full Code Here

    public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException {
        JSONObject jso = (JSONObject) o;
        String java_class = jso.getString("javaClass");
        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 = jso.getJSONObject("set");

        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 (UnmarshallException e) {
            throw new UnmarshallException("key " + i + e.getMessage());
        }
        return abset;
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.