public void setExpanded(Object treeNode, boolean expanded) { if (_rootExpanded && treeNode == _rootTreeNode && !expanded) { return; } if (expanded) { if (_allExpanded) { _collapsedTreeNodes.removeObject(treeNode); } else { _expandedTreeNodes.addObject(treeNode); } } else { if (_allExpanded) { _collapsedTreeNodes.addObject(treeNode); } else { _expandedTreeNodes.removeObject(treeNode); } } }
/** * Normalizes tags from tags array and adds them to set * * @param set set that normalized tags should be added to * @param tags array of unclean tags */ private void addNormalizedTags(NSMutableSet<String> set, Object[] tags) { for (Object objTag : tags) { if (objTag instanceof String) { String strTag = (String) objTag; String normalizedTag = _normalizer.normalize(strTag); if (normalizedTag != null && normalizedTag.length() > 0) { set.addObject(normalizedTag); } } else if (objTag instanceof ERTag) { set.addObject(((ERTag)objTag).name()); } else { throw new IllegalArgumentException("Unknown tag type '" + objTag.getClass().getName() + "' (" + objTag + " )."); } } }
Object setElement = jsonset.get(key); Object unmarshalledObject = ser.unmarshall(state, null, setElement); abset.addObject(unmarshalledObject);
tagNames.addObject(((ERTag) tags).name());
@Override public NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup) { NSMutableSet<String> sequenceNames = new NSMutableSet<String>(entityGroup.count()); NSMutableArray<EOSQLExpression> results = new NSMutableArray<EOSQLExpression>(); for (EOEntity entity : entityGroup) { String sequenceName = H2PlugIn._sequenceNameForEntity(entity); if (!sequenceNames.containsObject(sequenceName)) { sequenceNames.addObject(sequenceName); String sql = "DROP SEQUENCE " + sequenceName; results.addObject(createExpression(entity, sql)); } } return results; }
public NSArray<String> terms(String fieldName) { NSMutableSet<String> result = new NSMutableSet(); TermEnum terms = null; try { IndexReader reader = indexReader(); terms = reader.terms(new Term(fieldName, "")); while (fieldName.equals(terms.term().field())) { result.addObject(terms.term().text()); if (!terms.next()) { break; } } } catch (IOException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } finally { if (terms != null) { try { terms.close(); } catch (IOException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } } return result.allObjects(); }
@Override public NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup) { NSMutableSet<String> sequenceNames = new NSMutableSet<String>(); NSMutableArray<EOSQLExpression> results = new NSMutableArray<EOSQLExpression>(); for (EOEntity entity : entityGroup) { if (isPrimaryKeyGenerationNotSupported(entity)) { continue; } EOAttribute priKeyAttribute = entity.primaryKeyAttributes().objectAtIndex(0); String sql; String sequenceName = H2PlugIn._sequenceNameForEntity(entity); if (!sequenceNames.containsObject(sequenceName)) { sequenceNames.addObject(sequenceName); // timc 2006-11-06 create result here so we can check for // enableIdentifierQuoting while building the statement H2Expression result = new H2Expression(entity); String attributeName = result.sqlStringForAttribute(priKeyAttribute); String tableName = result.sqlStringForSchemaObjectName(entity.externalName()); sql = "CREATE SEQUENCE " + sequenceName + " START WITH (SELECT MAX(" + attributeName + ") + 1 FROM " + tableName + ")"; results.addObject(createExpression(entity, sql)); sql = "ALTER TABLE " + tableName + " ALTER COLUMN " + attributeName + " SET DEFAULT nextval('" + sequenceName + "')"; results.addObject(createExpression(entity, sql)); } } return results; }