Class CustomProperty
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomProperty
- All Implemented Interfaces:
ICustomProperty
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newCustomPropertyinstance.CustomProperty(ICustomProperty propertyToBeCopied) Instantiates a newCustomPropertyinstance by copying from the specified instance.CustomProperty(String value) Instantiates a newCustomPropertyinstance.CustomProperty(String type, String value) Instantiates a newCustomPropertyinstance.CustomProperty(URL location) Instantiates a newCustomPropertyinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests for equality between two custom properties.booleanbytechardouble<T extends Enum<T>>
TfloatintgetAsInt()longshortgetType()inthashCode()Returns the hash code for this custom property.voidvoidsetValue(boolean value) voidsetValue(char value) voidsetValue(double value) voidsetValue(long value) voidvoidvoidvoidtoString()
-
Constructor Details
-
CustomProperty
public CustomProperty()Instantiates a newCustomPropertyinstance.The default type for a custom property is
stringif not explicitly specified. -
CustomProperty
Instantiates a newCustomPropertyinstance.- Parameters:
value- The value of this custom property.
-
CustomProperty
Instantiates a newCustomPropertyinstance.- Parameters:
type- The type of this custom property.value- The value of this custom property.
-
CustomProperty
Instantiates a newCustomPropertyinstance.- Parameters:
location- The location of the file represented by this custom property.
-
CustomProperty
Instantiates a newCustomPropertyinstance by copying from the specified instance.- Parameters:
propertyToBeCopied- The property to be copied.
-
-
Method Details
-
setValue
- Specified by:
setValuein interfaceICustomProperty
-
setValue
- Specified by:
setValuein interfaceICustomProperty
-
setValue
public void setValue(char value) - Specified by:
setValuein interfaceICustomProperty
-
setValue
- Specified by:
setValuein interfaceICustomProperty
-
setValue
public void setValue(long value) - Specified by:
setValuein interfaceICustomProperty
-
setValue
public void setValue(double value) - Specified by:
setValuein interfaceICustomProperty
-
setValue
public void setValue(boolean value) - Specified by:
setValuein interfaceICustomProperty
-
setValue
- Specified by:
setValuein interfaceICustomProperty
-
getAsString
- Specified by:
getAsStringin interfaceICustomProperty
-
getAsChar
public char getAsChar()- Specified by:
getAsCharin interfaceICustomProperty
-
getAsBool
public boolean getAsBool()- Specified by:
getAsBoolin interfaceICustomProperty
-
getAsColor
- Specified by:
getAsColorin interfaceICustomProperty
-
getAsFloat
public float getAsFloat()- Specified by:
getAsFloatin interfaceICustomProperty
-
getAsDouble
public double getAsDouble()- Specified by:
getAsDoublein interfaceICustomProperty
-
getAsByte
public byte getAsByte()- Specified by:
getAsBytein interfaceICustomProperty
-
getAsShort
public short getAsShort()- Specified by:
getAsShortin interfaceICustomProperty
-
getAsInt
public int getAsInt()- Specified by:
getAsIntin interfaceICustomProperty
-
getAsLong
public long getAsLong()- Specified by:
getAsLongin interfaceICustomProperty
-
getAsEnum
- Specified by:
getAsEnumin interfaceICustomProperty
-
getAsFile
- Specified by:
getAsFilein interfaceICustomProperty
-
getType
- Specified by:
getTypein interfaceICustomProperty
-
setType
- Specified by:
setTypein interfaceICustomProperty
-
equals
Description copied from interface:ICustomPropertyTests for equality between two custom properties. Two custom properties are equal if they both have the same type and string value.- Specified by:
equalsin interfaceICustomProperty- Overrides:
equalsin classObject- Parameters:
anObject- The custom property to test equality for- Returns:
- Whether the two custom properties are equal, or false if
anObjectis not a custom property
-
hashCode
public int hashCode()Description copied from interface:ICustomPropertyReturns 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:
hashCodein interfaceICustomProperty- Overrides:
hashCodein classObject- Returns:
- The hash code for this custom property
-
toString
-