ilog.views.maps.attribute
Class IlvStringAttribute

java.lang.Object
  extended by ilog.views.maps.IlvFeatureAttribute
      extended by ilog.views.maps.attribute.IlvStringAttribute
All Implemented Interfaces:
IlvPersistentObject

public class IlvStringAttribute
extends IlvFeatureAttribute

This feature attribute stores Strings.

Since:
ILOG JViews 3.0

Constructor Summary
IlvStringAttribute()
          Creates a string attribute.
IlvStringAttribute(IlvInputStream stream)
          Reads an IlvStringAttribute from an IlvInputStream.
IlvStringAttribute(IlvStringAttribute source)
          Creates a string attribute by copying an existing one.
IlvStringAttribute(String str)
          Creates a string attribute.
 
Method Summary
 IlvFeatureAttribute copy()
          Copies this object
 String getString()
          Returns the value of the attribute.
 void setChars(char[] chars)
          Sets an internal array of chars that will be used to compute the value of the string attribute.
 void setString(String string)
          Sets the string of the attribute.
static String StringValue(IlvAttributeProperty attributes, String name)
          Returns the String value of the IlvStringAttribute whose name is specified.
 String toString()
          Converts the attribute into a string.
 void write(IlvOutputStream stream)
          Writes this to an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvStringAttribute

public IlvStringAttribute()
Creates a string attribute.


IlvStringAttribute

public IlvStringAttribute(String str)
Creates a string attribute.


IlvStringAttribute

public IlvStringAttribute(IlvStringAttribute source)
Creates a string attribute by copying an existing one.

Parameters:
source - the object to be copied.

IlvStringAttribute

public IlvStringAttribute(IlvInputStream stream)
                   throws IlvReadFileException
Reads an IlvStringAttribute from an IlvInputStream.

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

write

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

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

setChars

public void setChars(char[] chars)
Sets an internal array of chars that will be used to compute the value of the string attribute. The array of chars is not copied. Thus, map readers can change the value of the chars each time they read a new feature and its string attributes. A null char '\0' marks the end of the string.

Parameters:
chars - the new array of chars.
See Also:
setString(java.lang.String)

setString

public void setString(String string)
Sets the string of the attribute. Internal string size is set to length of the string.

Parameters:
string - the string to be used.
See Also:
setChars(char[])

getString

public String getString()
Returns the value of the attribute.

Returns:
null if neither setString nor setChars was called.

toString

public String toString()
Converts the attribute into a string.

Overrides:
toString in class Object
Returns:
the string representation of this attribute.

copy

public IlvFeatureAttribute copy()
Copies this object

Specified by:
copy in class IlvFeatureAttribute
Returns:
a copy of the object.

StringValue

public static String StringValue(IlvAttributeProperty attributes,
                                 String name)
Returns the String value of the IlvStringAttribute whose name is specified.

Parameters:
attributes - The IlvAttributeProperty that stores the attributes.
name - The name of the attribute.
Returns:
The value of the IlvStringAttribute as a String, or null if the attribute is null.
Since:
JViews 5.5


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