Logo
Distributed Genetic Programming Framework
print print

File org.dgpf.search.control.protocol.PropertyUpdateEvent.java

Here you can find all the information about the file org.dgpf.search.control.protocol.PropertyUpdateEvent.java. You may explore it here or download it onto your local disk.
/*
 * Copyright (c) 2006 Mirko Dietrich
 * 
 * E-Mail           : mirkodietrich@hrz.uni-kassel.de
 * Creation Date    : Aug 6, 2006 1:33:24 PM
 * Original Filename: org.dgpf.search.control.protocol.PropertyUpdateEvent.java
 * Version          : 1.0
 * Last modification: Aug 6, 2006
 * Last modified by : Mirko Dietrich
 * 
 * License          : GNU LESSER GENERAL PUBLIC LICENSE
 *                    Version 2.1, February 1999
 *                    You should have received a copy of this license along
 *                    with this library; if not, write to the Free Software
 *                    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *                    MA 02111-1307, USA or download the license under
 *                    http://www.gnu.org/copyleft/lesser.html.
 *                    
 * Warranty         : This software is provided "as is" without any
 *                    warranty; without even the implied warranty of
 *                    merchantability or fitness for a particular purpose.
 *                    See the Gnu Lesser General Public License for more
 *                    details.
 */


package org.dgpf.search.control.protocol;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.dgpf.gui.Client;
import org.sfc.events.SfcEvent;
import org.sfc.meta.Property;
import org.sfc.utils.Typesafe;

/**
 * This <code>Event</code> encapsulates a <code>Property</code> with
 * the belonging value.
 * 
 * @author Mirko Dietrich
 */

public class PropertyUpdateEvent extends SfcEvent
  {
  /**
   * The serial version UID
   */

  private static final long  serialVersionUID = 1L;

  /**
   * The <code>Property</code> to send.
   */

  private transient Property m_property;

  /**
   * The <code>Property</code>'s value.
   */

  private transient Object   m_value;

  /**
   * The array's size. If the <code>Property</code> isn't an array
   * <code>m_size</code> is <code>-1</code>.
   */

  private transient int      m_size;

  /**
   * Default constructor.
   * 
   * @param p_source
   *          The source of the event.
   * @param p_property
   *          is the <code>Property</code> to send.
   * @param p_value
   *          is the <code>Property</code>'s value.
   */

  public PropertyUpdateEvent(Client p_source, Property p_property,
      Object p_value)
    {
    super(p_source);
    this.m_property = p_property;
    // TODO here the array's size should be transmitted. if it's not an
    // array -1.
    this.m_size = -1;
    this.m_value = p_value;
    }

  /**
   * Stores the <code>SfcEvent</code> into the stream.
   * 
   * @param p_s
   *          The output stream.
   * @throws IOException
   *           If something io-like went wrong.
   */

  private final synchronized void writeObject(final ObjectOutputStream p_s)
      throws IOException
    {
    p_s.defaultWriteObject();
    p_s.writeInt(this.m_size);
    p_s.writeUnshared(this.m_property);
    p_s.writeUnshared(this.m_value);
    }

  /**
   * Reconstitute the <code>SfcEvent</code> instance from a stream (that
   * is, deserialize it).
   * 
   * @param p_s
   *          The input stream.
   * @throws IOException
   *           If something io-like went wrong.
   * @throws ClassNotFoundException
   *           If a needed class could not be found.
   */

  private final void readObject(final ObjectInputStream p_s)
      throws IOException, ClassNotFoundException
    {
    p_s.defaultReadObject();
    this.m_size = p_s.readInt();
    this.m_property = Typesafe.cast(p_s.readUnshared());
    this.m_value = Typesafe.cast(p_s.readUnshared());
    }

  /**
   * @return Returns the jar file data.
   */

  public final Property<?> getProperty()
    {
    return this.m_property;
    }

  /**
   * @return Returns the filename.
   */

  public final Object getValue()
    {
    return this.m_value;
    }

  /**
   * @return Returns the array's size. If the <code>Property</code> isn't
   *         an array <code>m_size</code> is <code>-1</code>.
   */

  public final int getSize()
    {
    return this.m_size;
    }

  }

File Information:

file name:PropertyUpdateEvent.java
package:org.dgpf.search.control.protocol
qualified name:org.dgpf.search.control.protocol.PropertyUpdateEvent.java
file type:Java Source File
download location:download http://dgpf.sourceforge.net/source/org/dgpf/search/control/protocol/PropertyUpdateEvent.java
size:4.013 KB (4110 B)
uploaded: 2015-07-22 04:11:00 GMT+0000
last update: 2006-09-24 23:47:04 GMT+0000
last access: 2017-11-23 05:34:11 GMT+0000

statistics online since 2006-01-02.   RSS Feed
Contact us by sending an email to tweise@gmx.de to receive further information, to report errors, or to join our project.
All content on this site (http://dgpf.sourceforge.net/) is LGPL-licensed.
http://dgpf.sourceforge.net/scripts/source/source.php last modified at 2015-07-22 04:10:53 GMT+0000 served at 2017-11-23 05:34:11 GMT+0000.
Valid CSS Valid XHTML 1.1
Valid RSS SourceForge.net Logo