summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java
diff options
context:
space:
mode:
authorErich Schubert <erich@debian.org>2012-12-14 20:45:15 +0100
committerAndrej Shadura <andrewsh@debian.org>2019-03-09 22:30:35 +0000
commit357b2761a2c0ded8cad5e4d3c1e667b7639ff7a6 (patch)
tree3dd8947bb70a67c221adc3cd4359ba1d385e2f3c /src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java
parent4343785ebed9d4145f417d86d581f18a0d31e4ac (diff)
parentb7b404fd7a726774d442562d11659d7b5368cdb9 (diff)
Import Debian changes 0.5.5-1
elki (0.5.5-1) unstable; urgency=low * New upstream release: 0.5.5 interim release.
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java')
-rw-r--r--src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java60
1 files changed, 13 insertions, 47 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java b/src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java
index a1db6d1c..4ba86a8b 100644
--- a/src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java
+++ b/src/de/lmu/ifi/dbs/elki/data/type/VectorTypeInformation.java
@@ -33,19 +33,19 @@ import de.lmu.ifi.dbs.elki.persistent.ByteBufferSerializer;
*
* @param <V> Vector type
*/
-public class VectorTypeInformation<V extends FeatureVector<?, ?>> extends SimpleTypeInformation<V> {
+public class VectorTypeInformation<V extends FeatureVector<?>> extends SimpleTypeInformation<V> {
/**
- * Minimum dimensionality
+ * Minimum dimensionality.
*/
protected final int mindim;
/**
- * Maximum dimensionality
+ * Maximum dimensionality.
*/
protected final int maxdim;
-
+
/**
- * Constructor.
+ * Constructor for an actual type.
*
* @param cls base class
* @param serializer Serializer
@@ -60,17 +60,7 @@ public class VectorTypeInformation<V extends FeatureVector<?, ?>> extends Simple
}
/**
- * Constructor without size constraints.
- *
- * @param cls base class
- * @param serializer Serializer
- */
- public VectorTypeInformation(Class<? super V> cls, ByteBufferSerializer<? super V> serializer) {
- this(cls, serializer, -1, Integer.MAX_VALUE);
- }
-
- /**
- * Constructor.
+ * Constructor for a type request.
*
* @param cls base class
* @param mindim Minimum dimensionality
@@ -81,9 +71,9 @@ public class VectorTypeInformation<V extends FeatureVector<?, ?>> extends Simple
}
/**
- * Constructor without size constraints.
+ * Constructor for a type request without dimensionality constraints.
*
- * @param cls
+ * @param cls Class constraint
*/
public VectorTypeInformation(Class<? super V> cls) {
this(cls, null, -1, Integer.MAX_VALUE);
@@ -153,39 +143,15 @@ public class VectorTypeInformation<V extends FeatureVector<?, ?>> extends Simple
return maxdim;
}
- /**
- * Pseudo constructor that is often convenient to use when T is not completely known.
- *
- * @param <T> Type
- * @param cls Class restriction
- * @param mindim Minimum dimensionality
- * @param maxdim Maximum dimensionality
- * @return Type information
- */
- public static <T extends FeatureVector<?, ?>> VectorTypeInformation<T> get(Class<T> cls, int mindim, int maxdim) {
- return new VectorTypeInformation<T>(cls, mindim, maxdim);
- }
-
- /**
- * Pseudo constructor that is often convenient to use when T is not completely known.
- *
- * @param <T> Type
- * @param cls Class restriction
- * @return Type information
- */
- public static <T extends FeatureVector<?, ?>> VectorTypeInformation<T> get(Class<T> cls) {
- return new VectorTypeInformation<T>(cls);
- }
-
@Override
public String toString() {
- StringBuffer buf = new StringBuffer(super.toString());
+ StringBuilder buf = new StringBuilder(super.toString());
buf.append(",variable");
- if (mindim >= 0) {
- buf.append(",mindim="+mindim);
+ if(mindim >= 0) {
+ buf.append(",mindim=").append(mindim);
}
- if (maxdim < Integer.MAX_VALUE) {
- buf.append(",maxdim="+maxdim);
+ if(maxdim < Integer.MAX_VALUE) {
+ buf.append(",maxdim=").append(maxdim);
}
return buf.toString();
}