Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * OfficeFloor - http://www.officefloor.net
   * Copyright (C) 2005-2011 Daniel Sagenschneider
   *
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 package net.officefloor.compile.properties;
 
Listing of Property instances.

Author(s):
Daniel Sagenschneider
 
 public interface PropertyList extends Iterable<Property> {

Appends a Property to this PropertyList.

Parameters:
name Name of the Property.
label Label of the Property. Should this be blank it will be defaulted to the name.
Returns:
Property added.
 
 	Property addProperty(String nameString label);

Appends a Property to this PropertyList.

Parameters:
name Name of the Property which is also used as the label.
Returns:
Property added.
 
Removes the Property from this PropertyList.

Parameters:
property Property to be removed.
 
 	void removeProperty(Property property);

Obtains the names of the Property instances in the order they were added.

Returns:
Names of the Property instances.
 
Obtains the first Property by the input name.

Parameters:
name Name of the Property to return.
Returns:
First Property by the input name, or null if no Property by the name.
 
Convenience method that attempts to get the Property and if not found adds the Property.

Parameters:
name Name of the Property to return.
Returns:
First Property by the input name or a newly added Property if no Property found by the name.
 
Convenience method to obtain the Property value.

Parameters:
name Name of the Property to obtain its value.
defaultValue Default value should the Property not exist or have blank value.
Returns:
Value for the Property (or defaultValue if not available).
 
	String getPropertyValue(String nameString defaultValue);

Obtains the java.util.Properties populated with the Property values.

Returns:
Populated java.util.Properties.
Clears the PropertyList.
	void clear();

Enable sorting the Property instances within this PropertyList.

Parameters:
comparator java.util.Comparator to provide comparisons for sorting.
	void sort(Comparator<? super Propertycomparator);

Normalises the Property instances.

This will remove:

  1. any Property with a blank name
  2. any Property with a blank value
  3. duplicate Property instances by the same name (keeps the first Property)
	void normalise();
New to GrepCode? Check out our FAQ X