public class Cover<T extends Serializable & Comparable<? super T>,D extends Comparable<? super D>> extends Object implements Comparable<Object>, Serializable, Cloneable
content through this cover. Extending properties are defined by the
descriptor. May be used as base for Wrappers, Pointers or Connections.
Implementing all java-standard interfaces like Serializable, Comparable, Cloneable and the
methods Object.hashCode(), Object.equals(Object), you may use this class to extend your class with
some properties (defined by the descriptor).
An example use case would be to add a weight to your class, using that weight to be sorted and compared.
TODO: create interfaces for 'Wrapper+Source' or 'Pointer+Destination', 'Delegator+Source', 'Extender+Base',
'Hull+Core', 'Cover+Core'
| Modifier and Type | Field and Description |
|---|---|
protected T |
content
content
|
protected D |
descriptor
description or extension
|
| Constructor and Description |
|---|
Cover(T core,
D descriptor)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o) |
boolean |
equals(Object obj) |
T |
getContent()
getContent
|
D |
getDescriptor() |
int |
hashCode() |
void |
setDescriptor(D descriptor) |
String |
toString() |
protected T extends Serializable & Comparable<? super T> content
protected D extends Comparable<? super D> descriptor
public Cover(T core, D descriptor)
core - contentdescriptor - descriptorpublic D getDescriptor()
descriptor.public void setDescriptor(D descriptor)
weight - The descriptor to set.public int compareTo(Object o)
compareTo in interface Comparable<Object>Copyright © 2012–2018. All rights reserved.