_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q175600
DataDescriptorTreeConstructor.decode
test
private List<DataDescriptor> decode(List<Short> keyDesc, BufrTableLookup lookup) { if (keyDesc == null) return null; List<DataDescriptor> keys = new ArrayList<DataDescriptor>(); for (short id : keyDesc) { DataDescriptor dd = new DataDescriptor(id, lookup); keys.add( dd); if (dd.f =...
java
{ "resource": "" }
q175601
DataDescriptorTreeConstructor.replicate
test
private List<DataDescriptor> replicate(List<DataDescriptor> keys) { List<DataDescriptor> tree = new ArrayList<DataDescriptor>(); Iterator<DataDescriptor> dkIter = keys.iterator(); while (dkIter.hasNext()) { DataDescriptor dk = dkIter.next(); if (dk.f == 1) { dk.subKeys = new ArrayL...
java
{ "resource": "" }
q175602
ServerDDS.getDatasetFilename
test
public String getDatasetFilename() { String s = getEncodedName(); System.out.println(s); return (s); }
java
{ "resource": "" }
q175603
GempakSurfaceIOSP.getCFFeatureType
test
public String getCFFeatureType() { if (gemreader.getFileSubType().equals(GempakSurfaceFileReader.SHIP)) { return CF.FeatureType.point.toString(); } return CF.FeatureType.timeSeries.toString(); }
java
{ "resource": "" }
q175604
Misc.nearlyEqualsAbs
test
public static boolean nearlyEqualsAbs(float a, float b, float maxAbsDiff) { return absoluteDifference(a, b) <= Math.abs(maxAbsDiff); }
java
{ "resource": "" }
q175605
Universal.references
test
@Override public boolean references(DapNode node) { switch (node.getSort()) { case DIMENSION: case ENUMERATION: case VARIABLE: case GROUP: case DATASET: return true; default: break; } return false; }
java
{ "resource": "" }
q175606
UnitFormatImpl.parse
test
public final Unit parse(final String spec) throws NoSuchUnitException, UnitParseException, SpecificationException, UnitDBException, PrefixDBException, UnitSystemException { synchronized (MUTEX) { return parse(spec, UnitDBManager.instance()); } }
java
{ "resource": "" }
q175607
Tools.probeObject
test
public static void probeObject(Object o) { Class c = o.getClass(); Class interfaces[] = c.getInterfaces(); Class parent = c.getSuperclass(); Method m[] = c.getMethods(); System.out.println("********* OBJECT PROBE *********"); System.out.println("Class Name: "...
java
{ "resource": "" }
q175608
AggregationTiled.isTiled
test
private boolean isTiled(Variable v) { for (Dimension d : v.getDimensions()) { for (Range r : section.getRanges()) { if (d.getShortName().equals(r.getName())) return true; } } return false; }
java
{ "resource": "" }
q175609
CoordinateTimeAbstract.makeBestFromComplete
test
public CoordinateTimeAbstract makeBestFromComplete() { int[] best = new int[time2runtime.length]; int last = -1; int count = 0; for (int i=0; i<time2runtime.length; i++) { int time = time2runtime[i]; if (time >= last) { last = time; best[i] = time; count++; } el...
java
{ "resource": "" }
q175610
LatLonProjection.latLonToProjRect
test
public ProjectionRect[] latLonToProjRect(LatLonRect latlonR) { double lat0 = latlonR.getLowerLeftPoint().getLatitude(); double height = Math.abs(latlonR.getUpperRightPoint().getLatitude() - lat0); double width = latlonR.getWidth(); double lon0 = LatLonPointImpl.lonNormal( latlonR.getLower...
java
{ "resource": "" }
q175611
AccessLogTable.showTimeSeriesAll
test
private void showTimeSeriesAll(java.util.List<LogReader.Log> logs) { TimeSeries bytesSentData = new TimeSeries("Bytes Sent", Minute.class); TimeSeries timeTookData = new TimeSeries("Average Latency", Minute.class); TimeSeries nreqData = new TimeSeries("Number of Requests", Minute.class); String interva...
java
{ "resource": "" }
q175612
Attribute.makeMap
test
static public Map<String, Attribute> makeMap(List<Attribute> atts) { int size = (atts == null) ? 1 : atts.size(); Map<String, Attribute> result = new HashMap<>(size); if(atts == null) return result; for(Attribute att : atts) result.put(att.getShortName(), att); return result; }
java
{ "resource": "" }
q175613
Attribute.getValues
test
public Array getValues() { if (values == null && svalue != null) { values = Array.factory(DataType.STRING, new int[]{1}); values.setObject(values.getIndex(), svalue); } return values; }
java
{ "resource": "" }
q175614
Attribute.getNumericValue
test
public Number getNumericValue(int index) { if ((index < 0) || (index >= nelems)) return null; // LOOK can attributes be enum valued? for now, no switch (dataType) { case STRING: try { return new Double(getStringValue(index)); } catch (NumberFormatException e) { ...
java
{ "resource": "" }
q175615
Attribute.writeCDL
test
protected void writeCDL(Formatter f, boolean strict, String parentname) { if(strict && (isString() || this.getEnumType() != null)) // Force type explicitly for string. f.format("string "); //note lower case and trailing blank if(strict && parentname != null) f.format(NetcdfFile.makeValidCDLName(pare...
java
{ "resource": "" }
q175616
Attribute.setStringValue
test
private void setStringValue(String val) { if (val == null) throw new IllegalArgumentException("Attribute value cannot be null"); // get rid of trailing nul characters int len = val.length(); while ((len > 0) && (val.charAt(len - 1) == 0)) len--; if (len != val.length()) val = val....
java
{ "resource": "" }
q175617
Attribute.setValues
test
public void setValues(List values) { if(values == null || values.size() == 0) throw new IllegalArgumentException("Cannot determine attribute's type"); int n = values.size(); Class c = values.get(0).getClass(); Object pa; if (c == String.class) { String[] va = new String[n]; pa = va; ...
java
{ "resource": "" }
q175618
Attribute.setValues
test
public void setValues(Array arr) { if (immutable) throw new IllegalStateException("Cant modify"); if (arr == null) { dataType = DataType.STRING; return; } if (arr.getElementType() == char.class) { // turn CHAR into STRING ArrayChar carr = (ArrayChar) arr; if (carr.getRank() == ...
java
{ "resource": "" }
q175619
CollectionLevelScanner.scan
test
public void scan() throws IOException { if ( state == 1 ) throw new IllegalStateException( "Scan already underway." ); if ( state >= 2 ) throw new IllegalStateException( "Scan has already been generated." ); state = 1; // Make sure proxyDsHandlers Map is not null. if ( proxyDsHandlers == null ) p...
java
{ "resource": "" }
q175620
CollectionLevelScanner.generateProxyDsResolverCatalog
test
public InvCatalogImpl generateProxyDsResolverCatalog( ProxyDatasetHandler pdh ) { if ( state != 2 ) throw new IllegalStateException( "Scan has not been performed." ); if ( ! proxyDsHandlers.containsValue( pdh )) throw new IllegalArgumentException( "Unknown ProxyDatasetHandler."); // Create a skeleton cat...
java
{ "resource": "" }
q175621
MessageWriter.scheduleWrite
test
void scheduleWrite(Message m) { q.add(m); if (!isScheduled.getAndSet(true)) { executor.submit( this); } }
java
{ "resource": "" }
q175622
ToolsUI.setThreddsDatatype
test
private void setThreddsDatatype(thredds.client.catalog.Dataset invDataset, String wants) { if (invDataset == null) return; boolean wantsViewer = wants.equals("File"); boolean wantsCoordSys = wants.equals("CoordSys"); try { // just open as a NetcdfDataset if (wantsViewer) { ...
java
{ "resource": "" }
q175623
ToolsUI.jumptoThreddsDatatype
test
private void jumptoThreddsDatatype(thredds.client.catalog.Access invAccess) { if (invAccess == null) { return; } thredds.client.catalog.Service s = invAccess.getService(); if (s.getType() == ServiceType.HTTPServer) { downloadFile(invAccess.getStandardUrlName()); return; }...
java
{ "resource": "" }
q175624
ToolsUI.jumptoThreddsDatatype
test
private void jumptoThreddsDatatype(DataFactory.Result threddsData) { if (threddsData.fatalError) { JOptionPane.showMessageDialog(this, "Cant open dataset=" + threddsData.errLog); try { threddsData.close(); } catch (IOException e) { e.printStackTrace(); } ...
java
{ "resource": "" }
q175625
ToolsUI.setDataset
test
private static void setDataset() { // do it in the swing event thread SwingUtilities.invokeLater(( ) -> { int pos = wantDataset.indexOf('#'); if (pos > 0) { final String catName = wantDataset.substring(0, pos); // {catalog}#{dataset} if (catN...
java
{ "resource": "" }
q175626
ToolsUI.prepareGui
test
private static void prepareGui() { final String osName = System.getProperty("os.name").toLowerCase(); final boolean isMacOs = osName.startsWith("mac os x"); if (isMacOs) { System.setProperty("apple.laf.useScreenMenuBar", "true"); // fixes the case on macOS wher...
java
{ "resource": "" }
q175627
ToolsUI.createToolsFrame
test
private static void createToolsFrame() { // put UI in a JFrame frame = new JFrame("NetCDF (" + DIALOG_VERSION + ") Tools"); ui = new ToolsUI(prefs, frame); frame.setIconImage(BAMutil.getImage("netcdfUI")); frame.addWindowListener(new WindowAdapter() { @Ove...
java
{ "resource": "" }
q175628
CoordinateSystem.makeName
test
static public String makeName( List<CoordinateAxis> axes) { List<CoordinateAxis> axesSorted = new ArrayList<>( axes); Collections.sort( axesSorted, new CoordinateAxis.AxisComparator()); StringBuilder buff = new StringBuilder(); for (int i=0; i<axesSorted.size(); i++) { CoordinateAxis axis = axesSo...
java
{ "resource": "" }
q175629
CoordinateSystem.lesserRank
test
private CoordinateAxis lesserRank( CoordinateAxis a1, CoordinateAxis a2) { if (a1 == null) return a2; return (a1.getRank() <= a2.getRank()) ? a1 : a2; }
java
{ "resource": "" }
q175630
CoordinateSystem.findAxis
test
public CoordinateAxis findAxis( AxisType type) { CoordinateAxis result = null; for (CoordinateAxis axis : coordAxes) { AxisType axisType = axis.getAxisType(); if ((axisType != null) && (axisType == type)) result = lesserRank(result, axis); } return result; }
java
{ "resource": "" }
q175631
CoordinateSystem.getProjectionCT
test
public ProjectionCT getProjectionCT() { for (CoordinateTransform ct : coordTrans) { if (ct instanceof ProjectionCT) return (ProjectionCT) ct; } return null; }
java
{ "resource": "" }
q175632
CoordinateSystem.isGeoXY
test
public boolean isGeoXY() { if ((xAxis == null) || (yAxis == null)) return false; return null != getProjection() && !(projection instanceof LatLonProjection); }
java
{ "resource": "" }
q175633
CoordinateSystem.isRegular
test
public boolean isRegular() { for (CoordinateAxis axis : coordAxes) { if (!(axis instanceof CoordinateAxis1D)) return false; if (!((CoordinateAxis1D) axis).isRegular()) return false; } return true; }
java
{ "resource": "" }
q175634
CoordinateSystem.isSubset
test
public static boolean isSubset(Collection<Dimension> subset, Collection<Dimension> set) { for (Dimension d : subset) { if (!(set.contains(d))) return false; } return true; }
java
{ "resource": "" }
q175635
CoordinateSystem.containsAxes
test
public boolean containsAxes(List<CoordinateAxis> wantAxes) { for (CoordinateAxis ca : wantAxes) { if (!containsAxis(ca.getFullName())) return false; } return true; }
java
{ "resource": "" }
q175636
CoordinateSystem.containsAxis
test
public boolean containsAxis(String axisName) { for (CoordinateAxis ca : coordAxes) { if (ca.getFullName().equals(axisName)) return true; } return false; }
java
{ "resource": "" }
q175637
CoordinateSystem.containsDomain
test
public boolean containsDomain(List<Dimension> wantDimensions) { for (Dimension d : wantDimensions) { if (!domain.contains(d)) return false; } return true; }
java
{ "resource": "" }
q175638
CoordinateSystem.containsAxisTypes
test
public boolean containsAxisTypes(List<AxisType> wantAxes) { for (AxisType wantAxisType : wantAxes) { if (!containsAxisType(wantAxisType)) return false; } return true; }
java
{ "resource": "" }
q175639
CoordinateSystem.containsAxisType
test
public boolean containsAxisType(AxisType wantAxisType) { for (CoordinateAxis ca : coordAxes) { if (ca.getAxisType() == wantAxisType) return true; } return false; }
java
{ "resource": "" }
q175640
DAPNode.cloneDAG
test
public DAPNode cloneDAG(CloneMap map) throws CloneNotSupportedException { DAPNode node = (DAPNode)super.clone(); // Object.clone map.nodes.put(this,node); DAPNode tmp = map.nodes.get(_myParent); if(tmp != node) _myParent = tmp; return node; }
java
{ "resource": "" }
q175641
BeanTable.getSelectedBean
test
public Object getSelectedBean() { int viewRowIndex = jtable.getSelectedRow(); if(viewRowIndex < 0) return null; int modelRowIndex = jtable.convertRowIndexToModel(viewRowIndex); return (modelRowIndex < 0) || (modelRowIndex >= beans.size()) ? null : beans.get(modelRowIndex); }
java
{ "resource": "" }
q175642
BeanTable.getSelectedBeans
test
public List getSelectedBeans() { ArrayList<Object> list = new ArrayList<>(); int[] viewRowIndices = jtable.getSelectedRows(); for (int viewRowIndex : viewRowIndices) { int modelRowIndex = jtable.convertRowIndexToModel(viewRowIndex); list.add(beans.get(modelRowIndex)); if (debugSelected) Sy...
java
{ "resource": "" }
q175643
BeanTable.getSelectedCells
test
public ArrayList<Object> getSelectedCells() { ArrayList<Object> list = new ArrayList<>(); int[] viewRowIndices = jtable.getSelectedRows(); int[] viewColumnIndices = jtable.getSelectedColumns(); for (int i = 0; i < viewRowIndices.length; i++) for (int j = 0; i < viewColumnIndices.length; j++) { ...
java
{ "resource": "" }
q175644
BeanTable.setSelectedBean
test
public void setSelectedBean(Object bean) { if (bean == null) return; int modelRowIndex = beans.indexOf(bean); int viewRowIndex = jtable.convertRowIndexToView(modelRowIndex); if (viewRowIndex >= 0) jtable.getSelectionModel().setSelectionInterval(viewRowIndex, viewRowIndex); makeRowVisible(view...
java
{ "resource": "" }
q175645
BeanTable.restoreState
test
protected void restoreState() { if (store == null) { return; } ArrayList propColObjs = (ArrayList) store.getBean("propertyCol", new ArrayList()); HidableTableColumnModel tableColumnModel = (HidableTableColumnModel) jtable.getColumnModel(); int newViewIndex = 0; for (Object propColObj : p...
java
{ "resource": "" }
q175646
UnknownUnit.create
test
public static UnknownUnit create(String name) throws NameException { UnknownUnit unit; name = name.toLowerCase(); synchronized (map) { unit = map.get(name); if (unit == null) { unit = new UnknownUnit(name); map.put(unit.getName(), unit); map.put(unit.getPlural(), unit); ...
java
{ "resource": "" }
q175647
HTTPMethodStream.close
test
@Override public void close() throws IOException { if(closed) return; /* Allow multiple close calls */ closed = true; try { consume(); } finally { super.close(); } if(method != null) method.close(); }
java
{ "resource": "" }
q175648
NestedTable.isExtra
test
private boolean isExtra(Variable v) { return v != null && extras != null && extras.contains(v); }
java
{ "resource": "" }
q175649
NestedTable.isCoordinate
test
private boolean isCoordinate(Variable v) { if (v == null) return false; String name = v.getShortName(); return (latVE != null && latVE.axisName.equals(name)) || (lonVE != null && lonVE.axisName.equals(name)) || (altVE != null && altVE.axisName.equals(name)) || (stnAltVE !...
java
{ "resource": "" }
q175650
NestedTable.findCoordinateAxis
test
private CoordVarExtractor findCoordinateAxis(Table.CoordName coordName, Table t, int nestingLevel) { if (t == null) return null; String axisName = t.findCoordinateVariableName(coordName); if (axisName != null) { VariableDS v = t.findVariable(axisName); if (v != null) return new CoordVa...
java
{ "resource": "" }
q175651
NestedTable.addDataVariables
test
private void addDataVariables(List<VariableSimpleIF> list, Table t) { if (t.parent != null) addDataVariables(list, t.parent); for (VariableSimpleIF col : t.cols.values()) { if (t.nondataVars.contains(col.getFullName())) continue; if (t.nondataVars.contains(col.getShortName())) continue; // fishy ...
java
{ "resource": "" }
q175652
NestedTable.addParentJoin
test
void addParentJoin(Cursor cursor) throws IOException { int level = cursor.currentIndex; Table t = getTable(level); if (t.extraJoins != null) { List<StructureData> sdata = new ArrayList<>(3); sdata.add(cursor.tableData[level]); for (Join j : t.extraJoins) { sdata.add(j.getJoinData(c...
java
{ "resource": "" }
q175653
NestedTable.makeStation
test
StationFeature makeStation(StructureData stationData) { if (stnVE.isMissing(stationData)) return null; String stationName = stnVE.getCoordValueAsString(stationData); String stationDesc = (stnDescVE == null) ? "" : stnDescVE.getCoordValueAsString(stationData); String stnWmoId = (wmoVE == null) ? "" : wm...
java
{ "resource": "" }
q175654
DMRToCDM.create
test
public NodeMap<CDMNode,DapNode> create() throws DapException { // Netcdf Dataset will already have a root group Group cdmroot = ncfile.getRootGroup(); this.nodemap.put(cdmroot,this.dmr); fillGroup(cdmroot, this.dmr, ncfile); return this.nodemap; }
java
{ "resource": "" }
q175655
SimpleUnit.factory
test
static public SimpleUnit factory(String name) { try { return factoryWithExceptions(name); } catch (Exception e) { if (debugParse) System.out.println("Parse " + name + " got Exception " + e); return null; } }
java
{ "resource": "" }
q175656
SimpleUnit.factoryWithExceptions
test
static public SimpleUnit factoryWithExceptions(String name) throws UnitException { UnitFormat format = UnitFormatManager.instance(); Unit uu = format.parse(name); //if (isDateUnit(uu)) return new DateUnit(name); if (isTimeUnit(uu)) return new TimeUnit(name); return new SimpleUnit(uu); }
java
{ "resource": "" }
q175657
SimpleUnit.makeUnit
test
static protected Unit makeUnit(String name) throws UnitException { UnitFormat format = UnitFormatManager.instance(); return format.parse(name); }
java
{ "resource": "" }
q175658
SimpleUnit.isCompatibleWithExceptions
test
static public boolean isCompatibleWithExceptions(String unitString1, String unitString2) throws UnitException { UnitFormat format = UnitFormatManager.instance(); Unit uu1 = format.parse(unitString1); Unit uu2 = format.parse(unitString2); return uu1.isCompatible(uu2); }
java
{ "resource": "" }
q175659
SimpleUnit.isDateUnit
test
static public boolean isDateUnit(ucar.units.Unit uu) { boolean ok = uu.isCompatible(dateReferenceUnit); if (!ok) return false; try { uu.getConverterTo(dateReferenceUnit); return true; } catch (ConversionException e) { return false; } }
java
{ "resource": "" }
q175660
SimpleUnit.isTimeUnit
test
static public boolean isTimeUnit(String unitString) { SimpleUnit su = factory(unitString); return su != null && isTimeUnit(su.getUnit()); }
java
{ "resource": "" }
q175661
SimpleUnit.getConversionFactor
test
static public double getConversionFactor(String inputUnitString, String outputUnitString) throws IllegalArgumentException { SimpleUnit inputUnit = SimpleUnit.factory(inputUnitString); SimpleUnit outputUnit = SimpleUnit.factory(outputUnitString); return inputUnit.convertTo(1.0, outputUnit); }
java
{ "resource": "" }
q175662
SimpleUnit.convertTo
test
public double convertTo(double value, SimpleUnit outputUnit) throws IllegalArgumentException { try { return uu.convertTo(value, outputUnit.getUnit()); } catch (ConversionException e) { throw new IllegalArgumentException(e.getMessage()); } }
java
{ "resource": "" }
q175663
SimpleUnit.isUnknownUnit
test
public boolean isUnknownUnit() { ucar.units.Unit uu = getUnit(); if (uu instanceof ucar.units.UnknownUnit) return true; if (uu instanceof ucar.units.DerivedUnit) return isUnknownUnit((ucar.units.DerivedUnit) uu); if (uu instanceof ucar.units.ScaledUnit) { ucar.units.ScaledUnit scu = (u...
java
{ "resource": "" }
q175664
SimpleUnit.getValue
test
public double getValue() { if (!(uu instanceof ScaledUnit)) return Double.NaN; ScaledUnit offset = (ScaledUnit) uu; return offset.getScale(); }
java
{ "resource": "" }
q175665
ClauseFactory.newRelOpClause
test
public TopLevelClause newRelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideException { return new RelOpClause(operator, lhs, rhs); }
java
{ "resource": "" }
q175666
ClauseFactory.newBoolFunctionClause
test
public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BoolFunction function = functionLibrary.getBoolFunction(functionName); if (fu...
java
{ "resource": "" }
q175667
ClauseFactory.newBTFunctionClause
test
public SubClause newBTFunctionClause(String functionName, List children) throws DAP2ServerSideException, NoSuchFunctionException { BTFunction function = functionLibrary.getBTFunction(functionName); if (function == null) { ...
java
{ "resource": "" }
q175668
ImageArrayAdapter.makeGrayscaleImage
test
public static java.awt.image.BufferedImage makeGrayscaleImage( Array ma, IsMissingEvaluator missEval) { if (ma.getRank() < 2) return null; if (ma.getRank() == 3) ma = ma.reduce(); if (ma.getRank() == 3) ma = ma.slice( 0, 0); // we need 2D int h = ma.getShape()[0]; int w = ma.getShape(...
java
{ "resource": "" }
q175669
CatalogCrawler.crawl
test
public int crawl(InvCatalogImpl cat, CancelTask task, PrintWriter out, Object context) { if (out != null) out.println("***CATALOG " + cat.getCreateFrom()); countCatrefs = 0; for (InvDataset ds : cat.getDatasets()) { if (type == Type.all) crawlDataset(ds, task, out, context, true); ...
java
{ "resource": "" }
q175670
CatalogCrawler.crawlDataset
test
public void crawlDataset(InvDataset ds, CancelTask task, PrintWriter out, Object context, boolean release) { boolean isCatRef = (ds instanceof InvCatalogRef); if (filter != null && filter.skipAll(ds)) { if (isCatRef && release) ((InvCatalogRef) ds).release(); return; } boolean isDataScan = ...
java
{ "resource": "" }
q175671
CatalogCrawler.crawlDirectDatasets
test
public void crawlDirectDatasets(InvDataset ds, CancelTask task, PrintWriter out, Object context, boolean release) { boolean isCatRef = (ds instanceof InvCatalogRef); if (filter != null && filter.skipAll(ds)) { if (isCatRef && release) ((InvCatalogRef) ds).release(); return; } if (isCatRef) ...
java
{ "resource": "" }
q175672
GribIndexCache.getFileOrCache
test
public static File getFileOrCache(String fileLocation) { File result = getExistingFileOrCache(fileLocation); if (result != null) return result; return getDiskCache2().getFile(fileLocation); }
java
{ "resource": "" }
q175673
GribIndexCache.getExistingFileOrCache
test
public static File getExistingFileOrCache(String fileLocation) { File result = getDiskCache2().getExistingFileOrCache(fileLocation); if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for debugging int length = fileLocation.length(); ...
java
{ "resource": "" }
q175674
RandomAccessFile.setDebugLeaks
test
static public void setDebugLeaks(boolean b) { if (b) { count_openFiles.set(0); maxOpenFiles.set(0); allFiles = new HashSet<>(1000); } debugLeaks = b; }
java
{ "resource": "" }
q175675
RandomAccessFile.getAllFiles
test
static public List<String> getAllFiles() { if (null == allFiles) return null; List<String> result = new ArrayList<>(); result.addAll(allFiles); Collections.sort(result); return result; }
java
{ "resource": "" }
q175676
RandomAccessFile.close
test
public synchronized void close() throws IOException { if (cache != null) { if (cacheState > 0) { if (cacheState == 1) { cacheState = 2; if (cache.release(this)) // return true if in the cache, otherwise was opened regular, so must be closed regular return; ...
java
{ "resource": "" }
q175677
RandomAccessFile.seek
test
public void seek(long pos) throws IOException { if (pos < 0) throw new java.io.IOException("Negative seek offset"); // If the seek is into the buffer, just update the file pointer. if ((pos >= bufferStart) && (pos < dataEnd)) { filePosition = pos; return; } // need new ...
java
{ "resource": "" }
q175678
RandomAccessFile.flush
test
public void flush() throws IOException { if (bufferModified) { file.seek(bufferStart); file.write(buffer, 0, dataSize); //System.out.println("--flush at "+bufferStart+" dataSize= "+dataSize+ " filePosition= "+filePosition); bufferModified = false; } /* check min length ...
java
{ "resource": "" }
q175679
RandomAccessFile.read
test
public int read() throws IOException { // If the file position is within the data, return the byte... if (filePosition < dataEnd) { int pos = (int) (filePosition - bufferStart); filePosition++; return (buffer[pos] & 0xff); // ...or should we indicate EOF... } else if (endO...
java
{ "resource": "" }
q175680
RandomAccessFile.readShort
test
public final void readShort(short[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readShort(); } }
java
{ "resource": "" }
q175681
RandomAccessFile.readIntUnbuffered
test
public final int readIntUnbuffered(long pos) throws IOException { byte[] bb = new byte[4]; read_(pos, bb, 0, 4); int ch1 = bb[0] & 0xff; int ch2 = bb[1] & 0xff; int ch3 = bb[2] & 0xff; int ch4 = bb[3] & 0xff; if ((ch1 | ch2 | ch3 | ch4) < 0) { throw new EOFException(); } ...
java
{ "resource": "" }
q175682
RandomAccessFile.readInt
test
public final void readInt(int[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readInt(); } }
java
{ "resource": "" }
q175683
RandomAccessFile.readLong
test
public final void readLong(long[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readLong(); } }
java
{ "resource": "" }
q175684
RandomAccessFile.readFloat
test
public final void readFloat(float[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = Float.intBitsToFloat(readInt()); } }
java
{ "resource": "" }
q175685
RandomAccessFile.readDouble
test
public final void readDouble(double[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = Double.longBitsToDouble(readLong()); } }
java
{ "resource": "" }
q175686
RandomAccessFile.readString
test
public String readString(int nbytes) throws IOException { byte[] data = new byte[nbytes]; readFully(data); return new String(data, CDM.utf8Charset); }
java
{ "resource": "" }
q175687
RandomAccessFile.readStringMax
test
public String readStringMax(int nbytes) throws IOException { byte[] b = new byte[nbytes]; readFully(b); int count; for (count = 0; count < nbytes; count++) if (b[count] == 0) break; return new String(b, 0, count, CDM.utf8Charset); }
java
{ "resource": "" }
q175688
RandomAccessFile.writeBoolean
test
public final void writeBoolean(boolean[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeBoolean(pa[start + i]); } }
java
{ "resource": "" }
q175689
RandomAccessFile.writeShort
test
public final void writeShort(short[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeShort(pa[start + i]); } }
java
{ "resource": "" }
q175690
RandomAccessFile.writeChar
test
public final void writeChar(char[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeChar(pa[start + i]); } }
java
{ "resource": "" }
q175691
RandomAccessFile.writeInt
test
public final void writeInt(int[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeInt(pa[start + i]); } }
java
{ "resource": "" }
q175692
RandomAccessFile.writeLong
test
public final void writeLong(long[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeLong(pa[start + i]); } }
java
{ "resource": "" }
q175693
RandomAccessFile.writeFloat
test
public final void writeFloat(float[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeFloat(pa[start + i]); } }
java
{ "resource": "" }
q175694
RandomAccessFile.writeDouble
test
public final void writeDouble(double[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { writeDouble(pa[start + i]); } }
java
{ "resource": "" }
q175695
RandomAccessFile.writeBytes
test
public final void writeBytes(String s) throws IOException { int len = s.length(); for (int i = 0; i < len; i++) { write((byte) s.charAt(i)); } }
java
{ "resource": "" }
q175696
RandomAccessFile.writeBytes
test
public final void writeBytes(char b[], int off, int len) throws IOException { for (int i = off; i < len; i++) { write((byte) b[i]); } }
java
{ "resource": "" }
q175697
RandomAccessFile.searchForward
test
public boolean searchForward(KMPMatch match, int maxBytes) throws IOException { long start = getFilePointer(); long last = (maxBytes < 0) ? length() : Math.min(length(), start + maxBytes); long needToScan = last - start; // check what ever is now in the buffer int bytesAvailable = (int) (data...
java
{ "resource": "" }
q175698
Selector.appendQuery
test
public void appendQuery( StringBuffer sbuff, ArrayList values) { if (template != null) appendQueryFromTemplate( sbuff, values); else appendQueryFromParamValue( sbuff, values); }
java
{ "resource": "" }
q175699
DirectoryBuilder.factory
test
static public MCollection factory(FeatureCollectionConfig config, Path topDir, boolean isTop, IndexReader indexReader, String suffix, org.slf4j.Logger logger) throws IOException { DirectoryBuilder builder = new DirectoryBuilder(config.collectionName, topDir.toString(), suffix); DirectoryPartition dpart = new D...
java
{ "resource": "" }