Java 类org.jivesoftware.smack.util.collections.AbstractMapEntry 实例源码

项目:EIM    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:androidpn_enhanced_client    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:androidPN-client.    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:AndroidPNClient    文件:Cache.java   
public synchronized Set<Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Entry<K, V>>() {
        private final Set<Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:java-bells    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:telegraph    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:NewCommunication-Android    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:asmack-mini    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map.entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set.iterator();
                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(), entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException("Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:xmppsupport_v2    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map
                .entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set
                        .iterator();

                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(),
                            entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException(
                                    "Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}
项目:jamppa    文件:Cache.java   
public synchronized Set<Map.Entry<K, V>> entrySet() {
    // Warning -- this method returns CacheObject instances and not Objects
    // in the same form they were put into cache.

    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();

    return new AbstractSet<Map.Entry<K, V>>() {
        private final Set<Map.Entry<K, CacheObject<V>>> set = map
                .entrySet();

        public Iterator<Entry<K, V>> iterator() {
            return new Iterator<Entry<K, V>>() {
                private final Iterator<Entry<K, CacheObject<V>>> it = set
                        .iterator();

                public boolean hasNext() {
                    return it.hasNext();
                }

                public Entry<K, V> next() {
                    Map.Entry<K, CacheObject<V>> entry = it.next();
                    return new AbstractMapEntry<K, V>(entry.getKey(),
                            entry.getValue().object) {
                        @Override
                        public V setValue(V value) {
                            throw new UnsupportedOperationException(
                                    "Cannot set");
                        }
                    };
                }

                public void remove() {
                    it.remove();
                }
            };

        }

        public int size() {
            return set.size();
        }
    };
}