org.eclipse.higgins.idas.impl
Class BasicAttribute

Package class diagram package BasicAttribute
java.lang.Object
  extended by org.eclipse.higgins.idas.impl.BasicAttribute
All Implemented Interfaces:
IAttribute, IHasMetadata, IProperty

public class BasicAttribute
extends Object
implements IAttribute

Implements IAttribute using BasicProperty and BasicMetadata


Constructor Summary
BasicAttribute(URI type)
           
BasicAttribute(URI type, IPropertyValue value)
           
BasicAttribute(URI type, IPropertyValue value, HashSet<IMetadata> metadataSet)
           
BasicAttribute(URI type, Iterable<IPropertyValue> values)
           
BasicAttribute(URI type, Vector<IPropertyValue> values)
           
BasicAttribute(URI type, Vector<IPropertyValue> values, HashSet<IMetadata> metadataSet)
           
 
Method Summary
 void addMetadata(IMetadata metadata)
           
 IMetadata createMetadata(URI type, IPropertyValue value)
          Creates a metadata item which can be added to metadata held by this Object.
 Iterable<IMetadata> getMetadataSet()
          Returns this Object's metadata elements as an Iterable.
 URI getType()
          Returns the type of this property as a URI.
 IPropertyValue getValue()
          Returns a single value for this iProperty.
 Iterable<IPropertyValue> getValues()
          Returns all values for this iProperty.
 void removeMetadata(IMetadata metadata)
           
 void setValue(IPropertyValue value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAttribute

public BasicAttribute(URI type)

BasicAttribute

public BasicAttribute(URI type,
                      IPropertyValue value)

BasicAttribute

public BasicAttribute(URI type,
                      Vector<IPropertyValue> values)

BasicAttribute

public BasicAttribute(URI type,
                      Iterable<IPropertyValue> values)

BasicAttribute

public BasicAttribute(URI type,
                      IPropertyValue value,
                      HashSet<IMetadata> metadataSet)

BasicAttribute

public BasicAttribute(URI type,
                      Vector<IPropertyValue> values,
                      HashSet<IMetadata> metadataSet)
Method Detail

getType

public URI getType()
            throws IdASException
Description copied from interface: IProperty
Returns the type of this property as a URI.

From this URI, a consumer should be able to derive some kind of human-readable name (such as "age", "title", "employeeNumber", etc.).

A consumer may also be able to determine from this URI, the type or range of types of object(s) returned from IProperty.getValue() and IProperty.getValues().

These determinations may be made either by examining parts of the URI itself, or dereferencing it (or parts) to other sources of information.

Specified by:
getType in interface IProperty
Throws:
IdASException
See Also:
IProperty.getType()

getValue

public IPropertyValue getValue()
                        throws IdASException
Description copied from interface: IProperty
Returns a single value for this iProperty. In the case where this property has multiple values, the particular value returned is indeterminate.

Specified by:
getValue in interface IProperty
Throws:
IdASException
See Also:
IProperty.getValue()

getValues

public Iterable<IPropertyValue> getValues()
                                   throws IdASException
Description copied from interface: IProperty
Returns all values for this iProperty.

Specified by:
getValues in interface IProperty
Throws:
IdASException
See Also:
IProperty.getValues()

setValue

public void setValue(IPropertyValue value)
              throws IdASException
Specified by:
setValue in interface IProperty
Throws:
IdASException
See Also:
IProperty.setValue(IPropertyValue)

createMetadata

public IMetadata createMetadata(URI type,
                                IPropertyValue value)
                         throws IdASException
Description copied from interface: IHasMetadata
Creates a metadata item which can be added to metadata held by this Object.

Specified by:
createMetadata in interface IHasMetadata
Parameters:
type - The type of metadata. This defines the datatype of the value.
value - The value of this metadata. The type of this is determined by the type arg.
Returns:
The created metadata item.
Throws:
IdASException - TODO: Specify whether this also adds the produced IMetadata to this Object, or if addItem must subsequently be called.

TODO: If this method also adds, note that updates to the returned IMetadata affect the added item (i.e. a reference, not a copy is stored).

See Also:
IHasMetadata.createMetadata(URI, IPropertyValue)

addMetadata

public void addMetadata(IMetadata metadata)
                 throws IdASException
Specified by:
addMetadata in interface IHasMetadata
Throws:
IdASException
See Also:
IHasMetadata.addMetadata(IMetadata)

removeMetadata

public void removeMetadata(IMetadata metadata)
                    throws IdASException
Specified by:
removeMetadata in interface IHasMetadata
Throws:
IdASException
See Also:
IHasMetadata.removeMetadata(IMetadata)

getMetadataSet

public Iterable<IMetadata> getMetadataSet()
                                   throws IdASException
Description copied from interface: IHasMetadata
Returns this Object's metadata elements as an Iterable. TODO: Consider overloading to take a metadata type (gets all metadata of that type)

Specified by:
getMetadataSet in interface IHasMetadata
Throws:
IdASException
See Also:
IHasMetadata.getMetadataSet()


Copyright © 2006 Novell Inc. All Rights Reserved.
This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Contributors:
  Jim Sermersheim (Novell, Inc.) - initial API and implementation