com.realtime.crossfire.jxclient.util
Class Mapping

java.lang.Object
  extended by com.realtime.crossfire.jxclient.util.Mapping

public class Mapping
extends java.lang.Object

Maintains a mapping from a set of integers to the same range of integers.


Field Summary
private  java.util.List<java.lang.Integer> mapping
          The mappings.
 
Constructor Summary
Mapping()
           
 
Method Summary
 void clear()
          Removes all mappings.
 int get(int src)
          Returns a mapping.
 void insert(int src, int dst)
          Adds a mapping.
 void remove(int src)
          Removes a mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapping

@NotNull
private final java.util.List<java.lang.Integer> mapping
The mappings. Maps source index to destination index.

Constructor Detail

Mapping

public Mapping()
Method Detail

clear

public void clear()
Removes all mappings.


get

public int get(int src)
Returns a mapping.

Parameters:
src - the source index
Returns:
the destination index

insert

public void insert(int src,
                   int dst)
Adds a mapping.

Parameters:
src - the source index
dst - the destination index

remove

public void remove(int src)
Removes a mapping.

Parameters:
src - the source index