kaos.policy.information
Class KAoSProperty

java.lang.Object
  extended by kaos.policy.information.KAoSProperty
All Implemented Interfaces:
java.io.Serializable

public class KAoSProperty
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int _ALL_INST_PRESENT
           
static int _NO_INST_PRESENT
           
static int _PROPERTY_NOT_FOUND
           
static InstanceClassifierFactory myInstanceClassifierFactory
           
 
Constructor Summary
KAoSProperty(java.lang.String name)
           
KAoSProperty(java.lang.String name, InstanceClassifierFactory sf)
           
 
Method Summary
 void addInstance(java.lang.Object inst)
           
 void addInstanceDescription(java.lang.String instID, KAoSInstance desc)
           
 void addKAoSInstanceDescription(java.lang.String instID, KAoSInstanceDescription desc)
           
 void addMultipleInstances(java.util.Collection inst)
           
 void addSubpropertyNames(java.util.Collection propNames)
           
 int areDescriptionIDsInMyRange(java.util.Hashtable table)
          this method checks if the ids of KAoSInstances passed to it (the keys of the hashtable passed) are in range of the ids of this property's KAoSInstances.
 int areInstancesInRange(java.util.Set other)
           
 java.util.Enumeration getAllInstanceIDs()
           
 java.util.Set getAllInstances()
           
 java.util.Set getAllSubpropertyNames()
           
 java.lang.String getClassName()
           
 boolean getDataContext()
           
 KAoSInstance getInstanceDescription(java.lang.String instID)
          Use getKAoSInstanceDescription(String instID) instead.
 java.util.Hashtable getInstanceDescriptionsTable()
           
 KAoSInstanceDescription getKAoSInstanceDescription(java.lang.String instID)
          Get the addition ontology description for an instance, if one has been added to this property - otherwise null.
 java.lang.String getParentClassName()
           
 java.lang.String getPropertyName()
           
 java.lang.String getRestrictionType()
           
 boolean isComplement()
           
 boolean isInstancePresent(java.lang.Object inst)
           
 boolean isPropertyAMatch(KAoSProperty otherProp)
          This function is only to be used for comparing a property from two different *policies*.
 int isPropertyInRange(KAoSProperty otherProp)
           
 boolean isSchemaSet()
           
 boolean isSubpropertyPresent(java.lang.String propName)
           
 void removeAllInstanceDescriptions()
           
 void removeAllInstances()
           
 void removeInstance(java.lang.Object inst)
           
 void removeInstanceDescription(java.lang.String instID)
           
 void removeMultipleInstances(java.util.Collection inst)
           
 KAoSProperty returnCopy()
           
 void setClassName(java.lang.String name)
           
 void setComplement(boolean b)
           
 void setDataContext(boolean b)
           
 void setMultipleInstances(java.util.Collection inst)
           
 void setParentClassName(java.lang.String name)
           
 void setRestrictionType(java.lang.String type)
          To set and get the restriction type of this property, i.e.
 void setSchema(java.util.Vector objectDef)
           
 java.lang.String toString()
           
 void updateInstances(java.util.Collection inst)
          remove all the old instances and add the new ones
 void updateSubpropertyNames(java.lang.String mainProp, java.util.Collection propNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_PROPERTY_NOT_FOUND

public static final int _PROPERTY_NOT_FOUND
See Also:
Constant Field Values

_ALL_INST_PRESENT

public static final int _ALL_INST_PRESENT
See Also:
Constant Field Values

_NO_INST_PRESENT

public static final int _NO_INST_PRESENT
See Also:
Constant Field Values

myInstanceClassifierFactory

public static InstanceClassifierFactory myInstanceClassifierFactory
Constructor Detail

KAoSProperty

public KAoSProperty(java.lang.String name)

KAoSProperty

public KAoSProperty(java.lang.String name,
                    InstanceClassifierFactory sf)
Method Detail

getPropertyName

public java.lang.String getPropertyName()

setClassName

public void setClassName(java.lang.String name)

getClassName

public java.lang.String getClassName()

setParentClassName

public void setParentClassName(java.lang.String name)

getParentClassName

public java.lang.String getParentClassName()

setComplement

public void setComplement(boolean b)

isComplement

public boolean isComplement()

setDataContext

public void setDataContext(boolean b)

getDataContext

public boolean getDataContext()

isInstancePresent

public boolean isInstancePresent(java.lang.Object inst)

addInstance

public void addInstance(java.lang.Object inst)

addMultipleInstances

public void addMultipleInstances(java.util.Collection inst)

updateInstances

public void updateInstances(java.util.Collection inst)
remove all the old instances and add the new ones


addInstanceDescription

public void addInstanceDescription(java.lang.String instID,
                                   KAoSInstance desc)

addKAoSInstanceDescription

public void addKAoSInstanceDescription(java.lang.String instID,
                                       KAoSInstanceDescription desc)

setMultipleInstances

public void setMultipleInstances(java.util.Collection inst)

getAllInstances

public java.util.Set getAllInstances()

addSubpropertyNames

public void addSubpropertyNames(java.util.Collection propNames)

updateSubpropertyNames

public void updateSubpropertyNames(java.lang.String mainProp,
                                   java.util.Collection propNames)

getAllSubpropertyNames

public java.util.Set getAllSubpropertyNames()

isSubpropertyPresent

public boolean isSubpropertyPresent(java.lang.String propName)

getInstanceDescription

public KAoSInstance getInstanceDescription(java.lang.String instID)
Use getKAoSInstanceDescription(String instID) instead. Kept for backward compatibility, now descriptions can be XMLSchemaBuilder or KAoSInstance

Parameters:
instID -
Returns:
KAoSInstance description IF it is a KAoSInstance, otherwise null.

getKAoSInstanceDescription

public KAoSInstanceDescription getKAoSInstanceDescription(java.lang.String instID)
Get the addition ontology description for an instance, if one has been added to this property - otherwise null.

Parameters:
instID -
Returns:
KAoSInstanceDescription - currently could be KAoSInstance or XMLSchemaBuilderImpl

getAllInstanceIDs

public java.util.Enumeration getAllInstanceIDs()

removeInstance

public void removeInstance(java.lang.Object inst)

removeInstanceDescription

public void removeInstanceDescription(java.lang.String instID)

removeMultipleInstances

public void removeMultipleInstances(java.util.Collection inst)

removeAllInstances

public void removeAllInstances()

removeAllInstanceDescriptions

public void removeAllInstanceDescriptions()

setRestrictionType

public void setRestrictionType(java.lang.String type)
To set and get the restriction type of this property, i.e. is it a 'toClass' restriction or a 'hasClass' restriction etc.


getRestrictionType

public java.lang.String getRestrictionType()

isPropertyInRange

public int isPropertyInRange(KAoSProperty otherProp)

areInstancesInRange

public int areInstancesInRange(java.util.Set other)

areDescriptionIDsInMyRange

public int areDescriptionIDsInMyRange(java.util.Hashtable table)
this method checks if the ids of KAoSInstances passed to it (the keys of the hashtable passed) are in range of the ids of this property's KAoSInstances.

Parameters:
table - a Hashtable containing ids and KAoSInstances
Returns:
an int returning _ALL_INST_PRESENT if all are present, else the #ids present.

getInstanceDescriptionsTable

public java.util.Hashtable getInstanceDescriptionsTable()

isPropertyAMatch

public boolean isPropertyAMatch(KAoSProperty otherProp)
This function is only to be used for comparing a property from two different *policies*. Mustn't be used for comparing an action property with a policy property!!!


returnCopy

public KAoSProperty returnCopy()

setSchema

public void setSchema(java.util.Vector objectDef)

isSchemaSet

public boolean isSchemaSet()

toString

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