public class ObjectClass
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Integer> |
attributeIndex |
java.util.List<Attribute> |
attributeList |
java.util.Map<java.lang.String,Attribute> |
attributeMap |
Domain |
domain |
java.lang.String |
name |
Constructor and Description |
---|
ObjectClass(Domain domain,
java.lang.String name)
Initializes the attribute indexing data structures, connects this object class
to the specified domain, and automatically connects the domain to this object class.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Attribute att)
Adds an attribute to define this object class
|
int |
attributeIndex(java.lang.String attName)
Returns the internally stored index of the attribute with the given name.
|
ObjectClass |
copy(Domain newDomain)
Will create and return a new ObjectClass object with copies of this object class' attributes
|
Attribute |
getAttribute(java.lang.String name)
Returns the attribute with the given name
|
boolean |
hasAttribute(Attribute att)
Return whether this object class is defined by the given attribute
|
boolean |
hasAttribute(java.lang.String attName)
Return whether this object class is defined by the attribute with the given name
|
int |
numAttributes()
Returns the number of attributes that define this object class.
|
void |
setAttributes(java.util.List<Attribute> atts)
Sets the attributes used to define this object class
|
public java.lang.String name
public Domain domain
public java.util.Map<java.lang.String,java.lang.Integer> attributeIndex
public java.util.Map<java.lang.String,Attribute> attributeMap
public java.util.List<Attribute> attributeList
public ObjectClass(Domain domain, java.lang.String name)
domain
- the domain to which this object class belongsname
- the name identifier for this object classpublic ObjectClass copy(Domain newDomain)
newDomain
- the domain to which the new object class should be attachedpublic Attribute getAttribute(java.lang.String name)
name
- the name of the attribute to returnpublic void setAttributes(java.util.List<Attribute> atts)
atts
- the attributes to define this object classpublic void addAttribute(Attribute att)
att
- the attribute to addpublic boolean hasAttribute(Attribute att)
att
- the attribute to testpublic boolean hasAttribute(java.lang.String attName)
attName
- the name of the attribute to testpublic int attributeIndex(java.lang.String attName)
attName
- the name of the attribute for which to get the indexpublic int numAttributes()