Class UDMFObject
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all attributes from the structure.Gets a corresponding attribute by name.getBoolean(String attributeName) Gets the boolean value of an arbitrary object attribute.getBoolean(String attributeName, Boolean def) Gets the boolean value of an arbitrary object attribute.Gets the integer value of an arbitrary object attribute.Gets the integer value of an arbitrary object attribute.getInteger(String attributeName) Gets the integer value of an arbitrary object attribute.getInteger(String attributeName, Integer def) Gets the integer value of an arbitrary object attribute.Gets the string value of an arbitrary object attribute.Gets the string value of an arbitrary object attribute.iterator()Removes a corresponding attribute by name.voidSets an attribute value by name.voidsetBoolean(String attributeName, Boolean value) Gets the boolean value of an arbitrary object attribute.voidGets the integer value of an arbitrary object attribute.voidsetInteger(String attributeName, Integer value) Gets the integer value of an arbitrary object attribute.voidSets the string value of an arbitrary object attribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
UDMFObject
public UDMFObject()Creates a new UDMFObject.
-
-
Method Details
-
clear
public void clear()Clears all attributes from the structure. -
get
-
remove
-
set
-
setBoolean
Gets the boolean value of an arbitrary object attribute. Non-empty strings and non-zero numbers aretrue.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).value- the attribute value.- Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
getBoolean
Gets the boolean value of an arbitrary object attribute. Non-empty strings and non-zero numbers aretrue.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).- Returns:
- the integer value of an object attribute, or
nullif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
getBoolean
Gets the boolean value of an arbitrary object attribute. Non-empty strings and non-zero numbers aretrue.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).def- the default value if one does not exist.- Returns:
- the integer value of an object attribute, or
defif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
setInteger
Gets the integer value of an arbitrary object attribute. If the value is castable to Integer, it is cast to an Integer.Strings are attempted to be parsed as integers. Floating-point values are chopped. Booleans are 1 if true, 0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).value- the attribute value.
-
getInteger
Gets the integer value of an arbitrary object attribute. If the value is castable to Integer, it is cast to an Integer.Strings are attempted to be parsed as integers. Floating-point values are chopped. Booleans are 1 if true, 0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).- Returns:
- the integer value of an object attribute, or
nullif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
getInteger
Gets the integer value of an arbitrary object attribute. If the value is castable to Integer, it is cast to an Integer.Strings are attempted to be parsed as integers. Floating-point values are chopped. Booleans are 1 if true, 0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).def- the default value if one does not exist.- Returns:
- the integer value of an object attribute, or
defif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
setFloat
Gets the integer value of an arbitrary object attribute. If the value is castable to Float, it is cast to a Float.Strings are attempted to be parsed as floating point numbers. Integers are promoted. Booleans are 1.0 if true, 0.0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).value- the attribute value.- Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
getFloat
Gets the integer value of an arbitrary object attribute. If the value is castable to Float, it is cast to a Float.Strings are attempted to be parsed as floating point numbers. Integers are promoted. Booleans are 1.0 if true, 0.0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).- Returns:
- the floating-point value of an object attribute, or
nullif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
getFloat
Gets the integer value of an arbitrary object attribute. If the value is castable to Float, it is cast to a Float.Strings are attempted to be parsed as floating point numbers. Integers are promoted. Booleans are 1.0 if true, 0.0 if false.
- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).def- the default value if one does not exist.- Returns:
- the floating-point value of an object attribute, or
defif the attribute is not implemented nor exists. - Throws:
NumberFormatException- if the value was originally a String and can't be converted.
-
setString
Sets the string value of an arbitrary object attribute. If the value is promotable to String (integers/floats/booleans), it is promoted to a String.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).value- the attribute value.
-
getString
Gets the string value of an arbitrary object attribute. If the value is promotable to String (integers/floats/booleans), it is promoted to a String.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).- Returns:
- the string value of an object attribute, or
nullif the attribute is not implemented nor exists.
-
getString
Gets the string value of an arbitrary object attribute. If the value is promotable to String (integers/floats/booleans), it is promoted to a String.- Parameters:
attributeName- the attribute name (may be standardized, depending on implementation).def- the default value if one does not exist.- Returns:
- the string value of an object attribute, or
defif the attribute is not implemented nor exists.
-
iterator
-