com.att.gs.codip.ograph.imp
Class OGResourceImp

java.lang.Object
  |
  +--com.att.gs.codip.resource.AbstractResource
        |
        +--com.att.gs.codip.ograph.imp.OGResourceImp
All Implemented Interfaces:
LogicalResource, OGResource
Direct Known Subclasses:
OGClassImp, OGDatatypeImp, OGLiteralImp, OGOntologyImp, OGPropertyImp

public class OGResourceImp
extends AbstractResource
implements OGResource


Field Summary
protected  java.util.ArrayList EMPTY_MAP
           
 
Fields inherited from class com.att.gs.codip.resource.AbstractResource
delineatedType, isSingleTyped
 
Constructor Summary
protected OGResourceImp()
           
protected OGResourceImp(OGOntology anOntology)
           
  OGResourceImp(java.lang.String theID, OGOntology anOntology)
           
 
Method Summary
 OGPropInstance addNewPropInstance(OGResource newPropType, OGResource theObject)
          Creates a property instantce and adds it to the resource.
 void addPropInstance(OGPropInstance thePropInstance)
          Adds the provided property instance to the resource.
 void addType(OGResource theType)
          Adds the given type to the list of multi-types.
 boolean containsPropInstance(java.lang.Object theID)
          Checks for the existence of a property in this resource whose ID matches the provided ID.
 boolean containsType(OGResource theType)
          Type checker for multi-types.
protected  void copyRDF(edu.unika.aifb.rdf.api.model.Resource theRDF)
           
 java.lang.String getComment()
          Getter method for this resource's comment string.
 java.lang.String getLabel()
          Getter method for this resource's label string.
 OGOntology getOntology()
          Getter method for this resource's Ontology.
 OGPropInstance getPropInstance(java.lang.Object theID)
          Looks for a property of this resource whose ID matches the provided ID.
 OGPropInstance[] getPropInstances()
          Accessor for the read only indexed bean property, "properties"
 java.util.Collection getPropInstances(OGResource aType)
          Provies a Collection for all of the resource's properties that are a particular type.
 boolean isType(OGResource theType)
           
 OGPropInstance lookupPropInstance(java.lang.Object theID)
          Looks for a matching property in this resource.
protected  void morphID(java.lang.String theURI)
           
 java.util.Iterator propInstances()
          Provides a iterator for the all of the resource's properties.
 java.util.Iterator propInstances(OGResource aType)
          Looks for a property of this resource that is a particular type.
 void removePropInstance(OGPropInstance thePropInstance)
          Removes the provided property instance from the resource.
 void removeType(OGResource theType)
          Removes the given type from the list of multi-types.
protected  void resourceInitialization(java.lang.String theID, OGOntology anOntology)
           
 void setComment(java.lang.String theComment)
          Setter method for this resource's comment string.
 void setLabel(java.lang.String theLabel)
          Setter method for this resource's label string.
 void setType(OGResource newType)
           
 java.lang.String toString()
           
 java.util.Iterator types()
          Provides an iterator over the list of multi-types.
 
Methods inherited from class com.att.gs.codip.resource.AbstractResource
equals, getID, getLocalName, getNamespace, getType, getURI, isLiteralType, isType, resourceInitialization, setID, setLocalName, setNamespace, setType, setURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.att.gs.codip.ograph.OGResource
getID, getLocalName, getNamespace, getURI
 
Methods inherited from interface com.att.gs.codip.resource.LogicalResource
getType, isLiteralType, isType, setType
 

Field Detail

EMPTY_MAP

protected final java.util.ArrayList EMPTY_MAP
Constructor Detail

OGResourceImp

protected OGResourceImp()

OGResourceImp

protected OGResourceImp(OGOntology anOntology)

OGResourceImp

public OGResourceImp(java.lang.String theID,
                     OGOntology anOntology)
Method Detail

resourceInitialization

protected void resourceInitialization(java.lang.String theID,
                                      OGOntology anOntology)

getOntology

public OGOntology getOntology()
Description copied from interface: OGResource
Getter method for this resource's Ontology. The Ontology is immutable and is set when the resource is created.

Specified by:
getOntology in interface OGResource

copyRDF

protected void copyRDF(edu.unika.aifb.rdf.api.model.Resource theRDF)

morphID

protected void morphID(java.lang.String theURI)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setLabel

public void setLabel(java.lang.String theLabel)
Description copied from interface: OGResource
Setter method for this resource's label string.

Specified by:
setLabel in interface OGResource
Parameters:
theLabel - The label of this resource.

getLabel

public java.lang.String getLabel()
Description copied from interface: OGResource
Getter method for this resource's label string.

Specified by:
getLabel in interface OGResource

setComment

public void setComment(java.lang.String theComment)
Description copied from interface: OGResource
Setter method for this resource's comment string.

Specified by:
setComment in interface OGResource
Parameters:
theComment - The comment for this resource.

getComment

public java.lang.String getComment()
Description copied from interface: OGResource
Getter method for this resource's comment string.

Specified by:
getComment in interface OGResource

setType

public void setType(OGResource newType)

containsType

public boolean containsType(OGResource theType)
Description copied from interface: OGResource
Type checker for multi-types.

Specified by:
containsType in interface OGResource

isType

public boolean isType(OGResource theType)

addType

public void addType(OGResource theType)
Description copied from interface: OGResource
Adds the given type to the list of multi-types.

Specified by:
addType in interface OGResource

removeType

public void removeType(OGResource theType)
Description copied from interface: OGResource
Removes the given type from the list of multi-types. Use with caution.

Specified by:
removeType in interface OGResource

types

public java.util.Iterator types()
Description copied from interface: OGResource
Provides an iterator over the list of multi-types.

Specified by:
types in interface OGResource

lookupPropInstance

public OGPropInstance lookupPropInstance(java.lang.Object theID)
Description copied from interface: OGResource
Looks for a matching property in this resource. Searches this resource for a property whose ID matches the provided ID.

Specified by:
lookupPropInstance in interface OGResource
Parameters:
theID - The ID of the sought property.
Returns:
The matching property if found, otherwise returns void.

addNewPropInstance

public OGPropInstance addNewPropInstance(OGResource newPropType,
                                         OGResource theObject)
Description copied from interface: OGResource
Creates a property instantce and adds it to the resource. THe property is of the provided type, it subject is this resource, and its object is the provided resource. *

Specified by:
addNewPropInstance in interface OGResource
Parameters:
newPropType - The type of the property instance.
theObject - The object of the property instance.
Returns:
The created property instance.

addPropInstance

public void addPropInstance(OGPropInstance thePropInstance)
Description copied from interface: OGResource
Adds the provided property instance to the resource. *

Specified by:
addPropInstance in interface OGResource

removePropInstance

public void removePropInstance(OGPropInstance thePropInstance)
Description copied from interface: OGResource
Removes the provided property instance from the resource.

Specified by:
removePropInstance in interface OGResource
Parameters:
thePropInstance - The property to remove from the resource.

getPropInstance

public OGPropInstance getPropInstance(java.lang.Object theID)
Description copied from interface: OGResource
Looks for a property of this resource whose ID matches the provided ID. Functionally indentical to lookupPropInstance.

Specified by:
getPropInstance in interface OGResource
Parameters:
theID - The ID of the sought property.
Returns:
The matching property if found, otherwise returns void.

getPropInstances

public OGPropInstance[] getPropInstances()
Description copied from interface: OGResource
Accessor for the read only indexed bean property, "properties"

Specified by:
getPropInstances in interface OGResource
Returns:
The properties of this resources as an array.

containsPropInstance

public boolean containsPropInstance(java.lang.Object theID)
Description copied from interface: OGResource
Checks for the existence of a property in this resource whose ID matches the provided ID.

Specified by:
containsPropInstance in interface OGResource
Parameters:
theID - The ID of the sought property.
Returns:
true if the property exists in this ontology.

propInstances

public java.util.Iterator propInstances()
Description copied from interface: OGResource
Provides a iterator for the all of the resource's properties.

Specified by:
propInstances in interface OGResource
Returns:
An iterator over all the resource's properties

propInstances

public java.util.Iterator propInstances(OGResource aType)
Description copied from interface: OGResource
Looks for a property of this resource that is a particular type.

Specified by:
propInstances in interface OGResource
Parameters:
aType - The type of the sought properties.
Returns:
An iterator over some the resource's properties.

getPropInstances

public java.util.Collection getPropInstances(OGResource aType)
Description copied from interface: OGResource
Provies a Collection for all of the resource's properties that are a particular type.

Specified by:
getPropInstances in interface OGResource
Parameters:
aType - The type of the sought properties.
Returns:
A collection of some of the resource's properties.


CODIP AT&T Government Solutions, Inc.