Separate Halcyon (rendering) into standalone target without Flex dependency; JavaScri...
[potlatch2.git] / net / systemeD / halcyon / connection / Relation.as
1 package net.systemeD.halcyon.connection {
2
3     public class Relation extends Entity {
4         private var members:Array;
5                 public static var entity_type:String = 'relation';
6
7         public function Relation(id:Number, version:uint, tags:Object, members:Array) {
8             super(id, version, tags);
9             this.members = members;
10         }
11
12         public function get length():uint {
13             return members.length;
14         }
15
16         public function getMember(index:uint):RelationMember {
17             return members[index];
18         }
19
20         public function setMember(index:uint, member:RelationMember):void {
21             members.splice(index, 1, member);
22         }
23
24         public function insertMember(index:uint, member:RelationMember):void {
25             members.splice(index, 0, member);
26         }
27
28         public function appendMember(member:RelationMember):uint {
29             members.push(member);
30             return members.length;
31         }
32
33         public function removeMember(index:uint):void {
34             members.splice(index, 1);
35         }
36
37                 public override function getType():String {
38                         return 'relation';
39                 }
40     }
41
42 }