Codota Logo
OAVObjectType
Code IndexAdd Codota to your IDE (free)

How to use
OAVObjectType
in
jadex.rules.state

Best Java code snippets using jadex.rules.state.OAVObjectType (Showing top 20 results out of 315)

  • Common ways to obtain OAVObjectType
private void myMethod () {
OAVObjectType o =
  • Codota IconIOAVState state;Object object;state.getType(object)
  • Codota IconOAVAttributeType oAVAttributeType;oAVAttributeType.getType()
  • Codota IconMap map;Object key;(OAVObjectType) map.get(key)
  • Smart code suggestions by Codota
}
origin: org.activecomponents.jadex/jadex-rules

String tmpnamesin = tmptype.getName()+"_has_"+attrname;
String tmpnameplu = tmptype.getName()+"_has_"+attrnameplu;
attrtype = tmptype.getDeclaredAttributeType0(tmpnamesin);
if(attrtype==null)
  attrtype = tmptype.getDeclaredAttributeType0(tmpnameplu);
  tmptype = tmptype.getSupertype();
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Create a new attribute type.
 *  @param name The name.
 *  @param type The type.
 *  @param mult The multiplicity.
 *  @param def The default value.
 */
public OAVAttributeType createAttributeType(String name, 
  OAVObjectType type)
{
  return createAttributeType(name, type, OAVAttributeType.NONE, null);
}
 
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Test if two object are equal.
 *  @param object The object to compare to.
 */
public boolean equals(Object object)
{
  return object instanceof OAVInternalObjectId
    && this.id==((OAVInternalObjectId)object).id
    && this.type.equals(((OAVInternalObjectId)object).type);
}
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Test if this type is same type or subtype of another type.
 *  @param type The type to test.
 *  @return True, if this object is same type or subtype.
 */
public boolean isSubtype(OAVObjectType type)
{
  boolean ret = false;
  
  OAVObjectType tmp = this;
  while(tmp!=null && !ret)
  {
    if(type.equals(tmp))
      ret = true;
    else
      tmp = tmp.getSupertype();
  }
  
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Get an attribute type description.
 *  @param attribute    The name of the attribute.
 *  @return The OAV attribute type.
 */
public OAVAttributeType	getAttributeType0(String attribute)
{
  OAVAttributeType ret = (OAVAttributeType)(attributes!=null? attributes.get(attribute): null);
  if(ret==null)
  {
    OAVObjectType    type    = this.getSupertype();
    while(ret==null && type!=null)
    {
      ret = type.getAttributeType0(attribute);
      type = type.getSupertype();
    }
  }
  
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Get the properties of an object. 
 */
protected Collection getProperties(Object object, IContext context, boolean includemethods, boolean includefields)
{
  Collection ret = new LinkedHashSet();
  IOAVState state = (IOAVState)context;
  OAVObjectType type = state.getType(object);
  
  
  while(type!=null && !(type instanceof OAVJavaType))
  {
    Collection props = type.getDeclaredAttributeTypes();
    ret.addAll(props);
    type = type.getSupertype();
  }
  
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Create a string representation of this OAV object id.
 */
public String	toString()
{
  return type.getName()+"_"+id;
}
 
origin: net.sourceforge.jadex/jadex-rules

else if(!otype.equals(type))
    if(type.isSubtype(otype))
    else if(!otype.isSubtype(type))
      throw new RuntimeException("Incompatible variable types: "+var+" "+otype+" "+type);
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Get the set of matching type nodes for a (sub)type.
 *  @param type The object type.
 *  @return The set of type nodes for that object type.
 */
protected Set	getTypeNodes(OAVObjectType type)
{
  Set    ret    = (Set)typenodesets.get(type);
  if(ret==null)
  {
    synchronized(this)
    {
      ret    = (Set)typenodesets.get(type);
      if(ret==null)
      {
        ret    = new HashSet();
        for(Iterator it=typenodes.values().iterator(); it.hasNext(); )
        {
          TypeNode    tnode    = (TypeNode)it.next();
          if(type.isSubtype(tnode.getObjectType()))
            ret.add(tnode);
        }
        typenodesets.put(type, ret);
      }
    }
  }
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

    OAVAttributeType attr = otype.getAttributeType(attrname);
    aret.add(new Object[]{attr, key});
    otype    = attr.getType();
    OAVAttributeType attr = otype.getAttributeType(attrname);
    aret.add(attr);
    otype    = attr.getType();
ret    = otype.getAttributeType(slotname);
origin: net.sourceforge.jadex/jadex-kernel-bdi

  public String getObjectName(Object obj)
  {
    String    name    = null;
    if(state.getType(obj).isSubtype(OAVBDIMetaModel.modelelement_type))
    {
      name    = (String)state.getAttributeValue(obj, OAVBDIMetaModel.modelelement_has_name);
    }
    
    if(name==null && state.getType(obj).isSubtype(OAVBDIMetaModel.elementreference_type))
    {
      name    = (String)state.getAttributeValue(obj, OAVBDIMetaModel.elementreference_has_concrete);
    }
    
    if(name==null && state.getType(obj).isSubtype(OAVBDIMetaModel.expression_type))
    {
      IParsedExpression    exp    =(IParsedExpression)state.getAttributeValue(obj, OAVBDIMetaModel.expression_has_parsed);
      String    text    = (String)state.getAttributeValue(obj, OAVBDIMetaModel.expression_has_text);
      name    = exp!=null ? exp.getExpressionText() : text!=null ? text.trim() : null;
    }
    
    if(name==null)
    {
      name    = ""+obj;
    }
    
    return obj instanceof String ? (String)obj : state.getType(obj).getName().substring(1) + " " + name;
  }
}
origin: net.sourceforge.jadex/jadex-kernel-bdi

public void objectAdded(Object id, OAVObjectType type, boolean root)
{
  // Add the type and its supertypes (if not already contained).
  while(type!=null && types.add(type))
    type    = type.getSupertype();
}
 
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Create a new attribute type.
 *  @param name The name.
 *  @param type The type.
 *  @param mult The multiplicity.
 *  @param def The default value.
 */
public OAVAttributeType createAttributeType(String name, 
  OAVObjectType type, String mult, Object def, OAVAttributeType idxattr)
{
  if(!tmodel.contains(type))
    throw new RuntimeException("Unknown object type: "+type);
  OAVAttributeType attr = new OAVAttributeType(this, name, type, mult, def, idxattr);
  addAttributeType(attr);
  return attr;
}
 
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Get an attribute type description.
 *  @param attribute    The name of the attribute.
 *  @return The OAV attribute type.
 */
public OAVAttributeType	getAttributeType(String attribute)
{
  OAVAttributeType ret = getAttributeType0(attribute);
  
  if(ret==null)
    throw new RuntimeException("Attribute not found: "+this+", "+attribute);
  
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Create a type.
 *  Creates a type that can be used to create objects.
 *  @param name The type name.
 *  @param supertype The supertype.
 *  @return The type.
 */
public OAVObjectType createType(String name, OAVObjectType supertype)
{
  OAVObjectType type = new OAVObjectType(name, supertype, this);
  if(contains(type))
    throw new RuntimeException("Type already exists: "+name);
  types.put(name, type);
  return type;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Create a string representation of this OAV object id.
 */
public String	toString()
{
  return type.getName()+"_"+id;
}
 
origin: org.activecomponents.jadex/jadex-rules

else if(!otype.equals(type))
    if(type.isSubtype(otype))
    else if(!otype.isSubtype(type))
      throw new RuntimeException("Incompatible variable types: "+var+" "+otype+" "+type);
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Get the properties of an object. 
 */
protected Collection getProperties(Object object, IContext context, boolean includemethods, boolean includefields)
{
  Collection ret = new LinkedHashSet();
  IOAVState state = (IOAVState)context;
  OAVObjectType type = state.getType(object);
  
  
  while(type!=null && !(type instanceof OAVJavaType))
  {
    Collection props = type.getDeclaredAttributeTypes();
    ret.addAll(props);
    type = type.getSupertype();
  }
  
  return ret;
}
 
origin: org.activecomponents.jadex/jadex-rules

/**
 *  Get the set of matching type nodes for a (sub)type.
 *  @param type The object type.
 *  @return The set of type nodes for that object type.
 */
protected Set	getTypeNodes(OAVObjectType type)
{
  Set    ret    = (Set)typenodesets.get(type);
  if(ret==null)
  {
    synchronized(this)
    {
      ret    = (Set)typenodesets.get(type);
      if(ret==null)
      {
        ret    = new HashSet();
        for(Iterator it=typenodes.values().iterator(); it.hasNext(); )
        {
          TypeNode    tnode    = (TypeNode)it.next();
          if(type.isSubtype(tnode.getObjectType()))
            ret.add(tnode);
        }
        typenodesets.put(type, ret);
      }
    }
  }
  return ret;
}
 
origin: net.sourceforge.jadex/jadex-rules

/**
 *  Test if this type is same type or subtype of another type.
 *  @param type The type to test.
 *  @return True, if this object is same type or subtype.
 */
public boolean isSubtype(OAVObjectType type)
{
  boolean ret = false;
  
  OAVObjectType tmp = this;
  while(tmp!=null && !ret)
  {
    if(type.equals(tmp))
      ret = true;
    else
      tmp = tmp.getSupertype();
  }
  
  return ret;
}
 
jadex.rules.stateOAVObjectType

Javadoc

Type definition for an object stored as OAV triples. Type handling is useful for debugging and may be ignored for performance in production environments.

Most used methods

  • getName
    Get the name of the OAV object type.
  • getSupertype
    Get the supertype of this typ.
  • createAttributeType
    Create a new attribute type.
  • equals
    Test if two types are equal.
  • getAttributeType
    Get an attribute type description.
  • getDeclaredAttributeTypes
    Get the declared attribute types (i.e. not those of super types).
  • isSubtype
    Test if this type is same type or subtype of another type.
  • <init>
    Create a new OAV object type.
  • addAttributeType
    Add an attribute type description.
  • getAttributeType0
    Get an attribute type description.
  • getDeclaredAttributeType0
    Get an attribute type description.
  • hashCode
    Get the hash code.
  • getDeclaredAttributeType0,
  • hashCode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now