Example usage for java.util Observable toString

List of usage examples for java.util Observable toString

Introduction

In this page you can find the example usage for java.util Observable toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:ca.sfu.federation.model.Behavior.java

/**
 * On changes to the Context, take some action based on the user provided rules.
 * @param o Observable object./*from  www.ja v  a  2  s .  c  o m*/
 * @param arg Update message.
 */
public void update(Observable o, Object arg) {
    logger.log(Level.INFO, "Behavior update: on object {0}", o.toString());
    // filter the list using the user provided rules
    LinkedHashMap outputset = (LinkedHashMap) this.selection.update();
    if (outputset.size() > 0) {
        logger.log(Level.INFO, "Behavior {0} found targets: ", this.toString());
    }
    Iterator iter = outputset.values().iterator();
    StringBuilder sb = new StringBuilder();
    while (iter.hasNext()) {
        INamed named = (INamed) iter.next();
        sb.append(" ");
        sb.append(named.getName());
    }
    logger.log(Level.INFO, sb.toString());
    /*
    if (this.updateCondition != null && this.updateAction != null) {
    // determine the type of the update
    System out println("INFO: Behavior update: "+o.toString()+", "+arg.toString());
    // get the set of elements in the environment; remove bound assembly self from list
    LinkedHashMap inputset = (LinkedHashMap) this.context.getElementMap();
    // filter the list using the user provided rules
    LinkedHashMap outputset = (LinkedHashMap) this.selection.update();
    // take action based on the user rules
    if (outputset.size()>0) {
        // do something
    }
    }
     */
}