public class SimplePrimitiveDriveElement extends Object implements DriveElement
| Constructor and Description |
|---|
SimplePrimitiveDriveElement(Object value)
Creates a new drive element to store a primitive
|
| Modifier and Type | Method and Description |
|---|---|
DriveElement |
add(DriveElement driveElement)
Adds drive elements together.
|
DriveElement |
deepClone()
Deep clones this element and returns the clone
|
Boolean |
getAsBoolean() |
Character |
getAsChar() |
Double |
getAsDouble() |
DriveElement |
getAsElement() |
DriveElementArray |
getAsElementArray() |
Float |
getAsFloat() |
Integer |
getAsInt() |
Long |
getAsLong() |
DriveObject |
getAsObject() |
Short |
getAsShort() |
String |
getAsString() |
Object |
getPrimitiveValue() |
HashMap<String,DriveElement> |
getSubComponents() |
DriveElement |
subtract(DriveElement driveElement)
Subtracts a Drive element from this element leaving only the difference
of this object compared to the parameter element.
|
public SimplePrimitiveDriveElement(Object value) throws NotAPrimitiveTypeException
value - the value to saveNotAPrimitiveTypeException - thrown if the value is not a primitivepublic Boolean getAsBoolean() throws ClassCastException
getAsBoolean in interface DriveElementBooleanClassCastException - thrown if the element is not that typepublic Short getAsShort() throws ClassCastException
getAsShort in interface DriveElementShortClassCastException - thrown if the element is not that typepublic Integer getAsInt() throws ClassCastException
getAsInt in interface DriveElementIntegerClassCastException - thrown if the element is not that typepublic Long getAsLong() throws ClassCastException
getAsLong in interface DriveElementLongClassCastException - thrown if the element is not that typepublic Character getAsChar() throws ClassCastException
getAsChar in interface DriveElementCharacterClassCastException - thrown if the element is not that typepublic String getAsString() throws ClassCastException
getAsString in interface DriveElementStringClassCastException - thrown if the element is not that typepublic Float getAsFloat() throws ClassCastException
getAsFloat in interface DriveElementFloatClassCastException - thrown if the element is not that typepublic Double getAsDouble() throws ClassCastException
getAsDouble in interface DriveElementDoubleClassCastException - thrown if the element is not that typepublic DriveObject getAsObject() throws ClassCastException
getAsObject in interface DriveElementDriveObjectClassCastException - thrown if the element is not that typepublic DriveElement getAsElement() throws ClassCastException
getAsElement in interface DriveElementDriveElementClassCastException - thrown if the element is not that typepublic DriveElementArray getAsElementArray() throws ClassCastException
getAsElementArray in interface DriveElementDriveElementArrayClassCastException - thrown if the element is not that typepublic Object getPrimitiveValue()
getPrimitiveValue in interface DriveElementpublic HashMap<String,DriveElement> getSubComponents()
getSubComponents in interface DriveElementpublic DriveElement subtract(DriveElement driveElement)
DriveElementsubtract in interface DriveElementdriveElement - the element to subtractpublic DriveElement add(DriveElement driveElement)
DriveElementadd in interface DriveElementdriveElement - the drive element to addpublic DriveElement deepClone()
DriveElementdeepClone in interface DriveElementCopyright © 2020. All rights reserved.