You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/02/13 09:36:16 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/content NodeRevisionDescriptor.java

juergen     02/02/13 00:36:16

  Modified:    src/share/org/apache/slide/content
                        NodeRevisionDescriptor.java
  Log:
  added propertyValueContains method, which allows to check if a specific property contains a specific value. (Eckehard)
  
  Revision  Changes    Path
  1.23      +52 -4     jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java
  
  Index: NodeRevisionDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- NodeRevisionDescriptor.java	10 Jan 2002 15:48:13 -0000	1.22
  +++ NodeRevisionDescriptor.java	13 Feb 2002 08:36:16 -0000	1.23
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v 1.22 2002/01/10 15:48:13 juergen Exp $
  - * $Revision: 1.22 $
  - * $Date: 2002/01/10 15:48:13 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v 1.23 2002/02/13 08:36:16 juergen Exp $
  + * $Revision: 1.23 $
  + * $Date: 2002/02/13 08:36:16 $
    *
    * ====================================================================
    *
  @@ -81,7 +81,7 @@
    * Node Revision Descriptor class.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.22 $
  + * @version $Revision: 1.23 $
    */
   public final class NodeRevisionDescriptor implements Serializable, Cloneable {
       
  @@ -527,6 +527,54 @@
        */
       public Enumeration enumerateProperties() {
           return properties.elements();
  +    }
  +    
  +    
  +                                     
  +    /**
  +     * Checks whether the value of the given property contains the specified
  +     * substring.
  +     *
  +     * @param name the property name
  +     * @param substr the substring to check
  +     * @return true, if the value of the given property contains the specified
  +     *         substring
  +     */
  +    public boolean propertyValueContains( String name, String substr ) {
  +        boolean result = false;
  +        NodeProperty p = getProperty( name );
  +        
  +        if( p != null ) {
  +            Object v = p.getValue();
  +            if( v instanceof String && ((String)v).indexOf(substr) >= 0 )
  +                result = true;
  +        }
  +        
  +        return result;
  +    }
  +    
  +    
  +    /**
  +     * Checks whether the value of the given property contains the specified
  +     * substring.
  +     *
  +     * @param name the property name
  +     * @param namespace the namespace
  +     * @param substr the substring to check
  +     * @return true, if the value of the given property contains the specified
  +     *         substring
  +     */
  +    public boolean propertyValueContains( String name, String namespace, String substr ) {
  +        boolean result = false;
  +        NodeProperty p = getProperty( name, namespace );
  +        
  +        if( p != null ) {
  +            Object v = p.getValue();
  +            if( v instanceof String && ((String)v).indexOf(substr) >= 0 )
  +                result = true;
  +        }
  +        
  +        return result;
       }
       
       
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>