Package java.util

Examples of java.util.AbstractMap$SimpleEntry


    Collection values = map.values();
    assertEquals("values() does not work",
        "value", values.iterator().next());
    assertEquals("keySet() does not work",
        "key", keys.iterator().next());
    AbstractMap map2 = (AbstractMap) map.clone();
    map2.put("key", "value2");
    Collection values2 = map2.values();
    assertTrue("values() is identical", values2 != values);
   
    // values() and keySet() on the cloned() map should be different
    assertEquals("values() was not cloned",
        "value2", values2.iterator().next());
    map2.clear();
    map2.put("key2", "value3");
    Set key2 = map2.keySet();
    assertTrue("keySet() is identical", key2 != keys);
    assertEquals("keySet() was not cloned",
        "key2", key2.iterator().next());
  }
View Full Code Here


        Set keys = map.keySet();
        Collection values = map.values();
        assertEquals("values() does not work", "value", values.iterator()
                .next());
        assertEquals("keySet() does not work", "key", keys.iterator().next());
        AbstractMap map2 = (AbstractMap) map.clone();
        map2.put("key", "value2");
        Collection values2 = map2.values();
        assertTrue("values() is identical", values2 != values);
        // values() and keySet() on the cloned() map should be different
        assertEquals("values() was not cloned", "value2", values2.iterator()
                .next());
        map2.clear();
        map2.put("key2", "value3");
        Set key2 = map2.keySet();
        assertTrue("keySet() is identical", key2 != keys);
        assertEquals("keySet() was not cloned", "key2", key2.iterator().next());
    }
View Full Code Here

    Collection values = map.values();
    assertEquals("values() does not work",
        "value", values.iterator().next());
    assertEquals("keySet() does not work",
        "key", keys.iterator().next());
    AbstractMap map2 = (AbstractMap) map.clone();
    map2.put("key", "value2");
    Collection values2 = map2.values();
    assertTrue("values() is identical", values2 != values);
    // values() and keySet() on the cloned() map should be different
    assertEquals("values() was not cloned",
        "value2", values2.iterator().next());
    map2.clear();
    map2.put("key2", "value3");
    Set key2 = map2.keySet();
    assertTrue("keySet() is identical", key2 != keys);
    assertEquals("keySet() was not cloned",
        "key2", key2.iterator().next());
       
        // regresion test for HARMONY-4603
View Full Code Here

    Collection values = map.values();
    assertEquals("values() does not work",
        "value", values.iterator().next());
    assertEquals("keySet() does not work",
        "key", keys.iterator().next());
    AbstractMap map2 = (AbstractMap) map.clone();
    map2.put("key", "value2");
    Collection values2 = map2.values();
    assertTrue("values() is identical", values2 != values);
    // values() and keySet() on the cloned() map should be different
    assertEquals("values() was not cloned",
        "value2", values2.iterator().next());
    map2.clear();
    map2.put("key2", "value3");
    Set key2 = map2.keySet();
    assertTrue("keySet() is identical", key2 != keys);
    assertEquals("keySet() was not cloned",
        "key2", key2.iterator().next());
  }
View Full Code Here

     * Creates a wrapper around the web application context so that it can be
     * accessed easily from inside JSP EL (or other expression languages in
     * other view technologies).
     */
    protected Map createApplicationContextWrapper(final WebApplicationContext context) {
        Map wrapper = new AbstractMap() {

            public WebApplicationContext getContext() {
                return context;
            }

View Full Code Here

     * accessed easily from inside JSP EL (or other expression languages in
     * other view technologies).
     */
    protected Map createRequestContextWrapper(final ServletRequest request) {
        final WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
        Map wrapper = new AbstractMap() {

            public WebApplicationContext getContext() {
                return context;
            }

View Full Code Here

   
    @Override
    public synchronized void stop() throws LifecycleException
    {
        if ( !this.started ) return;
        AbstractMap map = (AbstractMap)((ReplApplContext)this.context).getAttributeMap();
        if ( map!=null && map instanceof ReplicatedMap) {
            ((ReplicatedMap)map).breakdown();
        }
        try {
            super.lifecycle.removeLifecycleListener(this);
View Full Code Here

    Collection values = map.values();
    assertEquals("values() does not work",
        "value", values.iterator().next());
    assertEquals("keySet() does not work",
        "key", keys.iterator().next());
    AbstractMap map2 = (AbstractMap) map.clone();
    map2.put("key", "value2");
    Collection values2 = map2.values();
    assertTrue("values() is identical", values2 != values);
    // values() and keySet() on the cloned() map should be different
    assertEquals("values() was not cloned",
        "value2", values2.iterator().next());
    map2.clear();
    map2.put("key2", "value3");
    Set key2 = map2.keySet();
    assertTrue("keySet() is identical", key2 != keys);
    assertEquals("keySet() was not cloned",
        "key2", key2.iterator().next());
       
        // regresion test for HARMONY-4603
View Full Code Here

   }
  
   @Override
   public Object getWrappedData()
   {
      return new AbstractMap()
      {
         @Override
         public Set entrySet()
         {
            return new AbstractSet()
View Full Code Here

   * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
   */
  public void setWrappedData(Object data) {
    this.wrappedData = data;
    if (data instanceof NamedNodeMap) {
      this.map = new AbstractMap() {

        private Set entrySet = new AbstractSet() {

          public Iterator iterator() {
            return new Iterator() {
View Full Code Here

TOP

Related Classes of java.util.AbstractMap$SimpleEntry

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.