ilog.views.maps
Class IlvAttributeInfoProperty

java.lang.Object
  extended by ilog.views.IlvNamedProperty
      extended by ilog.views.maps.IlvAttributeInfoProperty
All Implemented Interfaces:
IlvPersistentObject, Serializable

public class IlvAttributeInfoProperty
extends IlvNamedProperty

This class is used to store the names and types of map attributes. It is generally used with an IlvAttributeProperty.

See Also:
IlvAttributeProperty, Serialized Form

Field Summary
static String NAME
          The name of the property
 
Constructor Summary
IlvAttributeInfoProperty(IlvAttributeInfoProperty source)
          Creates a new IlvAttributeInfoProperty by copying an existing one.
IlvAttributeInfoProperty(IlvInputStream stream)
          Creates a new IlvAttributeInfoProperty from an IlvInputStream.
IlvAttributeInfoProperty(String[] attributeNames, Class[] attributeClasses, boolean[] nullable)
          Creates a new IlvAttributeInfoProperty with the specified attribute names and classes.
 
Method Summary
 IlvNamedProperty copy()
          Copies the property.
 Class getAttributeClass(int i)
          Returns the class of the attribute specified by the index i.
 int getAttributeIndex(String name)
          Returns the index of the first attribute with the specified name.
 String getAttributeName(int i)
          Returns the name of the attribute specified by the index i.
 Enumeration getAttributesClasses()
          Returns the classes of the attributes.
 int getAttributesCount()
          Returns the count of attributes.
 Enumeration getAttributesNames()
          Returns the names of the attributes.
 boolean isNullable(int i)
          Returns true if the attribute specified by the index i can have a null value.
 boolean isPersistent()
          Returns true if the property must be saved to an IVL file.
 void setPersistent(boolean persistent)
          Specifies whether the property must be saved to an IVL file.
 void write(IlvOutputStream stream)
          Writes the property to an IlvOutputStream.
 
Methods inherited from class ilog.views.IlvNamedProperty
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
The name of the property

See Also:
Constant Field Values
Constructor Detail

IlvAttributeInfoProperty

public IlvAttributeInfoProperty(String[] attributeNames,
                                Class[] attributeClasses,
                                boolean[] nullable)
Creates a new IlvAttributeInfoProperty with the specified attribute names and classes.
To ensure that the attributes are saved and read correctly, the classes of the attributes must either:

Parameters:
attributeNames - The names of the attributes
attributeClasses - The classes of the attributes.
nullable - A boolean array that takes the true value for the attributes that can have a null value (these attributes are optional).
Throws:
IllegalArgumentException - if the arrays of names, classes, and nullable values have different lengths.
See Also:
IlvPersistentObject

IlvAttributeInfoProperty

public IlvAttributeInfoProperty(IlvAttributeInfoProperty source)
Creates a new IlvAttributeInfoProperty by copying an existing one.

Parameters:
source - The named property to be copied.

IlvAttributeInfoProperty

public IlvAttributeInfoProperty(IlvInputStream stream)
                         throws IlvReadFileException
Creates a new IlvAttributeInfoProperty from an IlvInputStream.

Parameters:
stream - the input stream
Throws:
IlvReadFileException - if an error occurs while reading.
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the property to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvNamedProperty
Parameters:
stream - the output stream.
Throws:
IOException - standard IO error.

copy

public IlvNamedProperty copy()
Copies the property.

Specified by:
copy in class IlvNamedProperty

setPersistent

public void setPersistent(boolean persistent)
Specifies whether the property must be saved to an IVL file. By default, the property is persistent.

Parameters:
persistent - True if the property must be saved to an IVL file, false otherwise.

isPersistent

public boolean isPersistent()
Returns true if the property must be saved to an IVL file.

Specified by:
isPersistent in class IlvNamedProperty

getAttributesNames

public Enumeration getAttributesNames()
Returns the names of the attributes.

Returns:
The elements of the enumeration are instances of java.lang.String.

getAttributeName

public String getAttributeName(int i)
Returns the name of the attribute specified by the index i.

Parameters:
i - The index of the attribute.

getAttributesClasses

public Enumeration getAttributesClasses()
Returns the classes of the attributes.

Returns:
The elements of the enumeration are instances of java.lang.Class

getAttributeClass

public Class getAttributeClass(int i)
Returns the class of the attribute specified by the index i.

Parameters:
i - The index of the attribute

isNullable

public boolean isNullable(int i)
Returns true if the attribute specified by the index i can have a null value.

Parameters:
i - The index of the attribute.

getAttributesCount

public int getAttributesCount()
Returns the count of attributes.


getAttributeIndex

public int getAttributeIndex(String name)
Returns the index of the first attribute with the specified name.

Parameters:
name - The name of the attribute.
Returns:
The index of the first attribute with the name.
Throws:
IllegalArgumentException - If the name does not correspond to an existing attribute name.
Since:
JViews 5.5


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