org.malai.mapping
Interface IMapping

All Known Implementing Classes:
Drawing2CanvasMapping, List2ListMapping, List2ObjectMapping, Object2ObjectMapping, Package2TextViewMapping, Selection2BorderMapping, Selection2DeleterMapping, Selection2MetaCustumiserMapping, SelectionMapping, Shape2BorderMapping, Shape2ViewMapping, ShapeList2ExporterMapping, ShapeList2ViewListMapping, SymmetricList2ListMapping, TempShape2TempViewMapping, Unary2UnaryMapping, Unit2ScaleRuler, ViewList2TooltipableList, Zoom2ScaleRuler

public interface IMapping

This interface defines the concept of mapping that link source objects with target objects.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

05/15/2010

Since:
0.2
Version:
0.2
Author:
Arnaud BLOUIN

Method Summary
 void clear()
          Removes the references of the mapped objects of the mapping to avoid memory leaks.
 java.lang.Object getSource()
          Returns the source object of the mapping.
 java.lang.Object getTarget()
          Returns the target object of the mapping.
 void init()
          At start, the mapping must be executed one time to initialise the binding between source and target objects.
 void onListCleaned(java.lang.Object list)
          Executes the mapping when all the elements of the source were removed.
 void onObjectAdded(java.lang.Object list, java.lang.Object object, int index)
          Executes the mapping for the addition of an object.
 void onObjectModified(java.lang.Object object)
          Executes the mapping for the modification of an object.
 void onObjectMoved(java.lang.Object list, java.lang.Object object, int srcIndex, int targetIndex)
          Executes the mapping for the move of an object.
 void onObjectRemoved(java.lang.Object list, java.lang.Object object, int index)
          Executes the mapping for the deletion of an object.
 void onObjectReplaced(IUnary<?> object, java.lang.Object replacedObject)
          Executes the mapping when an object has been replaced by an other one.
 

Method Detail

getSource

java.lang.Object getSource()
Returns the source object of the mapping. If there is several source objects, a collection is returned.

Returns:
The source object of the mapping.
Since:
0.2

getTarget

java.lang.Object getTarget()
Returns the target object of the mapping. If there is several target objects, a collection is returned.

Returns:
The source object of the mapping.
Since:
0.2

onObjectAdded

void onObjectAdded(java.lang.Object list,
                   java.lang.Object object,
                   int index)
Executes the mapping for the addition of an object.

Parameters:
list - The modified source list.
object - The added object.
index - The position where the object has been added. -1 = the last position.
Since:
0.2

onObjectRemoved

void onObjectRemoved(java.lang.Object list,
                     java.lang.Object object,
                     int index)
Executes the mapping for the deletion of an object.

Parameters:
list - The modified source list.
object - The deleted object.
index - The position where the object has been deleted. -1 = the last position.
Since:
0.2

onListCleaned

void onListCleaned(java.lang.Object list)
Executes the mapping when all the elements of the source were removed.

Parameters:
list - The list before the cleaning, i.e. it still contains all the elements in order to know which elements have been removed.
Since:
3.0

onObjectMoved

void onObjectMoved(java.lang.Object list,
                   java.lang.Object object,
                   int srcIndex,
                   int targetIndex)
Executes the mapping for the move of an object.

Parameters:
list - The modified source list.
object - The move object.
srcIndex - The source position of the object. -1 = the last position.
targetIndex - The target position of the object. -1 = the last position.
Since:
0.2

onObjectReplaced

void onObjectReplaced(IUnary<?> object,
                      java.lang.Object replacedObject)
Executes the mapping when an object has been replaced by an other one.

Parameters:
object - The singleton that contains the new object.
replacedObject - The old object contained in the singleton that has been replaced.
Since:
0.2

onObjectModified

void onObjectModified(java.lang.Object object)
Executes the mapping for the modification of an object.

Parameters:
object - The modified object.
Since:
0.2

clear

void clear()
Removes the references of the mapped objects of the mapping to avoid memory leaks.

Since:
0.2

init

void init()
At start, the mapping must be executed one time to initialise the binding between source and target objects.

Since:
3.0