// Generated by Haxe 4.3.3
package model;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class Association extends model.Set
{
	public Association(haxe.lang.EmptyObject empty)
	{
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		super(((haxe.lang.EmptyObject) (haxe.lang.EmptyObject.EMPTY) ));
	}
	
	
	public Association(java.lang.String name)
	{
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		super(haxe.lang.EmptyObject.EMPTY);
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		model.Association.__hx_ctor_model_Association(this, name);
	}
	
	
	protected static void __hx_ctor_model_Association(model.Association __hx_this, java.lang.String name)
	{
		//line 8 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		model.Set.__hx_ctor_model_Set(__hx_this, name, null, null, null, null);
		//line 9 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		__hx_this.links = new haxe.root.Array<model.Link>();
		//line 10 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		__hx_this.isAgregation = false;
	}
	
	
	public haxe.root.Array<model.Link> links;
	
	public boolean isAgregation;
	
	public boolean isReflexive()
	{
		//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		if (( this.links.length == 2 )) 
		{
			//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return haxe.lang.Runtime.valEq(this.links.__get(0).set.name, this.links.__get(1).set.name);
		}
		else
		{
			//line 14 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return false;
		}
		
	}
	
	
	public boolean isNN()
	{
		//line 18 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		return  ! (haxe.lang.Runtime.toBool(((java.lang.Boolean) (haxe.root.Lambda.exists(((java.lang.Object) (this.links) ), ((haxe.lang.Function) (( (( model.Association_isNN_18__Fun.__hx_current != null )) ? (model.Association_isNN_18__Fun.__hx_current) : (model.Association_isNN_18__Fun.__hx_current = ((model.Association_isNN_18__Fun) (new model.Association_isNN_18__Fun()) )) )) ))) ))) ;
	}
	
	
	public boolean isRelation()
	{
		//line 22 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		if ( ! (this.isClass()) ) 
		{
			//line 22 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return this.isNN();
		}
		else
		{
			//line 22 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return true;
		}
		
	}
	
	
	public boolean isClass()
	{
		//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		if (( this.fields.length == 0 )) 
		{
			//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return ( this.links.length > 2 );
		}
		else
		{
			//line 26 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			return true;
		}
		
	}
	
	
	@Override public java.lang.Object __hx_setField(java.lang.String field, java.lang.Object value, boolean handleProperties)
	{
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		{
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			boolean __temp_executeDef1 = true;
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (( field != null )) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				switch (field.hashCode())
				{
					case -1892466223:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isAgregation")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							this.isAgregation = haxe.lang.Runtime.toBool(((java.lang.Boolean) (value) ));
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return value;
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 102977465:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("links")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							this.links = ((haxe.root.Array<model.Link>) (value) );
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return value;
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (__temp_executeDef1) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				return super.__hx_setField(field, value, handleProperties);
			}
			else
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_getField(java.lang.String field, boolean throwErrors, boolean isCheck, boolean handleProperties)
	{
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		{
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			boolean __temp_executeDef1 = true;
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (( field != null )) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				switch (field.hashCode())
				{
					case 2056148590:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isClass")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "isClass")) );
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 102977465:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("links")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.links;
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case -1347706554:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isRelation")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "isRelation")) );
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case -1892466223:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isAgregation")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.isAgregation;
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 3241066:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isNN")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "isNN")) );
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 442224290:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isReflexive")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "isReflexive")) );
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (__temp_executeDef1) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				return super.__hx_getField(field, throwErrors, isCheck, handleProperties);
			}
			else
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_invokeField(java.lang.String field, java.lang.Object[] dynargs)
	{
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		{
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			boolean __temp_executeDef1 = true;
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (( field != null )) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				switch (field.hashCode())
				{
					case 2056148590:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isClass")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.isClass();
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 442224290:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isReflexive")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.isReflexive();
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case -1347706554:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isRelation")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.isRelation();
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
					case 3241066:
					{
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						if (field.equals("isNN")) 
						{
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							__temp_executeDef1 = false;
							//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
							return this.isNN();
						}
						
						//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
			if (__temp_executeDef1) 
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				return super.__hx_invokeField(field, dynargs);
			}
			else
			{
				//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public void __hx_getFields(haxe.root.Array<java.lang.String> baseArr)
	{
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		baseArr.push("isAgregation");
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		baseArr.push("links");
		//line 3 "/home/frank/Documents/Developpements/dbconcept-0.5.1/src/model/Association.hx"
		super.__hx_getFields(baseArr);
	}
	
	
}


