Package org.rococoa.cocoa.foundation

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


    }

    public void setPronunciations(List<Entry> pronounciations) {
        NSMutableArray pronounciationDicts = NSMutableArray.CLASS.arrayWithCapacity(pronounciations.size());
        for (Entry e : pronounciations) {
            pronounciationDicts.addObject(e.getData());
        }
        setValue(Pronunciations, pronounciationDicts);
    }
   
    public void addPronounciation(Entry pronounciation) {
View Full Code Here


    public void addPronounciation(Entry pronounciation) {
        NSMutableArray pronounciations = getValueAsType(Pronunciations, NSMutableArray.class);
        if ( pronounciations == null ) {
            pronounciations = NSMutableArray.CLASS.arrayWithCapacity(1);
        }
        pronounciations.addObject(pronounciation.getData());
        setValue(Pronunciations, pronounciations);
    }

    public List<Entry> getAbbreviations() {
        NSMutableArray abbreviations = getValueAsType(Abbreviations, NSMutableArray.class);
View Full Code Here

    }

    public void setAbbreviations(List<Entry> abbreviations) {
        NSMutableArray abbreviationDicts = NSMutableArray.CLASS.arrayWithCapacity(abbreviations.size());
        for (Entry e : abbreviations) {
            abbreviationDicts.addObject(e.getData());
        }
        setValue(Abbreviations, abbreviationDicts);
    }

    public void addAbbreviation(Entry abbreviation) {
View Full Code Here

    public void addAbbreviation(Entry abbreviation) {
        NSMutableArray abbreviations = getValueAsType(Abbreviations, NSMutableArray.class);
        if ( abbreviations == null ) {
            abbreviations = NSMutableArray.CLASS.arrayWithCapacity(1);
        }
        abbreviations.addObject(abbreviation.getData());
        setValue(Abbreviations, abbreviations);
    }
   
    @Override
    public String toString() {
View Full Code Here

public class NSMutableArrayTest extends RococoaTestCase {

    @Test public void test() {
        NSMutableArray array = NSMutableArray.CLASS.arrayWithCapacity(3);
        assertEquals(0, array.count());
        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);
View Full Code Here

    @Test public void test() {
        NSMutableArray array = NSMutableArray.CLASS.arrayWithCapacity(3);
        assertEquals(0, array.count());
        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);
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.