|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jmythapi.impl.AData<E>
org.jmythapi.database.impl.ADatabaseRow<E>
public abstract class ADatabaseRow<E extends Enum<E>>
| Field Summary |
|---|
| Fields inherited from class org.jmythapi.impl.AData |
|---|
logger, propsClass, protoVersion, respArgs |
| Constructor Summary | |
|---|---|
ADatabaseRow(ProtocolVersion protoVersion,
int dbVersion,
Class<E> propsClass)
|
|
ADatabaseRow(ProtocolVersion protoVersion,
int dbVersion,
Class<E> propsClass,
List<String> data)
|
|
| Method Summary | ||
|---|---|---|
Object |
clone()
Creates a copy of this object. |
|
protected
|
decodeProperty(Class<T> dataType,
String dataValue)
|
|
protected
|
encodeProperty(Class<S> propObjectType,
S propValue,
Class<T> propStringType,
String propDefaultValue)
|
|
boolean |
equals(Object obj)
Tests objects for equality. |
|
int |
getDatabaseVersion()
|
|
EnumSet<E> |
getProperties()
Returns all supported properties. |
|
E |
getProperty(int idx)
Gets the property for the given index. |
|
int |
getPropertyIndex(E prop)
Gets the index for the given property. |
|
| Methods inherited from class org.jmythapi.impl.AData |
|---|
getPropertyClass, getPropertyCount, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValueObject, getPropertyValues, getVersionNr, hashCode, init, postProcessArguments, setPropertyValue, setPropertyValue, setPropertyValueObject, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jmythapi.IVersionable |
|---|
getVersionNr |
| Constructor Detail |
|---|
public ADatabaseRow(ProtocolVersion protoVersion,
int dbVersion,
Class<E> propsClass)
public ADatabaseRow(ProtocolVersion protoVersion,
int dbVersion,
Class<E> propsClass,
List<String> data)
| Method Detail |
|---|
public int getDatabaseVersion()
public E getProperty(int idx)
IPropertyAware
This is the reverse operation of IPropertyAware.getPropertyIndex(Enum).
for(int i=0; i < object.getPropertyCount(); i++) { System.out.println(String.format( "Property %02d: %s", i, object.getProperty(i) )); }
getProperty in interface IPropertyAware<E extends Enum<E>>getProperty in class AData<E extends Enum<E>>idx - the position within the property array
public int getPropertyIndex(E prop)
IPropertyAware
This is the reverse operation of IPropertyAware.getProperty(int)
-1 is returned.
EnumSet<IProgramInfo.Props> props = program.getProperties(); for(IProgramInfo.Props prop : props) { System.out.println(String.format( "Property %s is stored at position %d.", prop.name(), program.getPropertyIndex(prop) )); }
getPropertyIndex in interface IPropertyAware<E extends Enum<E>>getPropertyIndex in class AData<E extends Enum<E>>prop - the property for which the index should be returned
-1, if a property is not supported in
the currently used protocol version.public EnumSet<E> getProperties()
IPropertyAware
getProperties in interface IPropertyAware<E extends Enum<E>>getProperties in class AData<E extends Enum<E>>
protected <T> T decodeProperty(Class<T> dataType,
String dataValue)
decodeProperty in class AData<E extends Enum<E>>
protected <S,T> String encodeProperty(Class<S> propObjectType,
S propValue,
Class<T> propStringType,
String propDefaultValue)
encodeProperty in class AData<E extends Enum<E>>
public Object clone()
throws CloneNotSupportedException
AData
clone in class AData<E extends Enum<E>>CloneNotSupportedExceptionpublic boolean equals(Object obj)
Data objects are seen to be equal if the response to the following function calls are equal:
Object.getClass()AData.getVersionNr()getDatabaseVersion()AData.getPropertyClass()AData.getPropertyValues()
equals in class AData<E extends Enum<E>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||