Package com.uwyn.jhighlight.pcj.map

Examples of com.uwyn.jhighlight.pcj.map.CharKeyMapIterator


    protected AbstractCharKeyMap()
  { }
 
    public void clear()
  {
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            i.remove();
        }
    }
View Full Code Here


        }
    }
 
    public Object remove(char key)
  {
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            if (i.getKey()==key)
      {
                Object value = i.getValue();
                i.remove();
                return value;
            }
        }
        return null;
    }
View Full Code Here

        return null;
    }
 
    public void putAll(CharKeyMap map)
  {
        CharKeyMapIterator i = map.entries();
        while (i.hasNext())
    {
            i.next();
            put(i.getKey(), i.getValue());
        }
    }
View Full Code Here

        }
    }
 
    public boolean containsKey(char key)
  {
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            if (i.getKey()==key)
                return true;
        }
        return false;
    }
View Full Code Here

        return false;
    }
 
    public Object get(char key)
  {
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            if (i.getKey()==key)
                return i.getValue();
        }
        return null;
    }
View Full Code Here

        return null;
    }
 
    public boolean containsValue(Object value)
  {
        CharKeyMapIterator i = entries();
        if (value==null)
    {
            while (i.hasNext())
      {
                i.next();
                if (value==null)
                    return true;
            }
        }
    else
    {
            while (i.hasNext())
      {
                i.next();
                if (value.equals(i.getValue()))
                    return true;
            }
        }
        return false;
    }
View Full Code Here

        if (!(obj instanceof CharKeyMap))
            return false;
        CharKeyMap map = (CharKeyMap)obj;
        if (size()!=map.size())
            return false;
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            char k = i.getKey();
            Object v = i.getValue();
            if (v==null)
      {
                if (map.get(k)!=null)
                    return false;
                if (!map.containsKey(k))
View Full Code Here

    }
 
    public int hashCode()
  {
        int h = 0;
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            h += (DefaultCharHashFunction.INSTANCE.hash(i.getKey())^i.getValue().hashCode());
        }
        return h;
    }
View Full Code Here

    { return size()==0; }
 
    public int size()
  {
        int size = 0;
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            i.next();
            size++;
        }
        return size;
    }
View Full Code Here

     */
    public String toString()
  {
        StringBuffer s = new StringBuffer();
        s.append('[');
        CharKeyMapIterator i = entries();
        while (i.hasNext())
    {
            if (s.length()>1)
                s.append(',');
            i.next();
            s.append(String.valueOf(i.getKey()));
            s.append("->");
            s.append(String.valueOf(i.getValue()));
        }
        s.append(']');
        return s.toString();
    }
View Full Code Here

TOP

Related Classes of com.uwyn.jhighlight.pcj.map.CharKeyMapIterator

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.