org.eclipse.ocl.expressions.operations
Class CollectionLiteralExpOperations

java.lang.Object
  extended by org.eclipse.ocl.expressions.operations.CollectionLiteralExpOperations

public class CollectionLiteralExpOperations
extends Object

A static utility class that provides operations related to 'Collection Literal Exp' model objects.

The following operations are supported:


Constructor Summary
protected CollectionLiteralExpOperations()
           
 
Method Summary
static
<C> boolean
checkBagKind(CollectionLiteralExp<C> collectionLiteralExp, DiagnosticChain diagnostics, Map<Object,Object> context)
          kind = CollectionKind::Bag implies type.oclIsKindOf(BagType)
static
<C> boolean
checkElementType(CollectionLiteralExp<C> collectionLiteralExp, DiagnosticChain diagnostics, Map<Object,Object> context)
          type.oclAsType(CollectionType).elementType = part->iterate(p; c : Classifier = OclVoid | c.commonSuperType(p.type))
static
<C> boolean
checkNoCollectionInstances(CollectionLiteralExp<C> collectionLiteralExp, DiagnosticChain diagnostics, Map<Object,Object> context)
          kind <> CollectionKind::Collection
static
<C> boolean
checkSequenceKind(CollectionLiteralExp<C> collectionLiteralExp, DiagnosticChain diagnostics, Map<Object,Object> context)
          kind = CollectionKind::Sequence implies type.oclIsKindOf(SequenceType)
static
<C> boolean
checkSetKind(CollectionLiteralExp<C> collectionLiteralExp, DiagnosticChain diagnostics, Map<Object,Object> context)
          kind = CollectionKind::Set implies type.oclIsKindOf(SetType)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionLiteralExpOperations

protected CollectionLiteralExpOperations()

Method Detail

checkNoCollectionInstances

public static <C> boolean checkNoCollectionInstances(CollectionLiteralExp<C> collectionLiteralExp,
                                                     DiagnosticChain diagnostics,
                                                     Map<Object,Object> context)
kind <> CollectionKind::Collection

Parameters:
collectionLiteralExp - The receiving 'Collection Literal Exp' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

checkSetKind

public static <C> boolean checkSetKind(CollectionLiteralExp<C> collectionLiteralExp,
                                       DiagnosticChain diagnostics,
                                       Map<Object,Object> context)
kind = CollectionKind::Set implies type.oclIsKindOf(SetType)

Parameters:
collectionLiteralExp - The receiving 'Collection Literal Exp' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

checkSequenceKind

public static <C> boolean checkSequenceKind(CollectionLiteralExp<C> collectionLiteralExp,
                                            DiagnosticChain diagnostics,
                                            Map<Object,Object> context)
kind = CollectionKind::Sequence implies type.oclIsKindOf(SequenceType)

Parameters:
collectionLiteralExp - The receiving 'Collection Literal Exp' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

checkBagKind

public static <C> boolean checkBagKind(CollectionLiteralExp<C> collectionLiteralExp,
                                       DiagnosticChain diagnostics,
                                       Map<Object,Object> context)
kind = CollectionKind::Bag implies type.oclIsKindOf(BagType)

Parameters:
collectionLiteralExp - The receiving 'Collection Literal Exp' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

checkElementType

public static <C> boolean checkElementType(CollectionLiteralExp<C> collectionLiteralExp,
                                           DiagnosticChain diagnostics,
                                           Map<Object,Object> context)
type.oclAsType(CollectionType).elementType = part->iterate(p; c : Classifier = OclVoid | c.commonSuperType(p.type))

Parameters:
collectionLiteralExp - The receiving 'Collection Literal Exp' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.