Class CustomProperty
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomProperty
- All Implemented Interfaces:
ICustomProperty
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newCustomProperty
instance.CustomProperty
(ICustomProperty propertyToBeCopied) Instantiates a newCustomProperty
instance by copying from the specified instance.CustomProperty
(String value) Instantiates a newCustomProperty
instance.CustomProperty
(String type, String value) Instantiates a newCustomProperty
instance.CustomProperty
(URL location) Instantiates a newCustomProperty
instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests for equality between two custom properties.boolean
byte
char
double
<T extends Enum<T>>
Tfloat
int
getAsInt()
long
short
int
getType()
int
hashCode()
Returns the hash code for this custom property.void
void
setValue
(boolean value) void
setValue
(char value) void
setValue
(double value) void
setValue
(long value) void
void
void
void
toString()
-
Constructor Details
-
CustomProperty
public CustomProperty()Instantiates a newCustomProperty
instance.The default type for a custom property is
string
if not explicitly specified. -
CustomProperty
Instantiates a newCustomProperty
instance.- Parameters:
value
- The value of this custom property.
-
CustomProperty
-
CustomProperty
Instantiates a newCustomProperty
instance.- Parameters:
location
- The location of the file represented by this custom property.
-
CustomProperty
Instantiates a newCustomProperty
instance by copying from the specified instance.- Parameters:
propertyToBeCopied
- The property to be copied.
-
-
Method Details
-
setValue
- Specified by:
setValue
in interfaceICustomProperty
-
setValue
- Specified by:
setValue
in interfaceICustomProperty
-
setValue
public void setValue(char value) - Specified by:
setValue
in interfaceICustomProperty
-
setValue
- Specified by:
setValue
in interfaceICustomProperty
-
setValue
public void setValue(long value) - Specified by:
setValue
in interfaceICustomProperty
-
setValue
public void setValue(double value) - Specified by:
setValue
in interfaceICustomProperty
-
setValue
public void setValue(boolean value) - Specified by:
setValue
in interfaceICustomProperty
-
setValue
- Specified by:
setValue
in interfaceICustomProperty
-
getAsString
- Specified by:
getAsString
in interfaceICustomProperty
-
getAsChar
public char getAsChar()- Specified by:
getAsChar
in interfaceICustomProperty
-
getAsBool
public boolean getAsBool()- Specified by:
getAsBool
in interfaceICustomProperty
-
getAsColor
- Specified by:
getAsColor
in interfaceICustomProperty
-
getAsFloat
public float getAsFloat()- Specified by:
getAsFloat
in interfaceICustomProperty
-
getAsDouble
public double getAsDouble()- Specified by:
getAsDouble
in interfaceICustomProperty
-
getAsByte
public byte getAsByte()- Specified by:
getAsByte
in interfaceICustomProperty
-
getAsShort
public short getAsShort()- Specified by:
getAsShort
in interfaceICustomProperty
-
getAsInt
public int getAsInt()- Specified by:
getAsInt
in interfaceICustomProperty
-
getAsLong
public long getAsLong()- Specified by:
getAsLong
in interfaceICustomProperty
-
getAsEnum
- Specified by:
getAsEnum
in interfaceICustomProperty
-
getAsFile
- Specified by:
getAsFile
in interfaceICustomProperty
-
getMapObjectId
public int getMapObjectId()- Specified by:
getMapObjectId
in interfaceICustomProperty
-
getType
- Specified by:
getType
in interfaceICustomProperty
-
setType
- Specified by:
setType
in interfaceICustomProperty
-
equals
Description copied from interface:ICustomProperty
Tests for equality between two custom properties. Two custom properties are equal if they both have the same type and string value.- Specified by:
equals
in interfaceICustomProperty
- Overrides:
equals
in classObject
- Parameters:
anObject
- The custom property to test equality for- Returns:
- Whether the two custom properties are equal, or false if
anObject
is not a custom property
-
hashCode
public int hashCode()Description copied from interface:ICustomProperty
Returns the hash code for this custom property. The hash code for a custom property is equal to its type's hash code times 31 plus its value's hash code.- Specified by:
hashCode
in interfaceICustomProperty
- Overrides:
hashCode
in classObject
- Returns:
- The hash code for this custom property
-
toString
-