fr.gouv.culture.sdx.utils.database
Class Property

java.lang.Object
  extended byfr.gouv.culture.sdx.utils.SdxObjectImpl
      extended byfr.gouv.culture.sdx.utils.database.Property
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, SdxObject
Direct Known Subclasses:
IndexableFieldProperty, LuceneDataField

public class Property
extends SdxObjectImpl

An entity's property in SDX simple database abstraction.

An SDX simplified database can contain entities. These entities contain properties, which are name=value pairs, all strings. This class represents a property.

A property can have multiple values, but in an entity all properties have different names.


Field Summary
protected  java.lang.String firstValue
           
protected  java.lang.String name
          Property's name.
protected  java.util.ArrayList values
          Property's values.
 
Fields inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl
encoding, logger
 
Constructor Summary
Property()
          Builds a property object The logger should be set after building this object.
Property(java.lang.String name, java.lang.String value)
          Builds a property from a name=value pair.
 
Method Summary
 void addValue(java.lang.String value)
           
protected  void attemptToSetFirstValue(java.lang.String value)
           
 boolean containsValue(java.lang.String value)
           
 void deleteValue(java.lang.String value)
          Deletes the value from the list
 java.lang.String getName()
          Returns the property's name.
 java.lang.String getValue()
          Returns the first value.
 java.lang.String[] getValues()
          Returns the values as an array.
protected  void resetValues()
           
 void setName(java.lang.String name)
          Sets the property's name.
 void setValues(java.lang.String[] values)
          Sets the values from an array.
 
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl
enableLogging, getChildLogger, setEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Property's name.


values

protected java.util.ArrayList values
Property's values.


firstValue

protected java.lang.String firstValue
Constructor Detail

Property

public Property()
Builds a property object The logger should be set after building this object. Then there are methods to set the name of this property and its values.

See Also:
SdxObjectImpl.enableLogging(org.apache.avalon.framework.logger.Logger), setName(java.lang.String), setValues(java.lang.String[])

Property

public Property(java.lang.String name,
                java.lang.String value)
Builds a property from a name=value pair. The logger should be set after building this object.

Parameters:
name - The name for the property
value - Its value
See Also:
SdxObjectImpl.enableLogging(org.apache.avalon.framework.logger.Logger)
Method Detail

setName

public void setName(java.lang.String name)
Sets the property's name.

Parameters:
name - The property's name.

setValues

public void setValues(java.lang.String[] values)
Sets the values from an array.

Parameters:
values - The array containing the values.

getName

public java.lang.String getName()
Returns the property's name.


getValues

public java.lang.String[] getValues()
Returns the values as an array.


getValue

public java.lang.String getValue()
Returns the first value.


deleteValue

public void deleteValue(java.lang.String value)
Deletes the value from the list

Parameters:
value - The value to delete

addValue

public void addValue(java.lang.String value)

attemptToSetFirstValue

protected void attemptToSetFirstValue(java.lang.String value)

resetValues

protected void resetValues()

containsValue

public boolean containsValue(java.lang.String value)


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.