Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jacorb.notification;
  
  /*
   *        JacORB - a free Java ORB
   *
   *   Copyright (C) 1997-2012 Gerald Brose / The JacORB Team.
   *
   *   This library is free software; you can redistribute it and/or
   *   modify it under the terms of the GNU Library General Public
  *   License as published by the Free Software Foundation; either
  *   version 2 of the License, or (at your option) any later version.
  *
  *   This library 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
  *   Library General Public License for more details.
  *
  *   You should have received a copy of the GNU Library General Public
  *   License along with this library; if not, write to the Free
  *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 

Author(s):
Alphonse Bendt
 
 
 public class EventTypeWrapper implements EventTypeIdentifierComparable
 {
     private final EventType eventType_;
     private final String constraintKey_;
     
     public static final EventType EVENT_TYPE_ALL = new EventType("""%ALL");
     
     public static final EventType[] EMPTY_EVENT_TYPE_ARRAY = new EventType[0];
     
     public EventTypeWrapper(EventType eventType)
     {
          = eventType;
         
          =
             AbstractMessage.calcConstraintKeyeventType.domain_nameeventType.type_name );
     }
 
     public EventType getEventType()
     {
         return ;
     }
     
     public String toString()
     {
         return toString();
     }
     
     public boolean equals(Object other)
     {
         try {
             return equals(, ((EventTypeWrapper)other).);
         } catch (ClassCastException e)
         {
             return super.equals(other);
         }
     }
     
     public int hashCode()
     {
         return toString().hashCode();
     }
     
     public int compareTo(Object o)
     {
         try
         {
             EventTypeWrapper _other = (EventTypeWrappero;
 
             int _compare = .
                     .compareTo(_other.eventType_.domain_name);
 
             if (_compare == 0)
             {
                 _compare = .
                         .compareTo(_other.eventType_.type_name);
             }
 
             return _compare;
 
         } catch (ClassCastException e)
         {
             throw new IllegalArgumentException();
         }
     }
     
     ////////////////////////////////////////
 
     public static String toString(EventType et)
     {
         StringBuffer buffer = new StringBuffer();
        appendEventTypeToBuffer(etbuffer);
        return buffer.toString();
    }
    private static void appendEventTypeToBuffer(EventType etStringBuffer buffer)
    {
        buffer.append(et.domain_name);
        buffer.append("/");
        buffer.append(et.type_name);
    }
    public static String toString(EventType[] ets)
    {
        StringBuffer b = new StringBuffer("[");
        for (int x = 0; x < ets.length; ++x)
        {
            appendEventTypeToBuffer(ets[x], b);
            if (x < ets.length - 1)
            {
                b.append(", ");
            }
        }
        b.append("]");
        return b.toString();
    }
    public static boolean equals(EventType leftEventType right)
    {
        return left.domain_name.equals(right.domain_name) && left.type_name.equals(right.type_name);
    }
    
    public String getConstraintKey()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X