Cross Reference: PerformImpl.java
xref
: /
owl-s
/
src
/
impl
/
owls
/
process
/
constructs
/
PerformImpl.java
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
PerformImpl.java revision 8
2
ronwalf
/*
2
ronwalf
* Created on Aug 26, 2004
2
ronwalf
*/
2
ronwalf
package
impl
.
owls
.
process
;
2
ronwalf
2
ronwalf
import
java
.
util
.
ArrayList
;
2
ronwalf
import
java
.
util
.
List
;
2
ronwalf
2
ronwalf
import
org
.
mindswap
.
owl
.
OWLIndividual
;
2
ronwalf
import
org
.
mindswap
.
owls
.
OWLSFactory
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
BindingList
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
CompositeProcess
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
ControlConstruct
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
Input
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
InputBinding
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
InputBindingList
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
Parameter
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
ParameterValue
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
Perform
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
Process
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
ProcessList
;
2
ronwalf
import
org
.
mindswap
.
owls
.
process
.
ValueOf
;
2
ronwalf
import
org
.
mindswap
.
owls
.
vocabulary
.
OWLS
;
2
ronwalf
2
ronwalf
/**
2
ronwalf
*
@author
Evren Sirin
2
ronwalf
*/
2
ronwalf
public
class
PerformImpl
extends
ControlConstructImpl
implements
Perform
{
2
ronwalf
public
PerformImpl
(
OWLIndividual
ind
) {
2
ronwalf
super
(
ind
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
void
addBinding
(
Input
input
,
ParameterValue
paramValue
) {
2
ronwalf
InputBinding
binding
=
getOntology
().
createInputBinding
();
2
ronwalf
binding
.
setParameter
(
input
);
2
ronwalf
binding
.
setValue
(
paramValue
);
2
ronwalf
2
ronwalf
addBinding
(
binding
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
void
addBinding
(
Input
input
,
Perform
perform
,
Parameter
param
) {
2
ronwalf
ValueOf
valueOf
=
getOntology
().
createValueOf
();
2
ronwalf
valueOf
.
setPerform
(
perform
);
2
ronwalf
valueOf
.
setParameter
(
param
);
2
ronwalf
2
ronwalf
addBinding
(
input
,
valueOf
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
void
addBinding
(
InputBinding
binding
) {
2
ronwalf
addProperty
(
OWLS
.
Process
.
hasDataFrom
,
binding
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
InputBindingList
getBindings
() {
2
ronwalf
return
OWLSFactory
.
createInputBindingList
(
getProperties
(
OWLS
.
Process
.
hasDataFrom
));
2
ronwalf
}
2
ronwalf
2
ronwalf
public
InputBinding
getBindingFor
(
Input
input
) {
2
ronwalf
BindingList
bindings
=
getBindings
();
2
ronwalf
return
(
bindings
==
null
) ?
null
: (
InputBinding
)
bindings
.
getBindingFor
(
input
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
Process
getProcess
() {
7
daenzerorama
Process
process
= (
Process
)
getPropertyAs
(
OWLS
.
Process
.
process
,
Process
.
class
);
8
daenzerorama
if
(
process
!=
null
)
8
daenzerorama
process
.
setPerform
(
this
);
7
daenzerorama
return
process
;
2
ronwalf
}
2
ronwalf
2
ronwalf
public
void
setProcess
(
Process
process
) {
8
daenzerorama
if
(
process
!=
null
)
8
daenzerorama
process
.
setPerform
(
this
);
2
ronwalf
setProperty
(
OWLS
.
Process
.
process
,
process
);
2
ronwalf
}
2
ronwalf
2
ronwalf
public
List
getConstructs
() {
2
ronwalf
return
new
ArrayList
();
2
ronwalf
}
2
ronwalf
2
ronwalf
public
ProcessList
getAllProcesses
(
boolean
recursive
) {
2
ronwalf
Process
process
=
getProcess
();
2
ronwalf
ProcessList
list
=
new
ProcessListImpl
();
2
ronwalf
list
.
add
(
process
);
2
ronwalf
if
(
recursive
) {
2
ronwalf
if
(
process
instanceof
CompositeProcess
) {
2
ronwalf
ControlConstruct
cc
= ((
CompositeProcess
)
process
).
getComposedOf
();
2
ronwalf
ProcessList
processes
=
cc
.
getAllProcesses
(
recursive
);
2
ronwalf
list
.
addAll
(
processes
);
2
ronwalf
}
2
ronwalf
}
2
ronwalf
2
ronwalf
return
list
;
2
ronwalf
}
2
ronwalf
2
ronwalf
public
String
getConstructName
() {
2
ronwalf
return
"Perform"
;
2
ronwalf
}
2
ronwalf
}