FileDocCategorySizeDatePackage
EventCopyStorage.javaAPI DocphoneME MR2 API (J2ME)6278Wed May 02 18:00:04 BST 2007com.sun.midp.events

EventCopyStorage

public class EventCopyStorage extends Object
Storage of native event copies for events being posted to evet queue. It is expected that NamsAPIWrapper uses this class each time it calls NAMS API method.

Fields Summary
private Vector
storage
storage for Native Event cpopies
Constructors Summary
Methods Summary
public synchronized com.sun.midp.events.NativeEventcheckHead()

        return (NativeEvent)storage.elementAt(0);
    
public synchronized booleancheckHead(com.sun.midp.events.NativeEvent e, com.sun.midp.i3test.TestCase test, java.lang.String message)

        
        NativeEvent e1 = (NativeEvent)storage.elementAt(0);
        
        return compareEvents(e1, 
            e.type, 
            e.intParam1, e.intParam2, e.intParam3, e.intParam4, 
            e.stringParam1, e.stringParam2, e.stringParam4, 
            e.stringParam4, e.stringParam5, e.stringParam6, 
            test, 
            message);
    
public synchronized booleancheckHead(int t, int i1, int i2, int i3, int i4, java.lang.String s1, java.lang.String s2, java.lang.String s3, java.lang.String s4, java.lang.String s5, java.lang.String s6, com.sun.midp.i3test.TestCase test, java.lang.String message)

        
        NativeEvent e1 = (NativeEvent)storage.elementAt(0);
        
        return compareEvents(e1, 
                t, 
                i1, i2, i3, i4, 
                s1, s2, s3, s4, s5, s6, 
                test, 
                message);
    
public synchronized intcheckSize()

        return storage.size();
    
public synchronized voidclearAll()

        storage.removeAllElements();
    
private booleancompareEvents(com.sun.midp.events.NativeEvent e1, int t, int i1, int i2, int i3, int i4, java.lang.String s1, java.lang.String s2, java.lang.String s3, java.lang.String s4, java.lang.String s5, java.lang.String s6, com.sun.midp.i3test.TestCase test, java.lang.String message)

        
        test.assertTrue(message + " 'type' field", e1.type == t);
        
        test.assertTrue(message + " 'intParam1' field", e1.intParam1 == i1);
        test.assertTrue(message + " 'intParam2' field", e1.intParam2 == i2);
        test.assertTrue(message + " 'intParam3' field", e1.intParam3 == i3);
        test.assertTrue(message + " 'intParam4' field", e1.intParam4 == i4);
        
        test.assertEquals(message + " 'stringParam1' field",  
                e1.stringParam1, s1);
        test.assertEquals(message + " 'stringParam2' field",  
                e1.stringParam2, s2);
        test.assertEquals(message + " 'stringParam3' field",  
                e1.stringParam3, s3);
        test.assertEquals(message + " 'stringParam4' field",  
                e1.stringParam4, s4);
        test.assertEquals(message + " 'stringParam5' field",  
                e1.stringParam5, s5);
        test.assertEquals(message + " 'stringParam6' field",  
                e1.stringParam6, s6);
        
        return 
            (e1.type == t) &&
                
            (e1.intParam1 == i1) &&
            (e1.intParam2 == i2) &&
            (e1.intParam3 == i3) &&
            (e1.intParam4 == i4) &&
                
            (e1.stringParam1 == s1) &&
            (e1.stringParam2 == s2) &&
            (e1.stringParam3 == s3) &&
            (e1.stringParam4 == s4) &&
            (e1.stringParam5 == s5) &&
            (e1.stringParam6 == s6);
    
public synchronized com.sun.midp.events.NativeEventgetHead()

        NativeEvent e = (NativeEvent)storage.elementAt(0);
        storage.removeElementAt(0);
        return e;
    
public synchronized booleangetHead(com.sun.midp.events.NativeEvent e, com.sun.midp.i3test.TestCase test, java.lang.String message)

        NativeEvent e1 = (NativeEvent)storage.elementAt(0);
        storage.removeElementAt(0);
        
        return compareEvents(e1, 
            e.type, 
            e.intParam1, e.intParam2, e.intParam3, e.intParam4, 
            e.stringParam1, e.stringParam2, e.stringParam4, 
            e.stringParam4, e.stringParam5, e.stringParam6, 
            test,
            message);
    
public synchronized booleangetHead(int t, int i1, int i2, int i3, int i4, java.lang.String s1, java.lang.String s2, java.lang.String s3, java.lang.String s4, java.lang.String s5, java.lang.String s6, com.sun.midp.i3test.TestCase test, java.lang.String message)

        
        NativeEvent e1 = (NativeEvent)storage.elementAt(0);
        storage.removeElementAt(0);
        
        return compareEvents(e1, 
                t, 
                i1, i2, i3, i4, 
                s1, s2, s3, s4, s5, s6, 
                test, 
                message);
    
public synchronized intputTail(int t, int i1, int i2, int i3, int i4, java.lang.String s1, java.lang.String s2, java.lang.String s3, java.lang.String s4, java.lang.String s5, java.lang.String s6)

    
       
          
               
                    
        
        NativeEvent e = new NativeEvent(t);
        
        e.intParam1 = i1;
        e.intParam2 = i2;
        e.intParam3 = i3;
        e.intParam4 = i4;
        e.stringParam1 = s1;
        e.stringParam2 = s2;
        e.stringParam3 = s3;
        e.stringParam4 = s4;
        e.stringParam5 = s5;
        e.stringParam6 = s6;
        
        storage.addElement((Object)e);
        return storage.size();