|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.swfm.mica.core.MiGeneralAttributes
This class allocates and maintains an arbitrary group of attribute values. The values can be either object-valued, integer-valued, double-valued, or boolean-valued. Each attribute can also be specified as being inherited.
Instances of this class can be immutable (the default) which means modifications wil return a new instance, leaving the original unchanged.
Instances of this class are cached (see MiAttributeCache) to reduce memory requirements.
| Constructor Summary | |
MiGeneralAttributes(boolean immutable,
int numberOfAttributes,
int startObjIndex,
int numObjAttributes,
int startIntIndex,
int numIntAttributes,
int startDblIndex,
int numDblAttributes,
int startBoolIndex,
int numBoolAttributes)
Constructs a new MiGeneralAttributes. |
|
MiGeneralAttributes(int numberOfAttributes,
int startObjIndex,
int numObjAttributes,
int startIntIndex,
int numIntAttributes,
int startDblIndex,
int numDblAttributes,
int startBoolIndex,
int numBoolAttributes)
Constructs a new MiGeneralAttributes. |
|
| Method Summary | |
abstract java.lang.String |
cacheToString()
For debugging, return the number and a description of all of the attributes created so far. |
java.lang.String |
dump()
For debug. |
boolean |
equals(java.lang.Object obj)
Gets whether this MiGeneralAttributes and the given MiGeneralAttributes are equal. |
java.lang.Object |
getAttribute(int which)
Gets the value of the object-valued attribute. |
java.lang.String |
getAttributeValue(java.lang.String name)
Gets the value of the attribute with the given name as a text string. |
java.lang.Object |
getAttributeValueAsObject(int index)
Gets the value of the attribute with the given name as an object. |
boolean |
getBooleanAttribute(int which)
Gets the value of the boolean-valued attribute. |
double |
getDoubleAttribute(int which)
Gets the value of the double-valued attribute. |
int |
getIndexOfAttribute(java.lang.String name)
Gets the index of the attribute with the given name. |
int |
getIntegerAttribute(int which)
Gets the value of the integer-valued attribute. |
MiGeneralAttributes |
getModifiedAttributes(int which,
boolean value)
Sets the value of the attribute with the given index to the given value. |
MiGeneralAttributes |
getModifiedAttributes(int which,
double value)
Sets the value of the attribute with the given index to the given value. |
MiGeneralAttributes |
getModifiedAttributes(int which,
int value)
Sets the value of the attribute with the given index to the given value. |
MiGeneralAttributes |
getModifiedAttributes(int which,
java.lang.Object object)
Sets the value of the attribute with the given index to the given value. |
MiGeneralAttributes |
getModifiedAttributes(java.lang.String name,
java.lang.String value)
Sets the value of the attribute with the given index to the given value. |
abstract java.lang.String |
getNameOfAttribute(int index)
Gets the name of the attribute specified by the given index. |
int |
getNumberOfAttributes()
Gets the number of attributes values |
int |
getNumUsing()
|
boolean |
hasAttribute(java.lang.String name)
Gets whether an attribute with the given name exists. |
int |
hashCode()
Gets the hopefully unique value identifying this MiGeneralAttributes based on the values of the attributes. |
MiGeneralAttributes |
inheritFrom(MiGeneralAttributes from)
Sets the values of any inherited attributes in this MiGeneralAttributes from the non-inherited attributes in the given MiGeneralAttributes . |
MiGeneralAttributes |
inheritFromAll(MiGeneralAttributes from)
Sets the values of all inherited attributes from the given attributes. |
void |
initializeAsInheritedAttributes()
Sets all attributes to be inherited. |
MiGeneralAttributes |
initializeAsOverrideAttributes(boolean flag)
Sets all attributes to be 'not inherited'. |
boolean |
isImmutable()
Gets whether this MiGeneralAttributes can be changed. |
boolean |
isInheritedAttribute(int which)
Gets whether the value of the attribute with the given index is to be inherited. |
java.lang.Object |
makeCopy()
Makes and returns a copy of this class. |
MiGeneralAttributes |
overrideFrom(MiGeneralAttributes from)
Sets the values of all attributes in this MiGeneralAttributes for which the corresponding attribute in the given MiGeneralAttributes is not inherited. |
MiGeneralAttributes |
overrideFromPermanent(MiGeneralAttributes from)
Sets the values of all attributes in this MiGeneralAttributes for which the corresponding attribute in the given MiGeneralAttributes is not inherited AND the for which the corresponding attribute in this MiGeneralAttributes IS inherited. |
MiGeneralAttributes |
overrideFromPermanent2(MiGeneralAttributes from)
Sets the values of all attributes in this MiGeneralAttributes for which the corresponding attribute in the given MiGeneralAttributes is not inherited. |
void |
setIsImmutable(boolean flag)
Sets whether this MiGeneralAttributes can be changed. |
MiGeneralAttributes |
setIsInheritedAttribute(int which,
boolean flag)
Sets whether the value of the attribute with the given index is to be inherited. |
void |
setStaticAttribute(int which,
boolean value)
Sets the value of the attribute with the given index to the given value. |
void |
setStaticAttribute(int which,
double value)
Sets the value of the attribute with the given index to the given value. |
void |
setStaticAttribute(int which,
int value)
Sets the value of the attribute with the given index to the given value. |
void |
setStaticAttribute(int which,
java.lang.Object obj)
Sets the value of the attribute with the given index to the given value. |
void |
setStaticAttributeValue(int index,
java.lang.String value)
Sets the attribute with the given index to the given value. |
java.lang.String |
toString()
Returns information about this MiPart. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MiGeneralAttributes(boolean immutable,
int numberOfAttributes,
int startObjIndex,
int numObjAttributes,
int startIntIndex,
int numIntAttributes,
int startDblIndex,
int numDblAttributes,
int startBoolIndex,
int numBoolAttributes)
immutable - true if this cannot be changed.numberOfAttributes - the total number of attributes
(which is just the sum of the numbers
below)startObjIndex - the first index for object attributesnumObjAttributes - the number of object attributesstartIntIndex - the first index for int attributesnumIntAttributes - the number of int attributesstartDblIndex - the first index for double attributesnumDblAttributes - the number of double attributesstartBoolIndex - the first index for boolean attributesnumBoolAttributes - the number of boolean attributes
public MiGeneralAttributes(int numberOfAttributes,
int startObjIndex,
int numObjAttributes,
int startIntIndex,
int numIntAttributes,
int startDblIndex,
int numDblAttributes,
int startBoolIndex,
int numBoolAttributes)
numberOfAttributes - the total number of attributes
(which is just the sum of the numbers
below)startObjIndex - the first index for object attributesnumObjAttributes - the number of object attributesstartIntIndex - the first index for int attributesnumIntAttributes - the number of int attributesstartDblIndex - the first index for double attributesnumDblAttributes - the number of double attributesstartBoolIndex - the first index for boolean attributesnumBoolAttributes - the number of boolean attributes| Method Detail |
public abstract java.lang.String cacheToString()
public abstract java.lang.String getNameOfAttribute(int index)
index - the index of an attribute
public boolean isImmutable()
public void setIsImmutable(boolean flag)
flag - true if immutablepublic boolean equals(java.lang.Object obj)
obj - the MiGeneralAttributes to compare to
public int hashCode()
public java.lang.Object makeCopy()
makeCopy in interface MiiCopyable
public void setStaticAttribute(int which,
java.lang.Object obj)
which - the index of the attributeobj - the new value of the attribute
public void setStaticAttribute(int which,
int value)
which - the index of the attributevalue - the new value of the attribute
public void setStaticAttribute(int which,
double value)
which - the index of the attributevalue - the new value of the attribute
public void setStaticAttribute(int which,
boolean value)
which - the index of the attributevalue - the new value of the attributepublic boolean isInheritedAttribute(int which)
which - the index of the attribute
public MiGeneralAttributes setIsInheritedAttribute(int which,
boolean flag)
which - the index of the attributeflag - true if the attribute is inheritedpublic MiGeneralAttributes inheritFromAll(MiGeneralAttributes from)
from - the attributes from which we will
get the values to assign to this
attributes inherited attribute values
public MiGeneralAttributes inheritFrom(MiGeneralAttributes from)
from - the attributes from which we will
get the non-inherited values to
assign to this attributes inherited
attribute values
public MiGeneralAttributes overrideFrom(MiGeneralAttributes from)
from - the attributes from which we will
get the non-inherited values to
assign to this attributes attribute
values
public MiGeneralAttributes overrideFromPermanent(MiGeneralAttributes from)
from - the attributes from which we will
get the non-inherited values to
assign to this attributes attribute
values
public MiGeneralAttributes overrideFromPermanent2(MiGeneralAttributes from)
from - the attributes from which we will
get the non-inherited values to
assign to this attributes attribute
values
public MiGeneralAttributes initializeAsOverrideAttributes(boolean flag)
public void initializeAsInheritedAttributes()
public MiGeneralAttributes getModifiedAttributes(int which,
java.lang.Object object)
which - the index of the attribute
public MiGeneralAttributes getModifiedAttributes(int which,
int value)
which - the index of the attributevalue - the new value of the attribute
public MiGeneralAttributes getModifiedAttributes(int which,
double value)
which - the index of the attributevalue - the new value of the attribute
public MiGeneralAttributes getModifiedAttributes(int which,
boolean value)
which - the index of the attributevalue - the new value of the attribute
public MiGeneralAttributes getModifiedAttributes(java.lang.String name,
java.lang.String value)
value - the new value of the attribute
public java.lang.Object getAttribute(int which)
which - the index of the attribute
public int getIntegerAttribute(int which)
which - the index of the attribute
public double getDoubleAttribute(int which)
which - the index of the attribute
public boolean getBooleanAttribute(int which)
which - the index of the attribute
public int getNumberOfAttributes()
public boolean hasAttribute(java.lang.String name)
public int getIndexOfAttribute(java.lang.String name)
java.lang.IllegalArgumentException - if the
name is not a valid attribute name
public void setStaticAttributeValue(int index,
java.lang.String value)
index - the index of an attributevalue - the new value of the attribute
java.lang.RuntimeException - attempt to modify
immutable attributespublic java.lang.String getAttributeValue(java.lang.String name)
public java.lang.Object getAttributeValueAsObject(int index)
public java.lang.String dump()
public java.lang.String toString()
public int getNumUsing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||