Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private void setLocation(List<Step> steps) {
}

// combine sublocations into 1 Location
if (sublocations.size() == 0) {
if (sublocations.isEmpty()) {
location = null;
} else if (sublocations.size() == 1) {
location = sublocations.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void addIntronsUsingExons() throws Exception {
if (intronAdded) { //going to assume introns are correct
return;
}
if (exonSequenceList.size() == 0) {
if (exonSequenceList.isEmpty()) {
return;
}
ExonComparator exonComparator = new ExonComparator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SequenceAsStringHelper<C extends Compound> {
*/
public String getSequenceAsString(List<C> parsedCompounds, CompoundSet<C> compoundSet, Integer bioBegin, Integer bioEnd, Strand strand) {
// TODO Optimise/cache.
if(parsedCompounds.size() == 0)
if(parsedCompounds.isEmpty())
return "";
StringBuilder builder = new StringBuilder();
if (strand.equals(Strand.NEGATIVE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void declareNamespace(String nsURI, String prefixHint)
private void handleDeclaredNamespaces()
throws IOException
{
if (namespacesDeclared.size() == 0) {
if (namespacesDeclared.isEmpty()) {
for (Iterator<String> nsi = namespacesDeclared.iterator(); nsi.hasNext(); ) {
String nsURI = nsi.next();
if (!namespacePrefixes.containsKey(nsURI)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void setPrefSize() {
public void setAligMap(List<AlignedPosition> apos){
this.apos = apos;

if ( apos.size() == 0)
if (apos.isEmpty())
return;

AlignedPosition last = apos.get(apos.size()-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static void cluster(AlternativeAlignment[] aligs, int cutoff){

}
clusters.add(currentCluster);
if ( remainList.size() == 0) {
if ( remainList.isEmpty()) {
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void setAlignRes(List<List<Integer>> alignRes) {
public int length() {
if (alignRes == null)
return 0;
if (alignRes.size() == 0)
if (alignRes.isEmpty())
return 0;
return alignRes.get(0).size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public int size() {
// Get the size from the variables that can contain the information
if (parent != null)
return parent.size();
else if (getBlocks().size() == 0) {
else if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
} else
Expand All @@ -194,7 +194,7 @@ public int getCoreLength() {
}

protected void updateLength() {
if (getBlocks().size() == 0) {
if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
}
Expand All @@ -207,7 +207,7 @@ protected void updateLength() {
}

protected void updateCoreLength() {
if (getBlocks().size() == 0) {
if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public int getCoreLength() {
* lengths.
*/
protected void updateLength() {
if (getBlockSets().size() == 0) {
if (getBlockSets().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty MultipleAlignment: blockSets size == 0.");
} // Otherwise try to calculate it from the BlockSet information
Expand All @@ -223,7 +223,7 @@ protected void updateLength() {
* BlockSet core lengths.
*/
protected void updateCoreLength() {
if (getBlockSets().size() == 0) {
if (getBlockSets().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty MultipleAlignment: blockSets size == 0.");
} // Otherwise try to calculate it from the BlockSet information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public MultipleMcOptimizer(MultipleAlignment seedAln,
for (Block b : toDelete) {
for (BlockSet bs : msa.getBlockSets()) {
bs.getBlocks().remove(b);
if (bs.getBlocks().size() == 0)
if (bs.getBlocks().isEmpty())
emptyBs.add(bs);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void setSubunitMap(Map<Integer, Integer> subunitMap) {
"Subunit Map index higher than Subunit List size.");

// Update the relation enum
if (subunitMap.size() == 0) {
if (subunitMap.isEmpty()) {
relation = QsRelation.DIFFERENT;
} else if (subunitMap.keySet().size() == subunits1.size()) {
if (subunitMap.values().size() == subunits2.size()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public Structure getBiologicalAssembly(String pdbId, int bioAssemblyId, boolean
throws StructureException, IOException {
return getBiologicalAssembly(new PdbId(pdbId), bioAssemblyId, multiModel);
}

/**
* Returns the biological assembly for a given PDB ID and bioAssemblyId, by building the
* assembly from the biounit annotations found in {@link Structure#getPDBHeader()}
Expand Down Expand Up @@ -284,7 +284,7 @@ public Structure getBiologicalAssembly(PdbId pdbId, int bioAssemblyId, boolean m
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();


if (transformations == null || transformations.size() == 0) {
if (transformations == null || transformations.isEmpty()) {
throw new StructureException("Could not load transformations to recreate biological assembly id " + bioAssemblyId + " of " + pdbId);
}

Expand Down Expand Up @@ -339,7 +339,7 @@ public Structure getBiologicalAssembly(String pdbId, boolean multiModel) throws
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();


if (transformations == null || transformations.size() == 0) {
if (transformations == null || transformations.isEmpty()) {
throw new StructureException("Could not load transformations to recreate biological assembly id " + bioAssemblyId + " of " + pdbId);
}

Expand Down Expand Up @@ -385,7 +385,7 @@ public List<Structure> getBiologicalAssemblies(String pdbId, boolean multiModel)
List<BiologicalAssemblyTransformation> transformations =
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();

if (transformations == null || transformations.size() == 0) {
if (transformations == null || transformations.isEmpty()) {
logger.info("Could not load transformations to recreate biological assembly id {} of {}. Assembly " +
"id will be missing in biological assemblies.", bioAssemblyId, pdbId);
continue;
Expand Down Expand Up @@ -807,7 +807,7 @@ public Structure getStructureForPdbId(String id) throws IOException, StructureEx
public Structure getStructureForPdbId(PdbId pdbId) throws IOException {
if (pdbId == null)
return null;

while (checkLoading(pdbId)) {
// waiting for loading to be finished...
try {
Expand All @@ -833,7 +833,7 @@ public Structure getStructureForPdbId(PdbId pdbId) throws IOException {
protected Structure loadStructureFromCifByPdbId(String pdbId) throws IOException {
return loadStructureFromCifByPdbId(new PdbId(pdbId));
}

protected Structure loadStructureFromCifByPdbId(PdbId pdbId) throws IOException {
logger.debug("Loading structure {} from mmCIF file {}.", pdbId, path);
Structure s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public ChemComp getChemComp(String recordName) {
}

// If a null record or an empty chemcomp, return a default ChemComp and blacklist.
if (cc == null || (null == cc.getName() && cc.getAtoms().size() == 0)) {
if (cc == null || (null == cc.getName() && cc.getAtoms().isEmpty())) {
s_logger.info("Unable to find or download {} - excluding from future searches.", recordName);
unavailable.add(recordName);
return getEmptyChemComp(recordName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public boolean mergeIdenticalByEntityId(SubunitCluster other) {
}
}

if (thisAligned.size() == 0 && otherAligned.size() == 0) {
if (thisAligned.isEmpty() && otherAligned.isEmpty()) {
logger.warn("No equivalent aligned atoms found between SubunitClusters {}-{} via entity SEQRES alignment. Is FileParsingParameters.setAlignSeqRes() set?", thisName, otherName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static Stoichiometry cluster(Structure structure,

public static Stoichiometry cluster(List<Subunit> subunits, SubunitClustererParameters params) {
List<SubunitCluster> clusters = new ArrayList<>();
if (subunits.size() == 0)
if (subunits.isEmpty())
return new Stoichiometry(clusters);

// First generate a new cluster for each Subunit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void addPoint(Point3d point, double mass) {

public Point3d getCenterOfMass() {

if (points.size() == 0) {
if (points.isEmpty()) {
throw new IllegalStateException(
"MomentsOfInertia: no points defined");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
// build it up.

if ( groupCode3.equals(currentGroup.getPDBName())) {
if ( currentGroup.getAtoms().size() == 0) {
if ( currentGroup.getAtoms().isEmpty()) {
//System.out.println("current group is empty " + current_group + " " + altLoc);
return currentGroup;
}
Expand Down Expand Up @@ -2762,7 +2762,7 @@ private void makeCompounds(List<String> compoundList,
}
// System.out.println("[makeCompounds] adding sources to compounds from sourceLines");
// since we're starting again from the first compound, reset it here
if ( entities.size() == 0){
if ( entities.isEmpty()){
current_compound = new EntityInfo();
} else {
current_compound = entities.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ private Group getCorrectAltLocGroup(Character altLoc) {
}
// no matching altLoc group found.
// build it up.
if (group.getAtoms().size() == 0) {
if (group.getAtoms().isEmpty()) {
return group;
}
Group altLocG = (Group) group.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static double[] getBiologicalMoleculeCentroid( final Structure asymUnit,
return centroid;
}

if ( transformations.size() == 0) {
if ( transformations.isEmpty()) {
return Calc.getCentroid(atoms).getCoords();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private void addChainMultiModel(Structure s, Chain newChain, String transformId)

// multi-model bioassembly

if ( modelIndex.size() == 0)
if (modelIndex.isEmpty())
modelIndex.add("PLACEHOLDER FOR ASYM UNIT");

int modelCount = modelIndex.indexOf(transformId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Map<Integer[], Integer> getInteractingRepeatUnits() {

private void run() {
this.repeatUnitCenters = calcRepeatUnitCenters();
if (this.repeatUnitCenters.size() == 0) {
if (this.repeatUnitCenters.isEmpty()) {
return;
}
this.repeatUnits = calcRepeatUnits();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void complete() {

public String getPointGroup() {
if (modified) {
if (rotations.size() == 0) {
if (rotations.isEmpty()) {
return "C1";
}
complete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private boolean isSpherical() {
* @return null if invalid, or a rotation if valid
*/
private Rotation isValidPermutation(List<Integer> permutation) {
if (permutation.size() == 0) {
if (permutation.isEmpty()) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void completeRotationGroup() {
}

private boolean isValidPermutation(List<Integer> permutation) {
if (permutation.size() == 0) {
if (permutation.isEmpty()) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private List<T> getBoxTwo(long location) {
}
// ensure that boxTwo has no empty element by copying from tempBox of defined size
List<T> boxTwo = null;
if (tempBox.size() == 0) {
if (tempBox.isEmpty()) {
boxTwo = Collections.emptyList();
} else if (tempBox.size() == 1) {
boxTwo = Collections.singletonList(tempBox.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,10 @@ public List<String> getTransfAlgebraic() {

public void setTransfAlgebraic(List<String> transfAlgebraic) {
//System.out.println("setting transfAlgebraic " + transfAlgebraic);
if ( transformations == null || transformations.size() == 0)
if ( transformations == null || transformations.isEmpty())
transformations = new ArrayList<Matrix4d>(transfAlgebraic.size());

if ( this.transfAlgebraic == null || this.transfAlgebraic.size() == 0)
if ( this.transfAlgebraic == null || this.transfAlgebraic.isEmpty())
this.transfAlgebraic = new ArrayList<>(transfAlgebraic.size());

for ( String transf : transfAlgebraic){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void paintTable(Graphics g) {
sfiHashMap = sfi.getStrataInfoHashMap();
}

if(sfiHashMap.size() == 0)
if(sfiHashMap.isEmpty())
return;
//int height = this.getHeight();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public int compareTo(HmmerResult o) {
return(me.getSqFrom().compareTo(other.getSqFrom()));
}
private boolean emptyDomains(HmmerResult o) {
if ( o.getDomains() == null || o.getDomains().size() == 0)
if ( o.getDomains() == null || o.getDomains().isEmpty())
return true;
return false;
}
Expand Down
Loading