Skip to Content.
Sympa Menu

notify-dpml - r1428 - trunk/main/lang/process/src/main/net/dpml/lang/product

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1428 - trunk/main/lang/process/src/main/net/dpml/lang/product
  • Date: Mon, 1 May 2006 21:22:46 +0200

Author: mcconnell
Date: 2006-05-01 21:22:44 +0200 (Mon, 01 May 2006)
New Revision: 1428

Added:
trunk/main/lang/process/src/main/net/dpml/lang/product/InfoDirective.java
Modified:

trunk/main/lang/process/src/main/net/dpml/lang/product/AbstractProductDirective.java

trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
Log:
moving forward with product/process model

Modified:
trunk/main/lang/process/src/main/net/dpml/lang/product/AbstractProductDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/product/AbstractProductDirective.java
2006-05-01 19:01:30 UTC (rev 1427)
+++
trunk/main/lang/process/src/main/net/dpml/lang/product/AbstractProductDirective.java
2006-05-01 19:22:44 UTC (rev 1428)
@@ -16,7 +16,7 @@
* limitations under the License.
*/

-package net.dpml.lang.process;
+package net.dpml.lang.product;

import java.util.Arrays;
import java.util.ArrayList;
@@ -33,16 +33,20 @@
public abstract class AbstractProductDirective extends AbstractDirective
{
private final String m_name;
- private final String m_description;
+ private final InfoDirective m_info;

- public AbstractProductDirective( final String name, final String
description )
+ public AbstractProductDirective( final String name, final InfoDirective
info )
{
if( null == name )
{
throw new NullPointerException( "name" );
}
+ if( null == info )
+ {
+ throw new NullPointerException( "info" );
+ }
m_name = name;
- m_description = description;
+ m_info = info;
}

/**
@@ -54,13 +58,22 @@
return m_name;
}

+
/**
+ * Get the product title.
+ * @return the product title.
+ */
+ public String getTitle()
+ {
+ return m_info.getTitle();
+ }
+ /**
* Get the product description.
* @return the product description.
*/
public String getDescription()
{
- return m_description;
+ return m_info.getDescription();
}

/**
@@ -79,7 +92,7 @@
}
else
{
- return equals( m_description, object.m_description );
+ return equals( m_info, object.m_info );
}
}
else
@@ -96,7 +109,7 @@
{
int hash = super.hashCode();
hash ^= hashValue( m_name );
- hash ^= hashValue( m_description );
+ hash ^= hashValue( m_info );
return hash;
}
}

Modified:
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
===================================================================
---
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
2006-05-01 19:01:30 UTC (rev 1427)
+++
trunk/main/lang/process/src/main/net/dpml/lang/product/DirectoryProductDirective.java
2006-05-01 19:22:44 UTC (rev 1428)
@@ -26,9 +26,11 @@
*/
public class DirectoryProductDirective extends AbstractProductDirective
{
- public ProductDirective( final String name, final String description,
String path )
+ private final String m_path;
+
+ public DirectoryProductDirective( final String name, final InfoDirective
info, String path )
{
- super( name, description );
+ super( name, info );

if( null == path )
{
@@ -57,7 +59,7 @@
if( super.equals( other ) && ( other instanceof
DirectoryProductDirective ) )
{
DirectoryProductDirective object = (DirectoryProductDirective)
other;
- return m_path.equals( object.m_path ) )
+ return m_path.equals( object.m_path );
}
else
{

Added:
trunk/main/lang/process/src/main/net/dpml/lang/product/InfoDirective.java
===================================================================
--- trunk/main/lang/process/src/main/net/dpml/lang/product/InfoDirective.java
2006-05-01 19:01:30 UTC (rev 1427)
+++ trunk/main/lang/process/src/main/net/dpml/lang/product/InfoDirective.java
2006-05-01 19:22:44 UTC (rev 1428)
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2006 Stephen J. McConnell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.dpml.lang.product;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import net.dpml.lang.AbstractDirective;
+
+/**
+ * The InfoDirective describes a title and general information about an
entiry.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public abstract class InfoDirective extends AbstractDirective
+{
+ private final String m_title;
+ private final String m_description;
+
+ public InfoDirective( final String title, final String description )
+ {
+ if( null == title )
+ {
+ throw new NullPointerException( "title" );
+ }
+ m_title = title;
+ m_description = description;
+ }
+
+ /**
+ * Get the product name.
+ * @return the product name.
+ */
+ public String getTitle()
+ {
+ return m_title;
+ }
+
+ /**
+ * Get the product description.
+ * @return the product description.
+ */
+ public String getDescription()
+ {
+ return m_description;
+ }
+
+ /**
+ * Compare this object with another for equality.
+ * @param other the other object
+ * @return true if equal
+ */
+ public boolean equals( Object other )
+ {
+ if( super.equals( other ) && ( other instanceof InfoDirective ) )
+ {
+ InfoDirective object = (InfoDirective) other;
+ if( !m_title.equals( object.m_title ) )
+ {
+ return false;
+ }
+ else
+ {
+ return equals( m_description, object.m_description );
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Compute the hash value.
+ * @return the hashcode value
+ */
+ public int hashCode()
+ {
+ int hash = super.hashCode();
+ hash ^= hashValue( m_title );
+ hash ^= hashValue( m_description );
+ return hash;
+ }
+}




  • r1428 - trunk/main/lang/process/src/main/net/dpml/lang/product, mcconnell at BerliOS, 05/01/2006

Archive powered by MHonArc 2.6.24.

Top of Page