public class OrderedProperties<T extends IMutableStringPair>
extends java.util.Properties
Modifier and Type | Field and Description |
---|---|
protected static int |
INITIAL_CAPACITY |
Constructor and Description |
---|
OrderedProperties()
Initialize the new instance with default values.
|
OrderedProperties(int initialCapacity)
Initialize the new instance with an initial capacity.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addElement(T element) |
protected boolean |
appendProperty(java.lang.String name,
java.lang.String value)
Appends the property specified by the given name with the given value..
|
void |
clear()
Removes all properties
|
boolean |
deleteProperty(IName name)
Deletes the property with the specified name.
|
boolean |
deleteProperty(java.lang.String name)
Deletes the property with the specified name.
|
java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> |
entrySet()
Returns all entries in the order they have been added
|
protected T |
findProperty(java.lang.String key) |
protected java.util.List<T> |
getElements() |
java.lang.String |
getProperty(IName name)
Returns the value of the property with the given name or null if it is
not found.
|
java.lang.String |
getProperty(IName name,
java.lang.String defaultValue)
Searches for the property with the specified key in this property list.
|
java.lang.String |
getProperty(java.lang.String name)
Returns the value of the property with the given name or null if it is
not found.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Searches for the property with the specified name in this property list.
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
getPropertyIndex() |
java.lang.String[] |
getPropertyNames()
Returns an array containing the properties names in the order they
have been added or read from a stream.
|
boolean |
hasContent()
Returns whether or not any data is contained.
|
protected java.lang.Integer |
indexOfProperty(java.lang.String key) |
boolean |
isEmpty()
Returns whether or not this contains any properties.
|
protected boolean |
isNullOrDeleted(T property)
Returns true if the given property is null or marked as deleted.
|
protected boolean |
isValidProperty(T property) |
java.util.Enumeration<java.lang.Object> |
keys()
Returns all keys of this properties list in the order they have been added.
|
java.util.Set<java.lang.Object> |
keySet()
Returns all keys of this properties list in the order they have been added.
|
void |
list(java.io.PrintStream out)
NOT SUPPORTED METHOD!
|
void |
list(java.io.PrintWriter out)
NOT SUPPORTED METHOD!
|
void |
load(java.io.InputStream inStream)
NOT SUPPORTED METHOD!
|
java.util.List<java.lang.String> |
nameList()
Returns a list containing all properties names in the order they
have been added or read from a stream.
|
protected java.util.List<T> |
newElementsList(int initialCapacity) |
protected T |
newProperty(java.lang.String name,
java.lang.String value)
Create a new property object with the given name and value.
|
int |
numberOfElements()
Returns how many elements are contained.
|
protected T |
propertyAt(int index) |
protected T |
propertyAt(java.lang.Integer index) |
java.util.Enumeration<java.lang.String> |
propertyNames()
Returns an enumeration of the properties names in the order they have been
added or read from a stream.
|
protected void |
registerProperty(T property,
java.lang.Integer index) |
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable.
|
void |
save(java.io.OutputStream out,
java.lang.String header)
Deprecated.
|
protected void |
setElements(java.util.List<T> newValue) |
java.lang.Object |
setProperty(IName name,
java.lang.String value)
Modifies the value or adds the property specified by the given name.
|
java.lang.Object |
setProperty(java.lang.String name,
java.lang.String value)
Modifies the value or adds the property specified by the given name.
|
protected void |
setPropertyIndex(java.util.Map<java.lang.String,java.lang.Integer> newValue) |
int |
size()
Returns how many properties are contained.
|
void |
store(java.io.OutputStream out,
java.lang.String header)
NOT SUPPORTED METHOD!
|
java.util.Set<java.lang.String> |
stringPropertyNames() |
protected static final int INITIAL_CAPACITY
public OrderedProperties()
public OrderedProperties(int initialCapacity)
public java.util.List<java.lang.String> nameList()
public java.lang.String[] getPropertyNames()
public int size()
size
in interface java.util.Map<java.lang.Object,java.lang.Object>
size
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
numberOfElements()
public int numberOfElements()
size()
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.Object,java.lang.Object>
isEmpty
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
hasContent()
public boolean hasContent()
isEmpty()
public java.lang.String getProperty(java.lang.String name)
getProperty
in class java.util.Properties
name
- The name of the property to look for.public java.lang.String getProperty(IName name)
name
- The name of the property to look for.public java.lang.Object setProperty(java.lang.String name, java.lang.String value)
setProperty
in class java.util.Properties
name
- The name of the property to setvalue
- The new value to be setpublic java.lang.Object setProperty(IName name, java.lang.String value)
name
- The name of the property to set.value
- The new value to be set.public boolean deleteProperty(java.lang.String name)
name
- The name of the property to deletepublic boolean deleteProperty(IName name)
name
- The name of the property to delete.public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.Object,java.lang.Object>
remove
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
getProperty
in class java.util.Properties
public java.lang.String getProperty(IName name, java.lang.String defaultValue)
public void list(java.io.PrintStream out)
list
in class java.util.Properties
java.lang.UnsupportedOperationException
public void list(java.io.PrintWriter out)
list
in class java.util.Properties
java.lang.UnsupportedOperationException
public void load(java.io.InputStream inStream) throws java.io.IOException
load
in class java.util.Properties
java.lang.UnsupportedOperationException
java.io.IOException
public java.util.Enumeration<java.lang.String> propertyNames()
Be aware that the returned enumeration is NOT backed by this OrderedProperties object!
propertyNames
in class java.util.Properties
public java.util.Set<java.lang.String> stringPropertyNames()
stringPropertyNames
in class java.util.Properties
@Deprecated public void save(java.io.OutputStream out, java.lang.String header)
save
in class java.util.Properties
java.lang.UnsupportedOperationException
public void store(java.io.OutputStream out, java.lang.String header) throws java.io.IOException
store
in class java.util.Properties
java.lang.UnsupportedOperationException
java.io.IOException
public void clear()
clear
in interface java.util.Map<java.lang.Object,java.lang.Object>
clear
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.util.Enumeration<java.lang.Object> keys()
keys
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.util.Set<java.lang.Object> keySet()
keySet
in interface java.util.Map<java.lang.Object,java.lang.Object>
keySet
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.Object,java.lang.Object>
entrySet
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
protected boolean appendProperty(java.lang.String name, java.lang.String value)
name
- The name of the property to appendvalue
- The new value to be appendprotected T newProperty(java.lang.String name, java.lang.String value)
protected void addElement(T element)
protected void registerProperty(T property, java.lang.Integer index)
protected T findProperty(java.lang.String key)
protected java.lang.Integer indexOfProperty(java.lang.String key)
protected T propertyAt(java.lang.Integer index)
protected T propertyAt(int index)
protected boolean isNullOrDeleted(T property)
property
- The property to checkprotected boolean isValidProperty(T property)
protected java.util.List<T> newElementsList(int initialCapacity)
protected java.util.List<T> getElements()
protected void setElements(java.util.List<T> newValue)
protected java.util.Map<java.lang.String,java.lang.Integer> getPropertyIndex()
protected void setPropertyIndex(java.util.Map<java.lang.String,java.lang.Integer> newValue)