Changeset 186:1c1760bb7c1a in livinglogic.java.ul4

Show
Ignore:
Timestamp:
01/09/09 15:45:34 (10 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Implement dispatching for contains method.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/src/com/livinglogic/ul4/Utils.java

    r184 r186  
    591591    public static boolean contains(Object obj, Object container) 
    592592    { 
     593        if (container instanceof String) 
     594            return contains(obj, (String)container); 
     595        else if (container instanceof Collection) 
     596            return contains(obj, (Collection)container); 
     597        else if (container instanceof Map) 
     598            return contains(obj, (Map)container); 
    593599        throw new RuntimeException("Can't determine presence for instance of " + obj.getClass() + " in container instance of class " + container.getClass() + "!"); 
    594600    }