Tabnine Logo
ArrayTable$Representation
Code IndexAdd Tabnine to your IDE (free)

How to use
ArrayTable$Representation
in
net.hydromatic.optiq.impl.clone

Best Java code snippets using net.hydromatic.optiq.impl.clone.ArrayTable$Representation (Showing top 20 results out of 315)

origin: net.hydromatic/optiq

public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) {
 final int n = valueSet.map.keySet().size();
 int extra = valueSet.containsNull ? 1 : 0;
 Comparable[] codeValues =
   valueSet.map.keySet().toArray(new Comparable[n + extra]);
 Arrays.sort(codeValues, 0, n);
 ColumnLoader.ValueSet codeValueSet =
   new ColumnLoader.ValueSet(int.class);
 final List<Comparable> list = permuteList(valueSet.values, sources);
 for (Comparable value : list) {
  int code;
  if (value == null) {
   code = n;
  } else {
   code = Arrays.binarySearch(codeValues, value);
   assert code >= 0 : code + ", " + value;
  }
  codeValueSet.add(code);
 }
 Object codes = representation.freeze(codeValueSet, null);
 return Pair.of(codes, codeValues);
}
origin: net.hydromatic/optiq

public Object[] current() {
 Object[] objects = new Object[columnCount];
 for (int j = 0; j < objects.length; j++) {
  final Column pair = columns.get(j);
  objects[j] = pair.representation.getObject(pair.dataSet, i);
 }
 return objects;
}
origin: org.apache.optiq/optiq-core

public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) {
 final int n = valueSet.map.keySet().size();
 int extra = valueSet.containsNull ? 1 : 0;
 Comparable[] codeValues =
   valueSet.map.keySet().toArray(new Comparable[n + extra]);
 Arrays.sort(codeValues, 0, n);
 ColumnLoader.ValueSet codeValueSet =
   new ColumnLoader.ValueSet(int.class);
 final List<Comparable> list = permuteList(valueSet.values, sources);
 for (Comparable value : list) {
  int code;
  if (value == null) {
   code = n;
  } else {
   code = Arrays.binarySearch(codeValues, value);
   assert code >= 0 : code + ", " + value;
  }
  codeValueSet.add(code);
 }
 Object codes = representation.freeze(codeValueSet, null);
 return Pair.of(codes, codeValues);
}
origin: org.apache.optiq/optiq-core

public Object get(int index) {
 return representation.getObject(dataSet, index);
}
origin: net.hydromatic/optiq

 /** Returns a list view onto a data set. */
 public static List asList(final Representation representation,
   final Object dataSet) {
  // Cache size. It might be expensive to compute.
  final int size = representation.size(dataSet);
  return new AbstractList() {
   public Object get(int index) {
    return representation.getObject(dataSet, index);
   }
   public int size() {
    return size;
   }
  };
 }
}
origin: net.hydromatic/optiq

/** Freezes the contents of this value set into a column, optionally
 * re-ordering if {@code sources} is specified. */
ArrayTable.Column freeze(int ordinal, int[] sources) {
 ArrayTable.Representation representation = chooseRep(ordinal);
 final int cardinality = map.size() + (containsNull ? 1 : 0);
 final Object data = representation.freeze(this, sources);
 return new ArrayTable.Column(representation, data, cardinality);
}
origin: org.apache.optiq/optiq-core

/** Freezes the contents of this value set into a column, optionally
 * re-ordering if {@code sources} is specified. */
ArrayTable.Column freeze(int ordinal, int[] sources) {
 ArrayTable.Representation representation = chooseRep(ordinal);
 final int cardinality = map.size() + (containsNull ? 1 : 0);
 final Object data = representation.freeze(this, sources);
 return new ArrayTable.Column(representation, data, cardinality);
}
origin: net.hydromatic/optiq

public Object permute(Object dataSet, int[] sources) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 Object codes = pair.left;
 Comparable[] codeValues = pair.right;
 return Pair.of(representation.permute(codes, sources), codeValues);
}
origin: net.hydromatic/optiq

public Column permute(int[] sources) {
 return new Column(
   representation,
   representation.permute(dataSet, sources),
   cardinality);
}
origin: org.apache.optiq/optiq-core

 private void checkColumn(ArrayTable.Column x,
   ArrayTable.RepresentationType expectedRepresentationType,
   String expectedString) {
  assertEquals(
    expectedRepresentationType,
    x.representation.getType());
  assertEquals(expectedString, x.toString());
 }
}
origin: org.apache.optiq/optiq-core

public int size(Object dataSet) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 return representation.size(pair.left);
}
origin: org.apache.optiq/optiq-core

public Object getObject(Object dataSet, int ordinal) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 int code = representation.getInt(pair.left, ordinal);
 return pair.right[code];
}
origin: net.hydromatic/optiq

@Override
public String toString() {
 return "Column(representation=" + representation
   + ", value=" + representation.toString(dataSet) + ")";
}
origin: org.apache.optiq/optiq-core

 /** Returns a list view onto a data set. */
 public static List asList(final Representation representation,
   final Object dataSet) {
  // Cache size. It might be expensive to compute.
  final int size = representation.size(dataSet);
  return new AbstractList() {
   public Object get(int index) {
    return representation.getObject(dataSet, index);
   }
   public int size() {
    return size;
   }
  };
 }
}
origin: net.hydromatic/optiq

public Object get(int index) {
 return representation.getObject(dataSet, index);
}
origin: net.hydromatic/optiq

 private void checkColumn(ArrayTable.Column x,
   ArrayTable.RepresentationType expectedRepresentationType,
   String expectedString) {
  assertEquals(
    expectedRepresentationType,
    x.representation.getType());
  assertEquals(expectedString, x.toString());
 }
}
origin: org.apache.optiq/optiq-core

public Object permute(Object dataSet, int[] sources) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 Object codes = pair.left;
 Comparable[] codeValues = pair.right;
 return Pair.of(representation.permute(codes, sources), codeValues);
}
origin: net.hydromatic/optiq

public int size(Object dataSet) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 return representation.size(pair.left);
}
origin: net.hydromatic/optiq

public Object getObject(Object dataSet, int ordinal) {
 final Pair<Object, Comparable[]> pair =
   (Pair<Object, Comparable[]>) dataSet;
 int code = representation.getInt(pair.left, ordinal);
 return pair.right[code];
}
origin: org.apache.optiq/optiq-core

public Column permute(int[] sources) {
 return new Column(
   representation,
   representation.permute(dataSet, sources),
   cardinality);
}
net.hydromatic.optiq.impl.cloneArrayTable$Representation

Javadoc

Representation of the values of a column.

Most used methods

  • freeze
    Converts a value set into a compact representation. If sources is not null, permutes.
  • getInt
  • getObject
  • getType
    Returns the representation type.
  • permute
    Creates a data set that is the same as a given data set but re-ordered.
  • size
    Returns the number of elements in a data set. (Some representations return the capacity, which may b
  • toString
    Converts a data set to a string.

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JCheckBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now