refactor the potlatch 2 code to look more MVC wrt the API parts
[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
6         public function Relation(id:Number, version:uint, tags:Object, members:Array) {
7             super(id, version, tags);
8             this.members = members;
9         }
10
11         public function get length():uint {
12             return members.length;
13         }
14
15         public function getMember(index:uint):RelationMember {
16             return members[index];
17         }
18
19         public function setMember(index:uint, member:RelationMember):void {
20             members.splice(index, 1, member);
21         }
22
23         public function insertMember(index:uint, member:RelationMember):void {
24             members.splice(index, 0, member);
25         }
26
27         public function appendMember(member:RelationMember):uint {
28             members.push(member);
29             return members.length;
30         }
31
32         public function removeMember(index:uint):void {
33             members.splice(index, 1);
34         }
35     }
36
37 }