fr.inria.opengve.bridge.interfaces
Interface Map


public interface Map

The Map interface define a new data structure interface. The interface define a way to associate a triple of keys with one object. The type of keys are Object for the principal key, String for the name of the stored object and the last key named context is an Object. When no context is specified the context used is the principal key, this context can also be named default context.

The type of data that can be associated with this keys are also restricted, they can be of two type AbstractScalar or String.

Author:
fabrice.peix@sophia.inria.fr

Method Summary
 void clear()
          Clear the content of this Map
 boolean contains(java.lang.Object o)
          Say if an object is a principal key.
 boolean contains(java.lang.Object o, java.lang.String name)
          Say if an entry exist in this Map corresponding to a given principal key and name using default context.
 boolean contains(java.lang.Object o, java.lang.String name, java.lang.Object context)
          Say if an entry exist in this Map corresponding to a given principal key,name and context.
 java.util.Iterator<?> contextsIterator(java.lang.Object o)
          Returns an iterator on all contexts associated with a principal key.
 java.util.Iterator<?> contextsIterator(java.lang.Object o, java.lang.String name)
          Give an Iterator on all contexts assiated with a given principal key and name.
 java.lang.String getDataType(java.lang.Object o, java.lang.String name)
          Returns the data type of the value associated with a principal key, a given name and the default context.
 java.lang.String getDataType(java.lang.Object o, java.lang.String name, java.lang.Object context)
          Returns the data type of the value associated with a principal key, a given name and a context.
 java.lang.String getString(java.lang.Object o, java.lang.String name)
          Returns the String value associated with a principal key, a given name and the default context.
 java.lang.String getString(java.lang.Object o, java.lang.String name, java.lang.Object context)
          Returns the String value associated with a principal key, a given name and context.
 AbstractScalar getValue(java.lang.Object o, java.lang.String name)
          Returns the AbstractScalar value associated with a principal key, a given name and the default context.
 AbstractScalar getValue(java.lang.Object o, java.lang.String name, java.lang.Object context)
          Returns the AbstractScalar value associated with a principal key, a given name and context.
 java.util.Iterator<?> keysIterator()
          Give an iterator on the principals keys store in this map.
 java.util.Iterator<java.lang.String> namesIterator(java.lang.Object o)
          Give an Iterator on all the name of values associated with a given principal key and the default context.
 java.util.Iterator<java.lang.String> namesIterator(java.lang.Object o, java.lang.Object context)
          Give an Iterator on all the name of values associated with a given principal key and context.
 void putAll(java.util.Map<?,?> m, java.lang.String name)
          Put all pairs of values present in a Map in this Map with a given name.
 void putAll(java.util.Map<?,?> m, java.lang.String name, java.lang.Object context)
          Put all pairs of values present in a Map in this Map with a given name and context.
 void putString(java.lang.Object o, java.lang.String name, java.lang.Object context, java.lang.String value)
          Associate a value (String) with a principal key, a given name and a context.
 void putString(java.lang.Object o, java.lang.String name, java.lang.String value)
          Associate a value (String) with a principal key, a name and the default context.
 void putValue(java.lang.Object o, java.lang.String name, AbstractScalar value)
          Associate a value (AbstractScalar) with a principal key, a name and the default context.
 void putValue(java.lang.Object o, java.lang.String name, java.lang.Object context, AbstractScalar value)
          Associate a value (AbstractScalar) with a principal key, a name and a context.
 boolean remove(java.lang.Object o, java.lang.String name)
          Remove the entry corresponding to a given principal key, a given name and the default context.
 boolean remove(java.lang.Object o, java.lang.String name, java.lang.Object context)
          Remove the entry corresponding to a given principal key, a given name and a given context.
 void removeAll(java.lang.Object o)
          Remove all values associated with a given principal key.
 void removeAll(java.lang.Object o, java.lang.Object context)
          Remove all values associated with a given principal key and context.
 

Method Detail

getString

java.lang.String getString(java.lang.Object o,
                           java.lang.String name)
Returns the String value associated with a principal key, a given name and the default context.

Parameters:
o - The principal key.
name - the name of value to get.
Returns:
the string representing the value.

getValue

AbstractScalar getValue(java.lang.Object o,
                        java.lang.String name)
Returns the AbstractScalar value associated with a principal key, a given name and the default context.

Parameters:
o - The principal key.
name - the name of value to get.
Returns:
the AbstractScalar representing the value.

getDataType

java.lang.String getDataType(java.lang.Object o,
                             java.lang.String name)
Returns the data type of the value associated with a principal key, a given name and the default context. The String representation of the datatype correspond only to the class name without package path. For exemple the string return for a String is "String" and not "java.lang.String".

Parameters:
o - The principal key.
name - the name of the value.
Returns:
a string containing the data type of the value or null if no value exist.

getDataType

java.lang.String getDataType(java.lang.Object o,
                             java.lang.String name,
                             java.lang.Object context)
Returns the data type of the value associated with a principal key, a given name and a context. The String representation of the datatype correspond only to the class name without package path. For exemple the string return for a String is "String" and not "java.lang.String".

Parameters:
o - the principql key.
name - the name of the value.
context - the context of the value.
Returns:
a string containing the data type of the value or null if no value exist.

getString

java.lang.String getString(java.lang.Object o,
                           java.lang.String name,
                           java.lang.Object context)
Returns the String value associated with a principal key, a given name and context.

Parameters:
o - The principal key.
name - the name of value.
context - the context of the value.
Returns:
the string representing the value.

getValue

AbstractScalar getValue(java.lang.Object o,
                        java.lang.String name,
                        java.lang.Object context)
Returns the AbstractScalar value associated with a principal key, a given name and context.

Parameters:
o - the principal key.
name - the name of value.
context - the context of the value.
Returns:
the AbstractScalar representing the value.

putString

void putString(java.lang.Object o,
               java.lang.String name,
               java.lang.String value)
Associate a value (String) with a principal key, a name and the default context.

Parameters:
o - The principal key.
name - the name of value.
value - the value to store.

putValue

void putValue(java.lang.Object o,
              java.lang.String name,
              AbstractScalar value)
Associate a value (AbstractScalar) with a principal key, a name and the default context.

Parameters:
o - The principal key.
name - the name of value.
value - the value to store.

putString

void putString(java.lang.Object o,
               java.lang.String name,
               java.lang.Object context,
               java.lang.String value)
Associate a value (String) with a principal key, a given name and a context.

Parameters:
o - the principal key.
name - the name of value.
context - The context of the value.
value - the value to store.

putValue

void putValue(java.lang.Object o,
              java.lang.String name,
              java.lang.Object context,
              AbstractScalar value)
Associate a value (AbstractScalar) with a principal key, a name and a context.

Parameters:
o - the principal key.
name - the name of value.
context - The context of the value.
value - the value to store.

putAll

void putAll(java.util.Map<?,?> m,
            java.lang.String name)
            throws java.lang.IllegalArgumentException
Put all pairs of values present in a Map in this Map with a given name. The default context is used to store value in this Map.

Parameters:
m - The Map.
name - The name of values in this Map.
Throws:
java.lang.IllegalArgumentException - If one or more values in the Map is not an AbstractScalar or a String.

putAll

void putAll(java.util.Map<?,?> m,
            java.lang.String name,
            java.lang.Object context)
            throws java.lang.IllegalArgumentException
Put all pairs of values present in a Map in this Map with a given name and context.

Parameters:
m - The Map.
name - The name used to add values in this Map.
context - The context used to add values in this Map.
Throws:
java.lang.IllegalArgumentException - If one or more values in the Map is not an AbstractScalar or a String.

remove

boolean remove(java.lang.Object o,
               java.lang.String name)
Remove the entry corresponding to a given principal key, a given name and the default context.

Parameters:
o - the principal key.
name - the name of value.
Returns:
true if this Map is modified and false otherwise.

remove

boolean remove(java.lang.Object o,
               java.lang.String name,
               java.lang.Object context)
Remove the entry corresponding to a given principal key, a given name and a given context.

Parameters:
o - the principal key.
name - the name of value.
context - the context of the value.
Returns:
true if this Map is modified and false otherwise.

namesIterator

java.util.Iterator<java.lang.String> namesIterator(java.lang.Object o)
Give an Iterator on all the name of values associated with a given principal key and the default context. You can use this function when you have object with values which you don't know the name.

Parameters:
o - The principal key.
Returns:
an iterator on String.

namesIterator

java.util.Iterator<java.lang.String> namesIterator(java.lang.Object o,
                                                   java.lang.Object context)
Give an Iterator on all the name of values associated with a given principal key and context. You can use this function when you have object with values which you don't know the name.

Parameters:
o - the principal key.
context - the context.
Returns:
an iterator on String.

contextsIterator

java.util.Iterator<?> contextsIterator(java.lang.Object o,
                                       java.lang.String name)
Give an Iterator on all contexts assiated with a given principal key and name.

Parameters:
o - the principal key.
name - the name.
Returns:
an iterator on the contexts

contextsIterator

java.util.Iterator<?> contextsIterator(java.lang.Object o)
Returns an iterator on all contexts associated with a principal key.

Parameters:
o - The principal key.
Returns:
an iterator on the contexts

removeAll

void removeAll(java.lang.Object o,
               java.lang.Object context)
Remove all values associated with a given principal key and context.

Parameters:
o - the principal key.
context - the context of values.

removeAll

void removeAll(java.lang.Object o)
Remove all values associated with a given principal key.

Parameters:
o - The object to remove from the map.

clear

void clear()
Clear the content of this Map


contains

boolean contains(java.lang.Object o,
                 java.lang.String name)
Say if an entry exist in this Map corresponding to a given principal key and name using default context.

Parameters:
o - the principal key.
name - the name of the value.
Returns:
true if an entry exist and false otherwise.

contains

boolean contains(java.lang.Object o,
                 java.lang.String name,
                 java.lang.Object context)
Say if an entry exist in this Map corresponding to a given principal key,name and context.

Parameters:
o - the principal key.
name - the name of the value.
context - the context of the value.
Returns:
a boolean.

keysIterator

java.util.Iterator<?> keysIterator()
Give an iterator on the principals keys store in this map.

Returns:
The iterator on the principals keys of this map.

contains

boolean contains(java.lang.Object o)
Say if an object is a principal key.

Parameters:
o - the principal key.
Returns:
true if o is a principal key and false otherwise.


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.