Package org.btrplace.btrpsl.element
Class BtrpElement
java.lang.Object
org.btrplace.btrpsl.element.DefaultBtrpOperand
org.btrplace.btrpsl.element.BtrpElement
- All Implemented Interfaces:
BtrpOperand
,Copyable<BtrpOperand>
public class BtrpElement extends DefaultBtrpOperand
Denotes either a VM or a node.
An element as a unique name but also a unique UUID that will be used by btrplace.
- Author:
- Fabien Hermenier
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.btrplace.btrpsl.element.BtrpOperand
BtrpOperand.Type
-
Constructor Summary
Constructors Constructor Description BtrpElement(BtrpOperand.Type ty, String n, Element el)
Make a new element. -
Method Summary
Modifier and Type Method Description BtrpElement
copy()
Make a deep copy of the object.int
degree()
Get the degree of the operand.BtrpNumber
eq(BtrpOperand other)
Check if this operand is equals to another one.boolean
equals(Object o)
Check the equality of two elements.Element
getElement()
Get the element.String
getName()
Get the element identifier.int
hashCode()
String
toString()
BtrpOperand.Type
type()
Get the type of the operand.Methods inherited from class org.btrplace.btrpsl.element.DefaultBtrpOperand
div, geq, gt, label, minus, negate, not, plus, power, prettyType, prettyType, prettyType, remainder, setLabel, times
-
Constructor Details
-
BtrpElement
Make a new element.- Parameters:
ty
- the element type. EitherBtrpOperand.Type.VM
orBtrpOperand.Type.NODE
.n
- the element nameel
- the associated BtrPlace element
-
-
Method Details
-
getName
Get the element identifier.- Returns:
- a non null String.
-
getElement
Get the element.- Returns:
- an element
-
equals
Check the equality of two elements. Both are equals if they are an instance of a same class and if they contains the same element. -
hashCode
public int hashCode() -
degree
public int degree()Description copied from interface:BtrpOperand
Get the degree of the operand. A degree of 0 indicates a single value. A degree of 1 indicates a set of single value. A degree of 2 indicate a set of set of values. Basically. An operand with a degree n is a set of elements with all having the degree n - 1- Returns:
0
-
type
Description copied from interface:BtrpOperand
Get the type of the operand.- Returns:
- a type
-
eq
Description copied from interface:BtrpOperand
Check if this operand is equals to another one.- Specified by:
eq
in interfaceBtrpOperand
- Overrides:
eq
in classDefaultBtrpOperand
- Parameters:
other
- the operand to compare to- Returns:
BtrpNumber.TRUE
if both operand are equals,BtrpNumber.FALSE
otherwise
-
copy
Description copied from interface:Copyable
Make a deep copy of the object.- Returns:
- a deep copy
-
toString
-