public static Integer morphedSchedulingStartDay(String value) { int i = MObject.weekArray.indexOfObject(value); if (i != NSArray.NotFound) { return Integer.valueOf(i); } return null; }
public static Integer morphedSchedulingStartTime(String value) { int i = MObject.timeOfDayArray.indexOfObject(value); if (i != NSArray.NotFound) { return Integer.valueOf(i); } return null; }
public int selectedIndex() { NSArray list = list(); int selectedIndex; Object selection = selection(); if (selection == null) { selectedIndex = -1; } else { selectedIndex = list.indexOfObject(selection); } return selectedIndex; }
static public NSArray drillDownListForMasterCriteriaList(DRMasterCriteria mc, NSArray mcList) { int i; NSMutableArray arr = new NSMutableArray(); int mcCount = mcList.count(); int startIndex = mcList.indexOfObject(mc); for (i = 0; i < mcCount; i++) { int atIndex = i+startIndex; if (atIndex == mcCount) { atIndex = 0; startIndex = -1; } DRMasterCriteria aMc = (DRMasterCriteria)mcList.objectAtIndex(atIndex); arr.addObject(aMc); } return arr; }
boolean isPrimaryKeyAttributes(EOEntity entity, NSArray<EOAttribute> attributes) { NSArray<String> keys = entity.primaryKeyAttributeNames(); boolean result = attributes.count() == keys.count(); if (result) { for (int i = 0; i < keys.count(); i++) { if (!(result = keys.indexOfObject(attributes.objectAtIndex(i).name()) != NSArray.NotFound)) break; } } return result; }
public int displayLevelForEvent(EOEvent e) { int index, i, n; NSArray children; index = selectionPath.indexOfObject(e); if (index != NSArray.NotFound) return index; children = rootEventList(); if (children.containsObject(e)) return 0; int count = selectionPath.count(); for (i = 0, n = count; i < n; i++) { children = (NSArray)cache.objectForKey(selectionPath.objectAtIndex(i)); if (null==children) break; if (children.containsObject(e)) return i+1; } return -1; }
public NSArray moveUpArray(DRAttribute member, boolean up, NSArray arr1) { int cnt; int cur = arr1.indexOfObject(member); NSMutableArray arr = newArraySans(arr1, member); cnt = arr.count(); if (up) { int newdex = cur-1; if (newdex < 0) { arr.addObject(member); } else { arr.insertObjectAtIndex(member, newdex); } } else { int newdex = cur+1; if (newdex > cnt) { arr.insertObjectAtIndex(member, 0); } else { arr.insertObjectAtIndex(member, newdex); } } return arr; }
protected void _removeFromEntityArraySelector(NSArray oldArray, NSSelector sel) { if (oldArray.indexOfObject(this) != -1) { NSMutableArray newArray = new NSMutableArray(oldArray); newArray.removeIdenticalObject(this); try { sel.invoke(entity(), newArray); } catch (IllegalAccessException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (IllegalArgumentException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (InvocationTargetException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } catch (NoSuchMethodException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } }
public String currentZCriteriaLabel() { NSArray srtdList = zGroup.sortedCriteriaList(); DRMasterCriteria mc = zGroup.masterCriteria(); DRCriteria crt = (DRCriteria)zCriteria().objectForKey(mc.label()); if (crt == null) { return "ERROR"; } int index = srtdList.indexOfObject(crt); int srtdListCount = srtdList.count(); if (index > srtdListCount-1) { crt = (DRCriteria)srtdList.objectAtIndex(srtdListCount-1); } //else { // crt = (DRCriteria)srtdList.objectAtIndex(index); //} return crt.label(); }
public WOComponent prevZ() { DRCriteria crt; NSArray srtdList = zGroup.sortedCriteriaList(); DRMasterCriteria mc = zGroup.masterCriteria(); int index = srtdList.indexOfObject(zCriteria().objectForKey(mc.label())); int count = srtdList.count(); int newIndex = index-1; if (newIndex < 0) { newIndex = count-1; } crt = (DRCriteria)srtdList.objectAtIndex(newIndex); zCriteria().setObjectForKey(crt, mc.label()); return null; }
public WOComponent nextZ() { DRCriteria crt; NSArray srtdList = zGroup.sortedCriteriaList(); DRMasterCriteria mc = zGroup.masterCriteria(); int index = srtdList.indexOfObject(zCriteria().objectForKey(mc.label())); int count = srtdList.count(); int newIndex = index+1; if (newIndex == count) { newIndex = 0; } crt = (DRCriteria)srtdList.objectAtIndex(newIndex); zCriteria().setObjectForKey(crt, mc.label()); return null; }
Object replacedItem = reorderedList.objectAtIndex(replacedItemIndex); if (replacedItem != replacingItem) { int replacingItemIndex = replacedItemIndex + itemPageArray.indexOfObject(replacingItem); reorderedList.replaceObjectAtIndex(replacingItem, replacedItemIndex); reorderedList.replaceObjectAtIndex(replacedItem, replacingItemIndex);