//
// $Id$

package com.threerings.gwt.util;

import com.google.common.base.Function;

/**
 * A collection of general purpose functions.
 */
public class Functions
{
    /** Implements boolean not. */
    public static Function<Boolean, Boolean> NOT = new Function<Boolean, Boolean>() {
        public Boolean apply (Boolean value) {
            return !value;
        }
    };
}

@@ -39,16 +39,39 @@
 .util;%0A%0A
+import java.util.Map;%0A%0A
 import c
@@ -393,11 +393,296 @@
 %7D%0A    %7D;
+%0A%0A    /** Views the supplied map as a function from keys to values. */%0A    public static %3CK, V%3E Function%3CK, V%3E fromMap (final Map%3CK, V%3E map) %7B%0A        return new Function%3CK, V%3E() %7B%0A            public V apply (K key) %7B%0A                return map.get(key);%0A            %7D%0A        %7D;%0A    %7D
 %0A%7D%0A

Allow a map to be viewed as a (K => V).