org.meta2project.model.helper
Class MMapHelper

java.lang.Object
  extended by org.meta2project.model.helper.MMapHelper

public class MMapHelper
extends java.lang.Object

Author:
Anton Malykh

Field Summary
static java.lang.String MAP_CLASS
           
static java.lang.String MAP_URI
           
 
Constructor Summary
MMapHelper()
           
 
Method Summary
static void cleanUp(Connection con)
           
static OntObject create(Connection con)
          Create a new map object.
static java.lang.String[] getOKeys(Connection con, OntObject obj)
          Get all o-key names of the map object.
static java.lang.String[] getTKeys(Connection con, OntObject obj)
          Get all t-key names of the map object.
static void init(Connection con)
          Init the map ontology (if need)
static boolean isMap(Connection con, OntObject obj)
          Verify if this a map object.
static boolean isOkey(Connection con, OntObject obj, java.lang.String name)
          Verify if there is a o-key with the name in the map.
static boolean isTkey(Connection con, OntObject obj, java.lang.String name)
          Verify if there is a t-key with the name in the map.
static java.lang.String name(Connection con, Property prop)
          Get the key name for a tproperty.
static OProperty okey(Connection con, OntObject object, java.lang.String name)
          Create a new o-key for the map
static void removeKey(Connection con, OntObject object, java.lang.String name)
          Remove the key from the map.
static TProperty tkey(Connection con, OntObject object, java.lang.String name)
          Create a new t-key for the map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_URI

public static final java.lang.String MAP_URI
See Also:
Constant Field Values

MAP_CLASS

public static final java.lang.String MAP_CLASS
See Also:
Constant Field Values
Constructor Detail

MMapHelper

public MMapHelper()
Method Detail

init

public static void init(Connection con)
Init the map ontology (if need)

Parameters:
con - connection

create

public static OntObject create(Connection con)
Create a new map object.

Parameters:
con - connection
Returns:
map object

isMap

public static boolean isMap(Connection con,
                            OntObject obj)
Verify if this a map object.

Parameters:
con - connection
obj - object to verify
Returns:
true if this is a map object

name

public static java.lang.String name(Connection con,
                                    Property prop)
Get the key name for a tproperty. If the tproperty is not a map key, then null is returned.

Parameters:
con - connection
prop - tproperty to verify
Returns:
null if the tproperty is not a map key

isTkey

public static boolean isTkey(Connection con,
                             OntObject obj,
                             java.lang.String name)
Verify if there is a t-key with the name in the map.

Parameters:
con - connection
obj - map object
name - name to verify
Returns:
true if there is the key with that name in the map

isOkey

public static boolean isOkey(Connection con,
                             OntObject obj,
                             java.lang.String name)
Verify if there is a o-key with the name in the map.

Parameters:
con - connection
obj - map object
name - name to verify
Returns:
true if there is the key with that name in the map

getTKeys

public static java.lang.String[] getTKeys(Connection con,
                                          OntObject obj)
Get all t-key names of the map object.

Parameters:
con - connection
obj - map
Returns:
empty array if object is not map or there are no t-keys

getOKeys

public static java.lang.String[] getOKeys(Connection con,
                                          OntObject obj)
Get all o-key names of the map object.

Parameters:
con - connection
obj - map
Returns:
empty array if object is not map or there are no o-keys

tkey

public static TProperty tkey(Connection con,
                             OntObject object,
                             java.lang.String name)
Create a new t-key for the map

Parameters:
con - connection
object - map
name - t-key name
Returns:
created t-property

okey

public static OProperty okey(Connection con,
                             OntObject object,
                             java.lang.String name)
Create a new o-key for the map

Parameters:
con - connection
object - map
name - o-key name
Returns:
created o-property

removeKey

public static void removeKey(Connection con,
                             OntObject object,
                             java.lang.String name)
Remove the key from the map.

Parameters:
con - connection
object - map
name - key name

cleanUp

public static void cleanUp(Connection con)