Package org.rococoa.cocoa.foundation

Examples of org.rococoa.cocoa.foundation.NSMutableArray.objectAtIndex()


    public List<Entry> getPronunciations() {
        NSMutableArray pronounciations = getValueAsType(Pronunciations, NSMutableArray.class);
        List<Entry> result = new ArrayList<Entry>(pronounciations.count());
        for (int i=0; i < pronounciations.count(); i++) {
            result.add(new Entry(Rococoa.cast(pronounciations.objectAtIndex(i), NSMutableDictionary.class)));
        }
        return Collections.unmodifiableList(result);
    }

    public void setPronunciations(List<Entry> pronounciations) {
View Full Code Here


    public List<Entry> getAbbreviations() {
        NSMutableArray abbreviations = getValueAsType(Abbreviations, NSMutableArray.class);
        List<Entry> result = new ArrayList<Entry>(abbreviations.count());
        for (int i=0; i < abbreviations.count(); i++) {
            result.add(new Entry(Rococoa.cast(abbreviations.objectAtIndex(i), NSMutableDictionary.class)));
        }
        return Collections.unmodifiableList(result);
    }

    public void setAbbreviations(List<Entry> abbreviations) {
View Full Code Here

        array.addObject(NSString.stringWithString("Hello"));
        array.addObject("Goodbye");
        assertEquals(2, array.count());
        assertEquals("(\n    Hello,\n    Goodbye\n)", array.description());
       
        NSObject first = array.objectAtIndex(0);
        assertEquals(NSString.stringWithString("Hello"), first);
       
        NSString firstAsString = Rococoa.cast(first, NSString.class);
        assertEquals("Hello", firstAsString.toString());
        assertEquals("Goodbye",
View Full Code Here

        assertEquals(NSString.stringWithString("Hello"), first);
       
        NSString firstAsString = Rococoa.cast(first, NSString.class);
        assertEquals("Hello", firstAsString.toString());
        assertEquals("Goodbye",
                Rococoa.cast(array.objectAtIndex(1), NSString.class).toString());
    }  
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.