本文整理汇总了Java中gov.nih.nci.cagrid.cqlquery.Group类的典型用法代码示例。如果您正苦于以下问题:Java Group类的具体用法?Java Group怎么用?Java Group使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Group类属于gov.nih.nci.cagrid.cqlquery包,在下文中一共展示了Group类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: submitMalformedQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private void submitMalformedQuery(DataServiceClient client) throws Exception {
CQLQuery query = new CQLQuery();
Object target = new Object();
target.setName(Book.class.getName());
Attribute attrib1 = new Attribute("name", Predicate.LIKE, "E%");
target.setAttribute(attrib1);
Group group = new Group();
group.setLogicRelation(LogicalOperator.AND);
group.setAttribute(new Attribute[] {
new Attribute("author", Predicate.IS_NOT_NULL, ""),
new Attribute("ISBN", Predicate.IS_NULL, "")
});
target.setGroup(group);
query.setTarget(target);
try {
client.query(query);
fail("Exception MalformedQueryExceptionType should have been thrown");
} catch (MalformedQueryExceptionType ex) {
// expected
}
}
示例2: convertObject
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private static Object convertObject(CQLObject cql2Object) throws QueryConversionException {
if (cql2Object.get_instanceof() != null) {
throw new QueryConversionException("CQL 1 does not support \"instanceof\" operations");
}
if (cql2Object.getCQLExtension() != null) {
throw new QueryConversionException("CQL 1 does not support query extensions");
}
Object o = new Object();
o.setName(cql2Object.getClassName());
if (cql2Object.getCQLAssociatedObject() != null) {
Association assoc = convertAssociation(cql2Object.getCQLAssociatedObject());
o.setAssociation(assoc);
}
if (cql2Object.getCQLAttribute() != null) {
Attribute attr = convertAttribute(cql2Object.getCQLAttribute());
o.setAttribute(attr);
}
if (cql2Object.getCQLGroup() != null) {
Group g = convertGroup(cql2Object.getCQLGroup());
o.setGroup(g);
}
return o;
}
示例3: validateGroupModel
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private void validateGroupModel(Object current, Group group, DomainModel model) throws DomainConformanceException {
if (group.getAttribute() != null) {
UMLClass classMd = getUmlClass(current.getName(), model);
for (int i = 0; i < group.getAttribute().length; i++) {
validateAttributeModel(group.getAttribute(i), classMd);
}
}
if (group.getAssociation() != null) {
for (int i = 0; i < group.getAssociation().length; i++) {
validateAssociationModel(current, group.getAssociation(i), model);
}
}
if (group.getGroup() != null) {
for (int i = 0; i < group.getGroup().length; i++) {
validateGroupModel(current, group.getGroup(i), model);
}
}
}
示例4: getSetGroupLogicMenuItem
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
/**
* This method initializes setGroupLogicMenuItem
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getSetGroupLogicMenuItem() {
if (setGroupLogicMenuItem == null) {
setGroupLogicMenuItem = new JMenuItem();
setGroupLogicMenuItem.setText("Group Logic");
setGroupLogicMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
// get the selected group node
GroupTreeNode groupNode = (GroupTreeNode) getCqlQueryTree()
.getSelectionPath().getLastPathComponent();
Group group = groupNode.getGroup();
SetGroupLogicDialog.setLogic(VisualQueryBuilder.this, group);
// re-render the group node
groupNode.rebuild();
}
});
}
return setGroupLogicMenuItem;
}
示例5: validateGroupModel
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private void validateGroupModel(Object current, Group group, DomainModel model) throws MalformedQueryException {
if (group.getAttribute() != null) {
UMLClass classMd = getUmlClass(current.getName(), model);
for (int i = 0; i < group.getAttribute().length; i++) {
validateAttributeModel(model, group.getAttribute(i), classMd);
}
}
if (group.getAssociation() != null) {
for (int i = 0; i < group.getAssociation().length; i++) {
validateAssociationModel(current, group.getAssociation(i), model);
}
}
if (group.getGroup() != null) {
for (int i = 0; i < group.getGroup().length; i++) {
validateGroupModel(current, group.getGroup(i), model);
}
}
}
示例6: submitMalformedQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private void submitMalformedQuery(EnumerationDataServiceClient client) throws Exception {
CQLQuery query = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName(Book.class.getName());
Attribute attrib1 = new Attribute("name", Predicate.LIKE, "E%");
target.setAttribute(attrib1);
Group group = new Group();
group.setLogicRelation(LogicalOperator.AND);
group.setAttribute(new Attribute[] {
new Attribute("author", Predicate.IS_NOT_NULL, ""),
new Attribute("ISBN", Predicate.IS_NULL, "")
});
target.setGroup(group);
query.setTarget(target);
EnumerationResponseContainer enumContainer = null;
try {
enumContainer = client.enumerationQuery(query);
} catch (MalformedQueryExceptionType ex) {
assertTrue("Malformed Query Exception Type thrown", true);
} finally {
if (enumContainer != null && enumContainer.getContext() != null) {
Release release = new Release();
release.setEnumerationContext(enumContainer.getContext());
createDataSource(enumContainer.getEPR()).releaseOp(release);
}
}
}
示例7: convertGroup
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private CQLGroup convertGroup(String parentClassName, Group cqlGroup) throws QueryConversionException {
CQLGroup group = new CQLGroup();
if (cqlGroup.getAssociation() != null) {
CQLAssociatedObject[] associations = new CQLAssociatedObject[cqlGroup.getAssociation().length];
for (int i = 0; i < cqlGroup.getAssociation().length; i++) {
associations[i] = convertAssociation(parentClassName, cqlGroup.getAssociation(i));
}
group.setCQLAssociatedObject(associations);
}
if (cqlGroup.getAttribute() != null) {
List<CQLAttribute> convertedAttributes = new LinkedList<CQLAttribute>();
for (Attribute attrib : cqlGroup.getAttribute()) {
CQLAttribute conversion = null;
if (unaryPredicateConversion.containsKey(attrib.getPredicate())) {
conversion = convertUnaryAttribute(attrib);
} else {
conversion = convertBinaryAttribute(parentClassName, attrib);
}
convertedAttributes.add(conversion);
}
if (convertedAttributes.size() != 0) {
CQLAttribute[] conversions = new CQLAttribute[convertedAttributes.size()];
convertedAttributes.toArray(conversions);
group.setCQLAttribute(conversions);
}
}
if (cqlGroup.getGroup() != null) {
CQLGroup[] groups = new CQLGroup[cqlGroup.getGroup().length];
for (int i = 0; i < cqlGroup.getGroup().length; i++) {
groups[i] = convertGroup(parentClassName, cqlGroup.getGroup(i));
}
group.setCQLGroup(groups);
}
GroupLogicalOperator logic =
cqlGroup.getLogicRelation() == LogicalOperator.AND
? GroupLogicalOperator.AND : GroupLogicalOperator.OR;
group.setLogicalOperation(logic);
return group;
}
示例8: convertGroup
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private static Group convertGroup(CQLGroup cql2Group) throws QueryConversionException {
if (cql2Group.getCQLExtension() != null) {
throw new QueryConversionException("CQL 1 does not support query extensions");
}
Group group = new Group();
group.setLogicRelation(cql2Group.getLogicalOperation() == GroupLogicalOperator.AND
? LogicalOperator.AND : LogicalOperator.OR);
if (cql2Group.getCQLAssociatedObject() != null) {
Association[] associations = new Association[cql2Group.getCQLAssociatedObject().length];
for (int i = 0; i < cql2Group.getCQLAssociatedObject().length; i++) {
associations[i] = convertAssociation(cql2Group.getCQLAssociatedObject(i));
}
group.setAssociation(associations);
}
if (cql2Group.getCQLAttribute() != null) {
Attribute[] attributes = new Attribute[cql2Group.getCQLAttribute().length];
for (int i = 0; i < cql2Group.getCQLAttribute().length; i++) {
attributes[i] = convertAttribute(cql2Group.getCQLAttribute(i));
}
group.setAttribute(attributes);
}
if (cql2Group.getCQLGroup() != null) {
Group[] groups = new Group[cql2Group.getCQLGroup().length];
for (int i = 0; i < cql2Group.getCQLGroup().length; i++) {
groups[i] = convertGroup(cql2Group.getCQLGroup(i));
}
group.setGroup(groups);
}
return group;
}
示例9: getAddGroupMenuItem
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
/**
* This method initializes addGroupMenuItem
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getAddGroupMenuItem() {
if (addGroupMenuItem == null) {
addGroupMenuItem = new JMenuItem();
addGroupMenuItem.setText("Group");
addGroupMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
// create the new group
Group group = new Group();
SetGroupLogicDialog.setLogic(VisualQueryBuilder.this, group);
// attach the group to the selected node
RebuildableTreeNode selectedNode = (RebuildableTreeNode) getCqlQueryTree()
.getSelectionPath().getLastPathComponent();
if (selectedNode instanceof TargetTreeNode) {
((TargetTreeNode) selectedNode).getTarget().setGroup(group);
} else if (selectedNode instanceof AssociationTreeNode) {
((AssociationTreeNode) selectedNode).getAssociation().setGroup(group);
} else if (selectedNode instanceof GroupTreeNode) {
Group selectedGroup = ((GroupTreeNode) selectedNode).getGroup();
Group[] childGroups = selectedGroup.getGroup();
if (childGroups == null) {
childGroups = new Group[] {group};
} else {
childGroups = (Group[]) Utils.appendToArray(childGroups, group);
}
selectedGroup.setGroup(childGroups);
}
// rebuild the diplay
selectedNode.rebuild();
}
});
}
return addGroupMenuItem;
}
示例10: getAddAssociationMenuItem
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
/**
* This method initializes addAssociationMenuItem
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getAddAssociationMenuItem() {
if (addAssociationMenuItem == null) {
addAssociationMenuItem = new JMenuItem();
addAssociationMenuItem.setText("Association");
addAssociationMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
// create the association
Association association = new Association();
association.setName(getAssociationInfoPanel().getTargetClassName());
association.setRoleName(getAssociationInfoPanel().getSourceRoleName());
// get the selected query point
RebuildableTreeNode selectedNode = (RebuildableTreeNode) getCqlQueryTree().getSelectionPath().getLastPathComponent();
if (selectedNode instanceof TargetTreeNode) {
((TargetTreeNode) selectedNode).getTarget().setAssociation(association);
} else if (selectedNode instanceof AssociationTreeNode) {
((AssociationTreeNode) selectedNode).getAssociation().setAssociation(association);
} else if (selectedNode instanceof GroupTreeNode) {
Group currentGroup = ((GroupTreeNode) selectedNode).getGroup();
Association[] groupAssociations = currentGroup.getAssociation();
if (groupAssociations == null) {
groupAssociations = new Association[] {association};
} else {
groupAssociations = (Association[]) Utils.appendToArray(
groupAssociations, association);
}
currentGroup.setAssociation(groupAssociations);
}
selectedNode.rebuild();
}
});
}
return addAssociationMenuItem;
}
示例11: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private CQLQuery createCqlQuery(String arrayDesignName) {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.project.Experiment");
Association arrayDesignAssociation = new Association();
arrayDesignAssociation.setName("gov.nih.nci.caarray.domain.array.ArrayDesign");
Attribute nameAttribute = new Attribute();
nameAttribute.setName("name");
nameAttribute.setValue(arrayDesignName);
nameAttribute.setPredicate(Predicate.EQUAL_TO);
arrayDesignAssociation.setAttribute(nameAttribute);
arrayDesignAssociation.setRoleName("arrayDesigns");
Association experimentDesignAssociation = new Association();
experimentDesignAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
Attribute valueAttribute = new Attribute();
valueAttribute.setName("value");
valueAttribute.setValue(EXPERIMENTAL_DESIGN);
valueAttribute.setPredicate(Predicate.EQUAL_TO);
experimentDesignAssociation.setAttribute(valueAttribute);
experimentDesignAssociation.setRoleName("experimentDesignTypes");
Group associations = new Group();
associations.setAssociation(new Association[] { arrayDesignAssociation, experimentDesignAssociation });
associations.setLogicRelation(LogicalOperator.AND);
target.setGroup(associations);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例12: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private CQLQuery createCqlQuery(String manufacturerName, String organismName) {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.project.Experiment");
Association manufacturerAssociation = new Association();
manufacturerAssociation.setName("gov.nih.nci.caarray.domain.contact.Organization");
Attribute manufacturerAttribute = new Attribute();
manufacturerAttribute.setName("name");
manufacturerAttribute.setValue(manufacturerName);
manufacturerAttribute.setPredicate(Predicate.EQUAL_TO);
manufacturerAssociation.setAttribute(manufacturerAttribute);
manufacturerAssociation.setRoleName("manufacturer");
Association organismAssociation = new Association();
organismAssociation.setName("edu.georgetown.pir.Organism");
Attribute organismAttribute = new Attribute();
organismAttribute.setName("commonName");
organismAttribute.setValue(organismName);
organismAttribute.setPredicate(Predicate.EQUAL_TO);
organismAssociation.setAttribute(organismAttribute);
organismAssociation.setRoleName("organism");
Group associations = new Group();
associations.setAssociation(new Association[] { manufacturerAssociation, organismAssociation });
associations.setLogicRelation(LogicalOperator.AND);
target.setGroup(associations);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例13: testAbstractDesignElement_Feature
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
@Test
public void testAbstractDesignElement_Feature() throws RemoteException {
CQLQuery cqlQuery = new CQLQuery();
gov.nih.nci.cagrid.cqlquery.Object target = new gov.nih.nci.cagrid.cqlquery.Object();
target.setName("gov.nih.nci.caarray.domain.array.Feature");
Association assoc = new Association("coordinateUnits");
assoc.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
Attribute att = new Attribute("id", Predicate.EQUAL_TO, "321");
assoc.setAttribute(att);
Association[] assocs = { assoc };
Attribute[] atts = {
new Attribute("featureNumber", Predicate.LESS_THAN, "200"),
new Attribute("x_Coordinate", Predicate.LESS_THAN, "3"),
new Attribute("y_Coordinate", Predicate.GREATER_THAN, "0.03")
};
Group g = new Group(assocs, atts, null, LogicalOperator.AND);
target.setGroup(g);
cqlQuery.setTarget(target);
QueryModifier qm = new QueryModifier();
qm.setCountOnly(false);
cqlQuery.setQueryModifier(qm);
CQLQueryResults cqlResults = gridClient.query(cqlQuery);
// assertEquals("this will fail due to http://gforge.nci.nih.gov/tracker/index.php?func=detail&aid=28685", 48, cqlResults.getObjectResult().length);
Iterator iter = new CQLQueryResultsIterator(cqlResults, CaArraySvcClient.class.getResourceAsStream("client-config.wsdd"));
while (iter.hasNext()) {
Feature f = (Feature) (iter.next());
assertEquals(321L, f.getCoordinateUnits().getId().longValue());
// assertTrue(f.getFeatureNumber().intValue() < 200);
// assertTrue(f.getX_Coordinate().doubleValue() < 3.0);
// assertTrue(f.getY_Coordinate().doubleValue() > 0.03);
}
}
示例14: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private CQLQuery createCqlQuery() {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.project.Experiment");
Association manufacturerAssociation = new Association();
manufacturerAssociation.setName("gov.nih.nci.caarray.domain.contact.Organization");
Attribute manufacturerName = new Attribute();
manufacturerName.setName("name");
manufacturerName.setValue(manufacturer);
manufacturerName.setPredicate(Predicate.EQUAL_TO);
manufacturerAssociation.setAttribute(manufacturerName);
manufacturerAssociation.setRoleName("manufacturer");
Association organismAssociation = new Association();
organismAssociation.setName("edu.georgetown.pir.Organism");
Attribute organismName = new Attribute();
organismName.setName("commonName");
organismName.setValue(organism);
organismName.setPredicate(Predicate.EQUAL_TO);
organismAssociation.setAttribute(organismName);
organismAssociation.setRoleName("organism");
Group associations = new Group();
associations.setAssociation(new Association[] {manufacturerAssociation, organismAssociation});
associations.setLogicRelation(LogicalOperator.AND);
target.setGroup(associations);
cqlQuery.setTarget(target);
return cqlQuery;
}
示例15: createCqlQuery
import gov.nih.nci.cagrid.cqlquery.Group; //导入依赖的package包/类
private CQLQuery createCqlQuery() {
CQLQuery cqlQuery = new CQLQuery();
Object target = new Object();
target.setName("gov.nih.nci.caarray.domain.sample.Source");
Attribute sourceNameAttribute = new Attribute();
sourceNameAttribute.setName("name");
sourceNameAttribute.setValue(sourceName);
sourceNameAttribute.setPredicate(Predicate.EQUAL_TO);
Association materialTypeAssociation = new Association();
materialTypeAssociation.setName("gov.nih.nci.caarray.domain.vocabulary.Term");
Attribute materialTypeAttribute = new Attribute();
materialTypeAttribute.setName("value");
materialTypeAttribute.setValue(materialType);
materialTypeAttribute.setPredicate(Predicate.EQUAL_TO);
materialTypeAssociation.setAttribute(materialTypeAttribute);
materialTypeAssociation.setRoleName("materialType");
Group associations = new Group();
associations.setAttribute(new Attribute[] {sourceNameAttribute});
associations.setAssociation(new Association[] {materialTypeAssociation});
associations.setLogicRelation(LogicalOperator.AND);
target.setGroup(associations);
cqlQuery.setTarget(target);
return cqlQuery;
}