aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/ResourcesDesc.java
diff options
context:
space:
mode:
authorDeepak Bhole <[email protected]>2010-12-06 15:34:01 -0500
committerDeepak Bhole <[email protected]>2010-12-06 15:34:01 -0500
commit6ca1a9a369b10703da9af8f8a1ced0f3b02ae5c2 (patch)
tree568f8e454db94fa8abc896b46ce8cac7a9f3b74d /netx/net/sourceforge/jnlp/ResourcesDesc.java
parent0d66adf24179c33bbdccaacc10d4c8a5f5e2cd54 (diff)
Fixed indentation and spacing for all .java files.
Added a new .settings directory which contains Eclipse preferences for code style.
Diffstat (limited to 'netx/net/sourceforge/jnlp/ResourcesDesc.java')
-rw-r--r--netx/net/sourceforge/jnlp/ResourcesDesc.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/netx/net/sourceforge/jnlp/ResourcesDesc.java b/netx/net/sourceforge/jnlp/ResourcesDesc.java
index ca6f1dd..abd3e35 100644
--- a/netx/net/sourceforge/jnlp/ResourcesDesc.java
+++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java
@@ -14,7 +14,6 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
package net.sourceforge.jnlp;
import java.io.*;
@@ -44,6 +43,7 @@ public class ResourcesDesc {
/** list of jars, packages, properties, and extensions */
private List<Object> resources = new ArrayList<Object>();
+
// mixed list makes easier for lookup code
/**
@@ -67,7 +67,7 @@ public class ResourcesDesc {
*/
public JREDesc[] getJREs() {
List<JREDesc> resources = getResources(JREDesc.class);
- return resources.toArray( new JREDesc[resources.size()] );
+ return resources.toArray(new JREDesc[resources.size()]);
}
/**
@@ -78,7 +78,7 @@ public class ResourcesDesc {
public JARDesc getMainJAR() {
JARDesc jars[] = getJARs();
- for (int i=0; i < jars.length; i++)
+ for (int i = 0; i < jars.length; i++)
if (jars[i].isMain())
return jars[i];
@@ -93,7 +93,7 @@ public class ResourcesDesc {
*/
public JARDesc[] getJARs() {
List<JARDesc> resources = getResources(JARDesc.class);
- return resources.toArray( new JARDesc[resources.size()] );
+ return resources.toArray(new JARDesc[resources.size()]);
}
/**
@@ -107,11 +107,11 @@ public class ResourcesDesc {
for (int i = resources.size(); i-- > 0;) {
JARDesc jar = resources.get(i);
- if (!(""+jar.getPart()).equals(""+partName))
+ if (!("" + jar.getPart()).equals("" + partName))
resources.remove(i);
}
- return resources.toArray( new JARDesc[resources.size()] );
+ return resources.toArray(new JARDesc[resources.size()]);
}
/**
@@ -119,7 +119,7 @@ public class ResourcesDesc {
*/
public ExtensionDesc[] getExtensions() {
List<ExtensionDesc> resources = getResources(ExtensionDesc.class);
- return resources.toArray( new ExtensionDesc[resources.size()] );
+ return resources.toArray(new ExtensionDesc[resources.size()]);
}
/**
@@ -127,7 +127,7 @@ public class ResourcesDesc {
*/
public PackageDesc[] getPackages() {
List<PackageDesc> resources = getResources(PackageDesc.class);
- return resources.toArray( new PackageDesc[resources.size()] );
+ return resources.toArray(new PackageDesc[resources.size()]);
}
/**
@@ -146,7 +146,7 @@ public class ResourcesDesc {
resources.remove(i);
}
- return resources.toArray( new PackageDesc[resources.size()] );
+ return resources.toArray(new PackageDesc[resources.size()]);
}
/**
@@ -154,18 +154,18 @@ public class ResourcesDesc {
*/
public PropertyDesc[] getProperties() {
List<PropertyDesc> resources = getResources(PropertyDesc.class);
- return resources.toArray( new PropertyDesc[resources.size()] );
+ return resources.toArray(new PropertyDesc[resources.size()]);
}
/**
* Returns the properties as a map.
*/
- public Map<String,String> getPropertiesMap() {
- Map<String,String> properties = new HashMap<String,String>();
+ public Map<String, String> getPropertiesMap() {
+ Map<String, String> properties = new HashMap<String, String>();
List<PropertyDesc> resources = getResources(PropertyDesc.class);
- for (int i=0; i < resources.size(); i++) {
+ for (int i = 0; i < resources.size(); i++) {
PropertyDesc prop = resources.get(i);
- properties.put( prop.getKey(), prop.getValue() );
+ properties.put(prop.getKey(), prop.getValue());
}
return properties;
@@ -208,8 +208,8 @@ public class ResourcesDesc {
public <T> List<T> getResources(Class<T> type) {
List<T> result = new ArrayList<T>();
- for (int i=0; i < resources.size(); i++)
- if ( type.isAssignableFrom(resources.get(i).getClass()) )
+ for (int i = 0; i < resources.size(); i++)
+ if (type.isAssignableFrom(resources.get(i).getClass()))
result.add(type.cast(resources.get(i)));
return result;