- java.lang.Object
-
- org.mal_lang.langspec.Asset
-
public final class Asset extends Object
Immutable class representing an asset in a MAL language.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttackStepgetAttackStep(String name)Returns the attack step with the namenamein thisAssetobject.List<AttackStep>getAttackSteps()Returns a list of all attack steps in thisAssetobject.CategorygetCategory()Returns the category of thisAssetobject.FieldgetField(String name)Returns the field with the namenamein thisAssetobject.List<Field>getFields()Returns a list of all fields in thisAssetobject.AttackStepgetLocalAttackStep(String name)Returns the local attack step with the namenamein thisAssetobject.List<AttackStep>getLocalAttackSteps()Returns a list of all local attack steps in thisAssetobject.FieldgetLocalField(String name)Returns the local field with the namenamein thisAssetobject.List<Field>getLocalFields()Returns a list of all local fields in thisAssetobject.byte[]getLocalPngIcon()Returns the local PNG icon of thisAssetobject.byte[]getLocalSvgIcon()Returns the local SVG icon of thisAssetobject.VariablegetLocalVariable(String name)Returns the local variable with the namenamein thisAssetobject.List<Variable>getLocalVariables()Returns a list of all local variables in thisAssetobject.MetagetMeta()Returns the meta info of thisAssetobject.StringgetName()Returns the name of thisAssetobject.byte[]getPngIcon()Returns the PNG icon of thisAssetobject.AssetgetSuperAsset()Returns the super asset of thisAssetobject.byte[]getSvgIcon()Returns the SVG icon of thisAssetobject.VariablegetVariable(String name)Returns the variable with the namenamein thisAssetobject.List<Variable>getVariables()Returns a list of all variables in thisAssetobject.booleanhasAttackStep(String name)Returns whethernameis the name of an attack step in thisAssetobject.booleanhasField(String name)Returns whethernameis the name of a field in thisAssetobject.booleanhasLocalAttackStep(String name)Returns whethernameis the name of a local attack step in thisAssetobject.booleanhasLocalField(String name)Returns whethernameis the name of a local field in thisAssetobject.booleanhasLocalPngIcon()Returns whether thisAssetobject has a local PNG icon.booleanhasLocalSvgIcon()Returns whether thisAssetobject has a local SVG icon.booleanhasLocalVariable(String name)Returns whethernameis the name of a local variable in thisAssetobject.booleanhasPngIcon()Returns whether thisAssetobject has an PNG icon.booleanhasSuperAsset()Returns whether thisAssetobject has a super asset.booleanhasSvgIcon()Returns whether thisAssetobject has an SVG icon.booleanhasVariable(String name)Returns whethernameis the name of a variable in thisAssetobject.booleanisAbstract()Returns whether thisAssetobject is abstract.booleanisSubTypeOf(Asset other)Returns whether thisAssetobject is a sub type ofother.static AssetleastUpperBound(Asset asset1, Asset asset2)Returns the least upper bound ofasset1andasset2, ornullifasset1andasset2have no upper bound.
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of thisAssetobject.- Returns:
- the name of this
Assetobject - Since:
- 1.0.0
-
getMeta
public Meta getMeta()
Returns the meta info of thisAssetobject.- Returns:
- the meta info of this
Assetobject - Since:
- 1.0.0
-
getCategory
public Category getCategory()
Returns the category of thisAssetobject.- Returns:
- the category of this
Assetobject - Since:
- 1.0.0
-
isAbstract
public boolean isAbstract()
Returns whether thisAssetobject is abstract.- Returns:
- whether this
Assetobject is abstract - Since:
- 1.0.0
-
hasSuperAsset
public boolean hasSuperAsset()
Returns whether thisAssetobject has a super asset.- Returns:
- whether this
Assetobject has a super asset - Since:
- 1.0.0
-
getSuperAsset
public Asset getSuperAsset()
Returns the super asset of thisAssetobject.- Returns:
- the super asset of this
Assetobject - Throws:
UnsupportedOperationException- if thisAssetobject does not have a super asset- Since:
- 1.0.0
-
hasLocalField
public boolean hasLocalField(String name)
Returns whethernameis the name of a local field in thisAssetobject.- Parameters:
name- the name of the local field- Returns:
- whether
nameis the name of a local field in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getLocalField
public Field getLocalField(String name)
Returns the local field with the namenamein thisAssetobject.- Parameters:
name- the name of the local field- Returns:
- the local field with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of a local field in thisAssetobject- Since:
- 1.0.0
-
getLocalFields
public List<Field> getLocalFields()
Returns a list of all local fields in thisAssetobject.- Returns:
- a list of all local fields in this
Assetobject - Since:
- 1.0.0
-
hasField
public boolean hasField(String name)
Returns whethernameis the name of a field in thisAssetobject.- Parameters:
name- the name of the field- Returns:
- whether
nameis the name of a field in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getField
public Field getField(String name)
Returns the field with the namenamein thisAssetobject.- Parameters:
name- the name of the field- Returns:
- the field with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of a field in thisAssetobject- Since:
- 1.0.0
-
getFields
public List<Field> getFields()
Returns a list of all fields in thisAssetobject.- Returns:
- a list of all fields in this
Assetobject - Since:
- 1.0.0
-
hasLocalVariable
public boolean hasLocalVariable(String name)
Returns whethernameis the name of a local variable in thisAssetobject.- Parameters:
name- the name of the local variable- Returns:
- whether
nameis the name of a local variable in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getLocalVariable
public Variable getLocalVariable(String name)
Returns the local variable with the namenamein thisAssetobject.- Parameters:
name- the name of the local variable- Returns:
- the local variable with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of a local variable in thisAssetobject- Since:
- 1.0.0
-
getLocalVariables
public List<Variable> getLocalVariables()
Returns a list of all local variables in thisAssetobject.- Returns:
- a list of all local variables in this
Assetobject - Since:
- 1.0.0
-
hasVariable
public boolean hasVariable(String name)
Returns whethernameis the name of a variable in thisAssetobject.- Parameters:
name- the name of the variable- Returns:
- whether
nameis the name of a variable in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getVariable
public Variable getVariable(String name)
Returns the variable with the namenamein thisAssetobject.- Parameters:
name- the name of the variable- Returns:
- the variable with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of a variable in thisAssetobject- Since:
- 1.0.0
-
getVariables
public List<Variable> getVariables()
Returns a list of all variables in thisAssetobject.- Returns:
- a list of all variables in this
Assetobject - Since:
- 1.0.0
-
hasLocalAttackStep
public boolean hasLocalAttackStep(String name)
Returns whethernameis the name of a local attack step in thisAssetobject.- Parameters:
name- the name of the local attack step- Returns:
- whether
nameis the name of a local attack step in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getLocalAttackStep
public AttackStep getLocalAttackStep(String name)
Returns the local attack step with the namenamein thisAssetobject.- Parameters:
name- the name of the local attack step- Returns:
- the local attack step with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of a local attack step in thisAssetobject- Since:
- 1.0.0
-
getLocalAttackSteps
public List<AttackStep> getLocalAttackSteps()
Returns a list of all local attack steps in thisAssetobject.- Returns:
- a list of all local attack steps in this
Assetobject - Since:
- 1.0.0
-
hasAttackStep
public boolean hasAttackStep(String name)
Returns whethernameis the name of an attack step in thisAssetobject.- Parameters:
name- the name of the attack step- Returns:
- whether
nameis the name of an attack step in thisAssetobject - Throws:
NullPointerException- ifnameisnull- Since:
- 1.0.0
-
getAttackStep
public AttackStep getAttackStep(String name)
Returns the attack step with the namenamein thisAssetobject.- Parameters:
name- the name of the attack step- Returns:
- the attack step with the name
namein thisAssetobject - Throws:
NullPointerException- ifnameisnullIllegalArgumentException- ifnameis not the name of an attack step in thisAssetobject- Since:
- 1.0.0
-
getAttackSteps
public List<AttackStep> getAttackSteps()
Returns a list of all attack steps in thisAssetobject.- Returns:
- a list of all attack steps in this
Assetobject - Since:
- 1.0.0
-
hasLocalSvgIcon
public boolean hasLocalSvgIcon()
Returns whether thisAssetobject has a local SVG icon.- Returns:
- whether this
Assetobject has a local SVG icon - Since:
- 1.0.0
-
getLocalSvgIcon
public byte[] getLocalSvgIcon()
Returns the local SVG icon of thisAssetobject.- Returns:
- the local SVG icon of this
Assetobject - Throws:
UnsupportedOperationException- if thisAssetobject does not have a local SVG icon- Since:
- 1.0.0
-
hasSvgIcon
public boolean hasSvgIcon()
Returns whether thisAssetobject has an SVG icon.- Returns:
- whether this
Assetobject has an SVG icon - Since:
- 1.0.0
-
getSvgIcon
public byte[] getSvgIcon()
Returns the SVG icon of thisAssetobject.- Returns:
- the SVG icon of this
Assetobject - Throws:
UnsupportedOperationException- if thisAssetobject does not have an SVG icon- Since:
- 1.0.0
-
hasLocalPngIcon
public boolean hasLocalPngIcon()
Returns whether thisAssetobject has a local PNG icon.- Returns:
- whether this
Assetobject has a local PNG icon - Since:
- 1.0.0
-
getLocalPngIcon
public byte[] getLocalPngIcon()
Returns the local PNG icon of thisAssetobject.- Returns:
- the local PNG icon of this
Assetobject - Throws:
UnsupportedOperationException- if thisAssetobject does not have a local PNG icon- Since:
- 1.0.0
-
hasPngIcon
public boolean hasPngIcon()
Returns whether thisAssetobject has an PNG icon.- Returns:
- whether this
Assetobject has an PNG icon - Since:
- 1.0.0
-
getPngIcon
public byte[] getPngIcon()
Returns the PNG icon of thisAssetobject.- Returns:
- the PNG icon of this
Assetobject - Throws:
UnsupportedOperationException- if thisAssetobject does not have an PNG icon- Since:
- 1.0.0
-
isSubTypeOf
public boolean isSubTypeOf(Asset other)
Returns whether thisAssetobject is a sub type ofother.- Parameters:
other- anotherAssetobject- Returns:
- whether this
Assetobject is a sub type ofother - Throws:
NullPointerException- ifotherisnull- Since:
- 1.0.0
-
leastUpperBound
public static Asset leastUpperBound(Asset asset1, Asset asset2)
Returns the least upper bound ofasset1andasset2, ornullifasset1andasset2have no upper bound.- Parameters:
asset1- anAssetobjectasset2- anAssetobject- Returns:
- the least upper bound of
asset1andasset2, ornullifasset1andasset2have no upper bound - Throws:
NullPointerException- ifasset1orasset2isnull- Since:
- 1.0.0
-
-