net.minecraftforge.common
Class Property

java.lang.Object
  extended by net.minecraftforge.common.Property

public class Property
extends Object


Nested Class Summary
static class Property.Type
           
 
Field Summary
 String comment
           
 String value
           
 String[] valueList
           
 
Constructor Summary
Property()
           
Property(String name, String[] values, Property.Type type)
           
Property(String name, String value, Property.Type type)
           
 
Method Summary
 boolean getBoolean(boolean _default)
          Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.
 boolean[] getBooleanList()
          Returns the boolean value of all values that can be parsed in the list.
 double getDouble(double _default)
          Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.
 double[] getDoubleList()
          Returns the double value of all values that can be parsed in the list.
 int getInt()
          Returns the value in this property as an integer, if the value is not a valid integer, it will return -1.
 int getInt(int _default)
          Returns the value in this property as an integer, if the value is not a valid integer, it will return the provided default.
 int[] getIntList()
          Returns the integer value of all values that can be parsed in the list.
 String getName()
           
 Property.Type getType()
           
 boolean isBooleanList()
          Checks if all of current values stored in this property can be converted to a boolean.
 boolean isBooleanValue()
          Checks if the current value held by this property is a valid boolean value.
 boolean isDoubleList()
          Checks if all of the current values stored in this property can be converted to a double.
 boolean isDoubleValue()
          Checks if the current value held by this property is a valid double value.
 boolean isIntList()
          Checks if all of the current values stored in this property can be converted to an integer.
 boolean isIntValue()
          Checks if the current value stored in this property can be converted to an integer.
 boolean isList()
           
 void setName(String name)
           
 boolean wasRead()
          Determines if this config value was just created, or if it was read from the config file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

public String value

comment

public String comment

valueList

public String[] valueList
Constructor Detail

Property

public Property()

Property

public Property(String name,
                String value,
                Property.Type type)

Property

public Property(String name,
                String[] values,
                Property.Type type)
Method Detail

getInt

public int getInt()
Returns the value in this property as an integer, if the value is not a valid integer, it will return -1.

Returns:
The value

getInt

public int getInt(int _default)
Returns the value in this property as an integer, if the value is not a valid integer, it will return the provided default.

Parameters:
_default - The default to provide if the current value is not a valid integer
Returns:
The value

isIntValue

public boolean isIntValue()
Checks if the current value stored in this property can be converted to an integer.

Returns:
True if the type of the Property is an Integer

getBoolean

public boolean getBoolean(boolean _default)
Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default.

Parameters:
_default - The default to provide
Returns:
The value as a boolean, or the default

isBooleanValue

public boolean isBooleanValue()
Checks if the current value held by this property is a valid boolean value.

Returns:
True if it is a boolean value

isDoubleValue

public boolean isDoubleValue()
Checks if the current value held by this property is a valid double value.

Returns:
True if the value can be converted to an double

getDouble

public double getDouble(double _default)
Returns the value in this property as a double, if the value is not a valid double, it will return the provided default.

Parameters:
_default - The default to provide if the current value is not a valid double
Returns:
The value

getIntList

public int[] getIntList()
Returns the integer value of all values that can be parsed in the list.

Returns:
Array of length 0 if none of the values could be parsed.

isIntList

public boolean isIntList()
Checks if all of the current values stored in this property can be converted to an integer.

Returns:
True if the type of the Property is an Integer List

getBooleanList

public boolean[] getBooleanList()
Returns the boolean value of all values that can be parsed in the list.

Returns:
Array of length 0 if none of the values could be parsed.

isBooleanList

public boolean isBooleanList()
Checks if all of current values stored in this property can be converted to a boolean.

Returns:
True if it is a boolean value

getDoubleList

public double[] getDoubleList()
Returns the double value of all values that can be parsed in the list.

Returns:
Array of length 0 if none of the values could be parsed.

isDoubleList

public boolean isDoubleList()
Checks if all of the current values stored in this property can be converted to a double.

Returns:
True if the type of the Property is a double List

getName

public String getName()

setName

public void setName(String name)

wasRead

public boolean wasRead()
Determines if this config value was just created, or if it was read from the config file. This is useful for mods who auto-assign there blocks to determine if the ID returned is a configured one, or a automatically generated one.

Returns:
True if this property was loaded from the config file with a value

getType

public Property.Type getType()

isList

public boolean isList()