예제 #1
0
     * Returns a hashcode for this association.
     * The hashcode of an this association
     * is just the hashcode of the key.
     *
     * @return integer A hashcode for this association.
     */
    public function getHashCode()
    {
        return $this->key->getHashCode();
    }
    //}>d
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("Association main program.\n");
        $status = 0;
        $a1 = new Association(box(1), NULL);
        printf("%s\n", str($a1));
        $a2 = new Association(box(2), box(4));
        printf("%s\n", str($a2));
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(Association::main(array_slice($argv, 1)));
}