ilog.views.prototypes
Class IlvSingleBehavior

java.lang.Object
  extended by ilog.views.prototypes.IlvBehavior
      extended by ilog.views.prototypes.IlvSingleBehavior
All Implemented Interfaces:
IlvPersistentObject, Serializable
Direct Known Subclasses:
IlvActionBehavior, IlvAnimationBehavior, IlvCompositeBehavior, IlvConditionBehavior, IlvConnectBehavior, IlvCounterBehavior, IlvDebugBehavior, IlvEventBehavior, IlvExportBehavior, IlvExpressionBehavior, IlvFillBehavior, IlvFormatBehavior, IlvGroupBehavior, IlvJavaBehavior, IlvMinMaxBehavior, IlvMultiRepBehavior, IlvOutputBehavior, IlvRotationBehavior, IlvScaleBehavior, IlvToggleBehavior, IlvTranslateBehavior, IlvTriggerBehavior, IlvValueBehavior

public abstract class IlvSingleBehavior
extends IlvBehavior

The class IlvSingleBehavior is an abstract class that provides a simple way of defining behavior objects which handle a single property.

Most of the predefined behavior classes supplied in the package ilog.views.prototypes derive from this class.

See Also:
IlvBehavior, IlvGroup, IlvGroup, Serialized Form

Constructor Summary
protected IlvSingleBehavior()
          Creates a new, unnamed IlvSingleBehavior object.
protected IlvSingleBehavior(IlvInputStream in)
          Reads the behavior from an IlvInputStream stream.
protected IlvSingleBehavior(IlvSingleBehavior source)
          Creates a new behavior object by copying an existing one.
protected IlvSingleBehavior(String name)
          Creates a new IlvSingleBehavior.
 
Method Summary
protected  Object get(IlvGroup group, String name)
          Called by get with the single value handled by this behavior object.
protected  void get(IlvGroup group, String[] names, Object[] values, boolean[] done)
          If the array names contains the name of this behavior object, the method calls get with this value.
 String getName()
          Returns the name of the property handled by this behavior object.
protected  String[] getValueNames(IlvGroup group)
          Returns an array containing a single string.
protected  void set(IlvGroup group, String[] names, Object[] values, boolean[] done)
          If the array names contains the name of this behavior object, the method calls set with this value.
protected  void set(IlvGroup group, String name, Object value)
          Called by set with the single value handled by this behavior object.
 void setName(String name)
          Sets the name of the property handled by this behavior object.
 void write(IlvOutputStream out)
          Writes the behavior to an IlvOutputStream.
 
Methods inherited from class ilog.views.prototypes.IlvBehavior
attach, copy, detach, getParameter, isOutput, isReadable, isWritable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvSingleBehavior

protected IlvSingleBehavior()
Creates a new, unnamed IlvSingleBehavior object.


IlvSingleBehavior

protected IlvSingleBehavior(String name)
Creates a new IlvSingleBehavior.

Parameters:
name - the name of the property handled by this behavior object.

IlvSingleBehavior

protected IlvSingleBehavior(IlvSingleBehavior source)
Creates a new behavior object by copying an existing one.

Parameters:
source - the behavior object to be copied.

IlvSingleBehavior

protected IlvSingleBehavior(IlvInputStream in)
                     throws IlvReadFileException
Reads the behavior from an IlvInputStream stream. This constructor must be called by the input constructors of subclasses.

Parameters:
in - The input stream.
Throws:
IlvReadFileException - if the stream format is not correct.
Method Detail

write

public void write(IlvOutputStream out)
           throws IOException
Writes the behavior to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvBehavior
Parameters:
out - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

getName

public final String getName()
Returns the name of the property handled by this behavior object.


setName

public void setName(String name)
Sets the name of the property handled by this behavior object. This method is typically used by prototype editors. To change the name of a property (that is, to rename all the behavior objects that handle this property), you can use the method renameValue of the class IlvGroup.

Overrides:
setName in class IlvBehavior
Parameters:
name - the new name of the property.
See Also:
IlvGroup.renameValue(java.lang.String, java.lang.String)

set

protected final void set(IlvGroup group,
                         String[] names,
                         Object[] values,
                         boolean[] done)
                  throws IlvValueException
If the array names contains the name of this behavior object, the method calls set with this value.

Specified by:
set in class IlvBehavior
Parameters:
group - the group to which this behavior is attached.
names - the names of the properties to be set.
values - the new values.
done - an array of boolean values.
Throws:
IlvValueException - if an error occurred while setting a property.
See Also:
set(ilog.views.prototypes.IlvGroup, java.lang.String, java.lang.Object)

get

protected final void get(IlvGroup group,
                         String[] names,
                         Object[] values,
                         boolean[] done)
                  throws IlvValueException
If the array names contains the name of this behavior object, the method calls get with this value.

Specified by:
get in class IlvBehavior
Parameters:
group - the group to which this behavior object is attached.
names - the names of the properties to be retrieved.
values - the array where the values read will be stored.
done - an array of boolean values.
Throws:
IlvValueException - if an error occurred while reading a property.
See Also:
get(ilog.views.prototypes.IlvGroup, java.lang.String)

getValueNames

protected String[] getValueNames(IlvGroup group)
                          throws IlvValueException
Returns an array containing a single string. This string represents the name of the property handled by this behavior object.

Specified by:
getValueNames in class IlvBehavior
Parameters:
group - the group to which this behavior object is attached.
Returns:
an array containing the names of the properties.
Throws:
IlvValueException - if a error occurred while reading a property.

set

protected void set(IlvGroup group,
                   String name,
                   Object value)
            throws IlvValueException
Called by set with the single value handled by this behavior object.

The default implementation does nothing.

Parameters:
group - the group to which this behavior is attached.
name - the name of the property to be set.
value - the new value.
Throws:
IlvValueException - if an error occurred while setting a property.
See Also:
set(ilog.views.prototypes.IlvGroup, java.lang.String[], java.lang.Object[], boolean[])

get

protected Object get(IlvGroup group,
                     String name)
              throws IlvValueException
Called by get with the single value handled by this behavior object.

The default implementation returns null.

Parameters:
group - the group to which this behavior object is attached.
name - the name of the property to be read.
Returns:
the value read.
Throws:
IlvValueException - if an error occurred while reading a property.
See Also:
get(ilog.views.prototypes.IlvGroup, java.lang.String[], java.lang.Object[], boolean[])


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.